skip to Main Content

I’ve an existing lambda function with go1.x runtime, which working fine with sqs triggers. Trying to update the function to use new provided.al2 runtime using the instructions here.

https://aws.amazon.com/blogs/compute/migrating-aws-lambda-functions-from-the-go1-x-runtime-to-the-custom-runtime-on-amazon-linux-2/

Have updated the binary with bootstrap name, with this updated build command.
GOOS=linux GOARCH=amd64 go build -o bootstrap

New runtime settings

After updating this new package and changing runtime, execution is always timing out in the init phase.

INIT_REPORT Init Duration: 10008.47 ms Phase: init Status: timeout

INIT_REPORT Init Duration: 60060.47 ms Phase: invoke Status: error Error Type: Runtime.Unknown

Same code works when I change binary to main and switch back to go1.x runtime.
can someone help?

Edit:

Issue is resolved after updating aws-lambda-go library to latest.

Old version is working perfectly fine with Go 1.x runtime. But to use custom amazon linux 2 runtime, had to update the library to latest version.

2

Answers


  1. Chosen as BEST ANSWER

    Turns out that the github.com/aws/aws-lambda-go library used in existing code is not compatible with new al2 runtime. Have updated this library to the latest version and init timeout error isssue is resolved


  2. Could be that you forgot updating the lambda handler setting?
    See „change the handler“ here: https://www.go-on-aws.com/lambda-go/lambda_function/create-console-custom/

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search