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.

Using ImageConfig Causes SUPERNOVA Launch, Runtime.InvalidEntrypoint Errors

See original GitHub issue

While using the latest version of AWS SAM with sam init for a Ruby 2.7 container project I noticed that SAM’s template.yaml file has this section commented out and mentions how you can override the CMD in the Dockerfile. This option was attractive for me for reasons.

ImageConfig:
  Command: ['app.lambda_handler']

However, I have found that once you do this in our your AWS::Serverless::Function and deploy, your entire function is pretty much broken. Errors will be shown like this in CloudWatch.

SUPERNOVA Launch error: Couldn't find valid bootstrap(s): [app.lambda_handler] Entrypoint: [] Cmd: [app.lambda_handler] WorkingDir: [/var/task]
{
  "errorMessage": "RequestId: 68c820b5-b141-4d00-bdda-91acda1c74cf Error: Couldn't find valid bootstrap(s): [app.lambda_handler]",
  "errorType": "Runtime.InvalidEntrypoint"
}

Removing ImageConfig from template.yaml and redeploying will not help!!! The configuration is sticky.

Screen Shot 2020-12-04 at 4 23 11 PM

However, I did learn after a lot of trial and error that I can use the Lambda GUI to remove the CMD override and the function will start to work again. So unless I did some really wrong, the ImageConfig Command option looks to be completely broken, at least for me in Ruby 2.7 runtime. Might be for all runtimes tho? I have not checked.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

8reactions
ericmilanezecommented, Dec 23, 2020

Hi, I’m facing the same issue as @metaskills, but I’m using .net 5.0. In my CloudFormation yaml script I have this:

  WebhookCallsFunction:
    Type: AWS::Serverless::Function
    Properties:
      PackageType: Image
      ImageConfig:
        Command: [ "Caas.Functions::Caas.Functions.WebhookCalls::RepassarChamada" ]
        EntryPoint: []
        WorkingDirectory: "/var/task/"
      ImageUri: "860615044000.dkr.ecr.us-east-1.amazonaws.com/caas-lambda@sha256:aef398832bd65a91993a0448d94f1b910392b170bdd4d0913a69cf881c4bcc5d"
      Role: !GetAtt WebhookCallsFunctionRole.Arn

When I hit “Test” button on GUI, I receive this error in return:

START RequestId: 4d5298c8-b289-44ae-bae1-977d69bf96f1 Version: $LATEST
IMAGE	Launch error: Couldn't find valid bootstrap(s): [dotnet]	Entrypoint: [dotnet,Caas.Functions.dll]	Cmd: [Caas.Functions::Caas.Functions.WebhookCalls::RepassarChamada]	WorkingDir: [/var/task/]
END RequestId: 4d5298c8-b289-44ae-bae1-977d69bf96f1
REPORT RequestId: 4d5298c8-b289-44ae-bae1-977d69bf96f1	Duration: 27.26 ms	Billed Duration: 28 ms	Memory Size: 128 MB	Max Memory Used: 4 MB	
RequestId: 4d5298c8-b289-44ae-bae1-977d69bf96f1 Error: Couldn't find valid bootstrap(s): [dotnet]
Runtime.InvalidEntrypoint

I don’t want to remove the CMD, I need the CMD I put to work.

When I edit the CMD (not changing anything, just clicking Edit and then saving), the test work.

I also tried not to pass EntryPoint or leave it empty like [ "" ] or like this: [ ]

Can someone help me, please?

2reactions
jfusscommented, Jan 15, 2021

@berkcent This is a bug within Lambda’s CloudFormation. I will bring it back up with their team but it is not something we can directly handle.

Closing this as this is an issue with CloudFormation and not SAM. The workaround is to provide the Entrypoint and Cmd in the template.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using ImageConfig Causes SUPERNOVA Launch, Runtime ...
Using ImageConfig Causes SUPERNOVA Launch, Runtime.InvalidEntrypoint Errors #5785 ... Errors will be shown like this in CloudWatch.
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 Hashnode Post

No results found