Skip to content

[BUG]: dd-trace crashes on AWS Lambda with Node.js 24.13.0: "Could not extract context" Init Error #715

@divyank247

Description

@divyank247

Tracer Version(s)

5.80.0, 5.82.0, 5.83.0

Node.js Version(s)

24.13.0

Bug Report

Environment

  • dd-trace version: 5.80.0 or higher (via Datadog Lambda Layer v132)
  • Node.js version: 24.13.0 (AWS Lambda nodejs24.x runtime)
  • AWS Lambda with Datadog Serverless macro

Description

Lambda functions crash during cold start with Init Error: Could not extract context when using Node.js 24.13.0. The same code works on Node.js 22.x.

Reproduction Code

Reproduction

  1. Deploy any Lambda with nodejs24.x runtime
  2. Use Datadog Lambda Layer (nodeLayerVersion 131, 132, or 133)
  3. Set DD_TRACE_ENABLED: "true"
  4. Invoke the Lambda → Crashes on init

What works

  • DD_TRACE_ENABLED: "false" → No crash (but no tracing)
  • nodejs22.x runtime with same code → Works

What doesn't work

  • Disabling optional features (profiling, AppSec, IAST, runtime metrics)
  • Different layer versions (131, 132, 133)
  • Disabling specific instrumentations

Suspected cause

Incompatibility between dd-trace's async_hooks/AsyncLocalStorage usage and Node.js 24.13.0.

Node 24.13.0 includes breaking changes (CVE-2025-59466 fix for async exception handling) that may affect async_hooks behavior.

Expected behavior

dd-trace should initialize successfully on Node.js 24.x Lambda runtime.

Error Logs

errorMessage: "Could not extract context"

Tracer Config

No response

Operating System

No response

Bundling

Unsure

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions