Skip to content

SnapStart + Node.js 24 base image: all restored invocations fail with Runtime.PlatformError (Missing AWS_LAMBDA_LOG_GROUP_NAME / AWS_LAMBDA_LOG_STREAM_NAME) #205

Open

Description

@todakkk36

Summary

With a Node.js 24 Lambda base image (public.ecr.aws/lambda/nodejs:24) and SnapStart enabled
(LABEL com.amazonaws.lambda.feature.snapstart="Allow"), every invocation after a SnapStart
restore fails with Runtime.PlatformError. The same setup works on the Node.js 22 base image.

Environment

  • Region: ap-northeast-1, architecture: arm64
  • Base image: public.ecr.aws/lambda/nodejs:24 (runtime v24.21.0 as of 2026-10-17)
  • Deployment: container image, SnapStart via Dockerfile LABEL (no runtime hooks)
  • Date observed: 2026-10-17

Steps to reproduce

  1. Build a container image from the Node.js 24 base image with
    LABEL com.amazonaws.lambda.feature.snapstart="Allow".
  2. Publish a new version (SnapStart creates a snapshot).
  3. Invoke the published version.

Observed behavior

All 60 invocations against newly-restored execution environments failed with:

Runtime.PlatformError: Missing required environment variables: AWS_LAMBDA_LOG_GROUP_NAME, AWS_LAMBDA_LOG_STREAM_NAME
at ContextBuilder.validateEnvironment (file:///var/runtime/index.mjs:303:13)

Expected behavior

The invocation should succeed, as it does on the Node.js 22 base image under the same
SnapStart setup.

Analysis

Per the AWS documentation (https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html),
AWS_LAMBDA_LOG_GROUP_NAME and AWS_LAMBDA_LOG_STREAM_NAME are not set for functions with
SnapStart enabled. ContextBuilder.validateEnvironment() in this repo
(https://github.com/aws/aws-lambda-nodejs-runtime-interface-client/blob/main/src/context/context-builder.ts)
treats both as required on every invocation and does not special-case SnapStart, which appears
to be the cause.

Workaround (not officially supported)

Setting dummy values for both variables during the SnapStart beforeSnapshot hook (or at
module load, gated on AWS_LAMBDA_INITIALIZATION_TYPE === "snap-start") avoids the error, but
context.logStreamName etc. then hold dummy values.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions