You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Executing 'test.handler' in function directory '/workspaces/test'
terminate called after throwing an instance of 'std::logic_error'
what(): basic_string: construction from null is not valid
Aborted (core dumped)
This uses getenv in a global initializer to get an environment variable during the load of the RIC. If the environment variable is not set, the STL will throw an exception, and Node.js has no way of recovering from that (since it happens at module load time). The correct fix is to check for the environment variable in Init and to just throw a JavaScript-level exception explaining that the environment variable must be set. You should be able to bypass this by setting the AWS_LAMBDA_RUNTIME_API environment variable for now.
static const std::string ENDPOINT(getenv("AWS_LAMBDA_RUNTIME_API"));
This uses getenv in a global initializer to get an environment variable during the load of the RIC. If the environment variable is not set, the STL will throw an exception, and Node.js has no way of recovering from that (since it happens at module load time). The correct fix is to check for the environment variable in Init and to just throw a JavaScript-level exception explaining that the environment variable must be set. You should be able to bypass this by setting the AWS_LAMBDA_RUNTIME_API environment variable for now.
It needs to be set to the address of the AWS Lambda API. To test your lambda locally you need something like https://www.npmjs.com/package/lambda-local which will emulate the API.
Activity
[-]Error occured in docker. (construction from null is not valid)[/-][+]Error occured. (arm64, docker)[/+]amitizle commentedon Sep 13, 2023
We're having the same issue, @sdg9670 did you manage to resolve it?
amitizle commentedon Sep 13, 2023
We resolved it by using
aws-lambda-ric@2.1.0and not the latest version.sdg9670 commentedon Sep 17, 2023
@amitizle I gave up to use arm64 cpu. lol...
amunhoz commentedon Sep 27, 2023
I'm having the same problem in amd64 with latest version, any clue?
amitizle commentedon Sep 27, 2023
@amunhoz see my comment in here - try and use version 2.1.0
schuettc commentedon Nov 14, 2023
This is working for me. But quite difficult to figure out. Would like an update on when ^3 will work with arm64
carbontwelve commentedon Aug 15, 2024
I get the same error while following the official guide on using an alternative base image with the runtime interface client: https://docs.aws.amazon.com/lambda/latest/dg/nodejs-image.html#nodejs-image-clients
This is on x86, node20.
sin-ack commentedon Nov 7, 2024
The cause of this is this bit of code:
aws-lambda-nodejs-runtime-interface-client/src/rapid-client.cc
Line 24 in db6a30d
This uses
getenvin a global initializer to get an environment variable during the load of the RIC. If the environment variable is not set, the STL will throw an exception, and Node.js has no way of recovering from that (since it happens at module load time). The correct fix is to check for the environment variable inInitand to just throw a JavaScript-level exception explaining that the environment variable must be set. You should be able to bypass this by setting theAWS_LAMBDA_RUNTIME_APIenvironment variable for now.thescientist13 commentedon Jun 20, 2025
Ran into this issue as well and also had to pin to
2.1.0matt-kubica commentedon Oct 17, 2025
What
AWS_LAMBDA_RUNTIME_APIshould be set to?sin-ack commentedon Oct 17, 2025
It needs to be set to the address of the AWS Lambda API. To test your lambda locally you need something like https://www.npmjs.com/package/lambda-local which will emulate the API.