Lambda Run Remote - Runtime.InvalidEntrypoint

0

I've created a new project from a template HelloWorld. I use Rider and macOS. When I build the image with local configuration, the image is created successfully.

Enter image description here

When I run the remote configuration I receive Runtime.InvalidEntrypoint

Enter image description here

This is how my default template.yaml file looks like.

AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
  Sample SAM Template for HelloWorld

# More info about Globals: https://github.com/awslabs/serverless-application-model/blob/master/docs/globals.rst
Globals:
  Function:
    Timeout: 10
    MemorySize: 128

Resources:
  HelloWorldFunction:
    Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction
    Properties:
      PackageType: Image
      Events:
        HelloWorld:
          Type: Api # More info about API Event Source: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#api
          Properties:
            Path: /hello
            Method: get
    Metadata:
      DockerTag: dotnet6-v1
      DockerContext: ./src/HelloWorld
      Dockerfile: Dockerfile
      DockerBuildArgs:
        SAM_BUILD_MODE: run

Outputs:
  # ServerlessRestApi is an implicit API created out of Events key under Serverless::Function
  # Find out more about other implicit resources you can reference within SAM
  # https://github.com/awslabs/serverless-application-model/blob/master/docs/internals/generated_resources.rst#api
  HelloWorldApi:
    Description: "API Gateway endpoint URL for Prod stage for Hello World function"
    Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/hello/"
  HelloWorldFunction:
    Description: "Hello World Lambda Function ARN"
    Value: !GetAtt HelloWorldFunction.Arn
  HelloWorldFunctionIamRole:
    Description: "Implicit IAM Role created for Hello World function"
    Value: !GetAtt HelloWorldFunctionRole.Arn

This is how my Remote configuration looks like.

Enter image description here

I use macOS and I read that Runtime.InvalidEntrypoint is thrown when the image is build with a different architecture type than the expected which make sense. macOS default configuration is arm64 and I guess lambda is expecting x86/64. If that's the case, how to setup the remote configuration so that the output is x64 image?

Enter image description here

1 Answer
0

Hi,

I hope that you are doing well. From checking our documentation, it seems that this error is related to the ENTRYPOINT Container setting -> https://docs.aws.amazon.com/lambda/latest/dg/troubleshooting-images.html#troubleshooting-images-entry

Issue: You receive a Runtime.ExitError error message, or an error message with "errorType": "Runtime.InvalidEntrypoint".

Verify that the ENTRYPOINT to your container image includes the absolute path as the location. Also verify that the image does not contain a symlink as the ENTRYPOINT.

Can you kindly check this so it can be ruled out?

AWS
SUPPORT ENGINEER
Ryan_A
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions