aws / aws-lambda-base-images

Apache License 2.0
671 stars 110 forks source link

nodejs:12 showing errors in docker logs #1

Closed fire015 closed 3 years ago

fire015 commented 3 years ago

Running the nodejs:12 image as a container shows errors in the logs (this doesn't stop the lambda from working, just something to flag)....

time="2020-12-02T10:34:55.137" level=info msg="exec '/var/runtime/bootstrap' (cwd=/var/task, handler=)"
time="2020-12-02T10:35:24.224" level=info msg="extensionsDisabledByLayer(/opt/disable-extensions-jwigqn8j) -> stat /opt/disable-extensions-jwigqn8j: no such file or directory"
time="2020-12-02T10:35:24.224" level=warning msg="Cannot list external agents" error="open /opt/extensions: no such file or directory"

Dockerfile

FROM public.ecr.aws/lambda/nodejs:12
COPY app.js ${LAMBDA_TASK_ROOT}
CMD ["app.handler"]

app.js

exports.handler = async (event) => {
  const response = {
    statusCode: 200,
    body: JSON.stringify("Hello from Lambda!"),
  };

  return response;
};
carlzogh commented 3 years ago

Hey @fire015 - thanks for reaching out.

The warnings you're seeing here are printed out by the Runtime Interface Emulator, a component designed for locally running Lambda functions packaged as container images. This component (RIE) is included in Lambda base images for local emulation convenience and is developed and maintained in a separate GitHub repository (ref. https://github.com/aws/aws-lambda-runtime-interface-emulator)

The warning level log line you're referring to is here and is meant to let the user know there were no Lambda extensions detected in your function - it is not a fatal error and could simply be ignored.

I have relayed this issue to the developers of the RIE component - If you think this behavior is not appropriate or have a suggestion here, please feel free to reach out through https://github.com/aws/aws-lambda-runtime-interface-emulator.

Thanks again!

fire015 commented 3 years ago

@carlzogh sorry yes I should have mentioned I was using RIE to test. Glad its not an issue, just might cause confusion to new users.

carlzogh commented 3 years ago

@fire015 no problem at all, appreciate you reaching out 🥇

I'll leave this with the RIE development team - cheers!