serverless: Unable to deploy single lambda function for version 1.52.1
sls deploy -f “function_name” is not working throwing and exception
My serverless version is:
Framework Core: 1.52.1
Plugin: 3.0.0
SDK: 2.1.1
sls deploy -f function_name is not working
it throws and errors the complete trackback would be
TypeError: Cannot read property 'artifact' of undefined at ServerlessPythonRequirements.BbPromise.bind.then.then.then (/home/mahesh/shuttle/H2OLambda/pythonh20lambda/node_modules/serverless-python-requirements/index.js:176:48)
Any update on this would be appreciated. Thank you
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 42
- Comments: 47 (8 by maintainers)
Commits related to this issue
- Defined and added operator/worker name in servless.xml Added 'package: {}' in lambda definition due to serverless-python-requirements issue. See https://github.com/serverless/serverless/issues/6752#is... — committed to awskrug/kendra-button by deleted user 4 years ago
- fix(packaging): Consider absolute artifact paths (#6752) — committed to rib/serverless by rib 4 years ago
@ovunccetin Your workaround can be shorten to just:
I found a workaround but I’m not sure about the side effects.
The problem is the following line (line # 176 in my version) in serverless-python-requirements/index.js file:
It simply assumes the existence of package.artifact path in your function definition in serverless.yml.
As a work around I added "package: artifact: " to my function as follows and it worked:
Again, I’m not sure if this breaks anything else. I have just tried an individual function deployment and it worked. But I didn’t make a detailed test.
One solution I found is to downgrade it to version Framework Core: 1.51.0 Plugin: 1.3.11 SDK: 2.1.2
@ovunccetin and @lephuongbg confirming your workaround also works for serverless
1.65.0.new update 1.57.0 did not solve the problem , still have to downgrade it for resolving this issue
@ Maheshkumar094 thanks for the solution
If this is an issue with
serverless-python-requirementsit is one that has some dependencies/interactions with serverless itself, in that it is fixed by installing an earlier version of serverless (as described by @satejsarker ) and then reinstallingserverless-python-requirements.The fact that it seems to happen with PHP functions as well (see above comment) suggests this is not solely an issue with
serverless-python-requirements.From those posting config snippets so far, this is likely an issue in the
serverless-python-requirementsplugin.There is an issue open in that project tracking this: https://github.com/UnitedIncome/serverless-python-requirements/issues/414
Unless anyone is experiencing this issue is not using
serverless-python-requirementsit probably makes sense to track it over there.ovunccetin’s workaround works great, so far no drawbacks.