You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
An improperly referenced variable should raise and error (so we can fix it) #3206
What went wrong?
I messed up and referenced a variable incorrectly. As a result, rather than an error about an ungroundable variable, I got the following:
Serverless Error ---------------------------------------
An error occurred while provisioning your stack: ScrapeProductsLambdaFunction
- Value of property Variables must be an object with
String (or simple type) properties.
Get Support --------------------------------------------
Docs: docs.serverless.com
Bugs: github.com/serverless/serverless/issues
Your Environment Information -----------------------------
OS: darwin
Node Version: 7.2.0
Serverless Version: 1.5.1
What did you expect should have happened?
I expect to get an error that variable "whatever.whoever" could not be found.
@erikerikson initially we used to throw errors, but then we changed to just ignore the reference so that the new overwrite/fallback functionality would work. So if you're using the {self:a, self:b} syntax, and the first reference is invalid, it'll just be ignored (not error out) and the second reference will be used.
Thanks for the background @eahefnawy! I've added detection of failure to resolve via standard or overwrite resolution paths in #3208. I've left it as a warning so as to avoid this being a breaking change. Plus, my cross-serverless-service loading scheme causes some of them. I'll bring this up in that context.
This just stung me on serverless 1.67.3. The actual line of config that causes the problem was the global env variables section. It was a rather simple configuration. Surprised to get a hollow error message.
Activity
erikerikson commentedon Feb 8, 2017
Here is the sls project that was failing to deploy:
https://github.com/Nordstrom/hello-retail/pull/26/files
I had erroneously omitted
.customfrom:${self:custom.retailStream.custom.exportRetailStreamWriterArn}(i.e. the wrong value was
${self:custom.retailStream.exportRetailStreamWriterArn}which is not defined)eahefnawy commentedon Feb 8, 2017
@erikerikson initially we used to throw errors, but then we changed to just ignore the reference so that the new overwrite/fallback functionality would work. So if you're using the
{self:a, self:b}syntax, and the first reference is invalid, it'll just be ignored (not error out) and the second reference will be used.erikerikson commentedon Feb 9, 2017
Thanks for the background @eahefnawy! I've added detection of failure to resolve via standard or overwrite resolution paths in #3208. I've left it as a warning so as to avoid this being a breaking change. Plus, my cross-serverless-service loading scheme causes some of them. I'll bring this up in that context.
Wambosa commentedon Apr 17, 2020
This just stung me on serverless
1.67.3. The actual line of config that causes the problem was the global env variables section. It was a rather simple configuration. Surprised to get a hollow error message.serverless.yml
stagevars.ymlsls deployoutput
and on subsequent retry:
sls deployoutput