Lambda Run Remote - Runtime.InvalidEntrypoint
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.
When I run the remote configuration I receive Runtime.InvalidEntrypoint
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 what my Remote configuration looks like.
I use macOS and I read that Runtime.InvalidEntrypoint is thrown when the image is built with a different architecture type than expected which makes sense. macOS default configuration is arm64 and I guess lambda is expecting x86/64.
If that's the case, how to set up the remote configuration so that the output is x64 image?
Please sign in to leave a comment.
Hello,
Thank you for reaching Rider Forum.
I tried reproducing your issue on my Mac M1, however, I could run the Remote configuration with no issues. Also, InvalidEntrypoint error can occur because of the path settings, according to the documentation of the Amazon.
Thus, I'd like to check log files first in order to narrow down potential misconfiguration. Could you please reproduce the issue and collect the full log bundle so we could take a closer look at the case? Please upload logs to https://uploads.jetbrains.com and provide me with the file(s) ID.
Thank you in advance! Looking forward to hearing from you soon.