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

Apache License 2.0
180 stars 56 forks source link

getRemainingTimeInMillis is returning NaN. #33

Closed ramaguruprakash closed 10 months ago

ramaguruprakash commented 2 years ago

We created a custom docker image for lambda with the following dockerFile.

DockerFile ARG FUNCTION_DIR="/code" FROM node:12-buster as build-image

ARG FUNCTION_DIR

RUN apt-get update && \ apt-get install -y \ g++ \ make \ cmake \ unzip \ libcurl4-openssl-dev

RUN npm -g config set user root RUN npm install -g aws-lambda-ric RUN npm -g config set user nobody

RUN mkdir -p ${FUNCTION_DIR} COPY . ${FUNCTION_DIR} RUN chmod -R 775 ${FUNCTION_DIR} WORKDIR ${FUNCTION_DIR} ENTRYPOINT exec /usr/local/bin/npx aws-lambda-ric index.handler

When we print the getRemainingTimeInMillis, we get the value as NaN.

We tried to print the function itself and got the following response.

function () { return deadline - Date.now(); }

As we missing anything here ?

vamshikolanu commented 2 years ago

Hello, is there any update regarding this?

janakg commented 1 year ago

any updates?

XMegamanX commented 1 year ago

Hello there ! Same issue ! Have you found a workaround ? Thanks

XMegamanX commented 1 year ago

I have found the problem, just add the env variable AWS_LAMBDA_NODEJS_USE_ALTERNATIVE_CLIENT_1 = true to the Lambda Configuration. It makes the trick :)

andclt commented 10 months ago

Hi,

I am not able to get this issue with the latest aws-lambda-ric version (v3.0.0).

console.log(context.getRemainingTimeInMillis());

INFO    2693

Feel free to reopen it if you still face this issue with the latest version.