aws / aws-lambda-nodejs-runtime-interface-client

Apache License 2.0
177 stars 57 forks source link

Crashes with error what(): basic_string: construction from null is not valid #101

Closed vaunus closed 4 months ago

vaunus commented 4 months ago

This library is not working for me. I've tried it on both Amazon Linux and Alpine Linux.

On Alpine I get get the following error:

/var/task # aws-lambda-ric handler.js 
Executing 'handler.js' in function directory '/var/task'
terminate called after throwing an instance of 'std::logic_error'
  what():  basic_string: construction from null is not valid
Aborted

The Amazon Linux error is similar what(): basic_string::_M_construct null not valid

The handler is the same as your readme:

"use strict";

exports.handler = async (event, context) => {
    return 'Hello World!';
}

Am I missing something here?

vaunus commented 4 months ago

I have figured this out. I tested an image that uses the older /var/runtime/bootstrap script and it gave the same error. This got me to thinking that this perhaps can't be tested directly in the Docker container via cli. Once I tested on Lambda it worked as expected. I expect wrapping this command with aws-lambda-rie will work when using the container locally.

Hope this helps someone but closing the issue for now.