Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Lambda custom al2 runtime with golang, timing out init phase

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.

like image 832
user9163519 Avatar asked Oct 28 '25 13:10

user9163519


1 Answers

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

like image 140
user9163519 Avatar answered Oct 30 '25 10:10

user9163519



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!