question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to deploy single lambda function for version 1.52.1

See original GitHub issue

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

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:41
  • Comments:46 (7 by maintainers)

github_iconTop GitHub Comments

42reactions
lephuongbgcommented, Feb 21, 2020

@ovunccetin Your workaround can be shorten to just:

hello:
    # ...
    package: {}
21reactions
ovunccetincommented, Feb 17, 2020

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:

arguments[1].functionObj && 
    arguments[1].functionObj.package.artifact.

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:

hello:
    handler: hello.handler
    package:
      artifact:
    events:
      - http:
          path: hello
          method: get

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot deployment issues in Lambda
Error: Unable to load type 'Function.Handler' from assembly 'Function'. The name of the file or class in your function's handler configuration doesn't match ......
Read more >
Using Lambda Versions, Aliases and Safe Deployments with ...
In this article I discuss the merits of using Lambda versioning and aliases along with the AWS Serverless Application Model's (SAM) built-in ...
Read more >
Deploy Function - AWS Lambda - Serverless Framework
The sls deploy function command deploys an individual function without AWS CloudFormation. This command simply swaps out the zip file that your ...
Read more >
How to upgrade CDK from CDKv1 to CDKv2 in an existing ...
On december 2nd AWS announced the general availability of CDK version 2. The main reason that the CDK team released version two was...
Read more >
terraform-aws-modules/lambda/aws
Create, update, and publish AWS Lambda Function and Lambda Layer ... to either one version of Lambda Function (when deployment complete), ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found