Skip to content

fix: mount dd-trace-js local volume as rw for nodejs-load-from-local#6716

Draft
dd-oleksii wants to merge 2 commits intomainfrom
oleksii/jj-muxtvpxyumkr
Draft

fix: mount dd-trace-js local volume as rw for nodejs-load-from-local#6716
dd-oleksii wants to merge 2 commits intomainfrom
oleksii/jj-muxtvpxyumkr

Conversation

@dd-oleksii
Copy link
Copy Markdown
Member

When using nodejs-load-from-local, the dd-trace-js repo was mounted into the container as read-only (ro). At startup, app.sh runs npm link inside /volumes/dd-trace-js to wire the local tracer into the weblog. npm link executes the package's prepare lifecycle script (in dd-trace-js: cd vendor && npm ci --include=dev), which needs to write to the source directory.

npm ci always performs a clean reinstall — it removes the existing node_modules before reinstalling — so it requires write access even if vendor/node_modules is already present. The ro mount made this impossible, causing an EROFS: read-only file system error and the weblog container to exit immediately.

Notably, npm link --ignore-scripts does not fix this: npm v7+ runs prepare scripts unconditionally during local linking, regardless of the --ignore-scripts flag.

The fix is to mount the volume as rw. This is appropriate because npm link is inherently a write operation on the source directory — the same writes (vendor/node_modules) would occur if the user ran npm install locally. Unlike the Python load-from-local approach (which only reads sources via PYTHONPATH), Node.js local linking requires the package to be built in-place.

Motivation

Changes

Workflow

  1. ⚠️ Create your PR as draft ⚠️
  2. Work on you PR until the CI passes
  3. Mark it as ready for review
    • Test logic is modified? -> Get a review from RFC owner.
    • Framework is modified, or non obvious usage of it -> get a review from R&P team

🚀 Once your PR is reviewed and the CI green, you can merge it!

🛟 #apm-shared-testing 🛟

Reviewer checklist

  • Anything but tests/ or manifests/ is modified ? I have the approval from R&P team
  • A docker base image is modified?
    • the relevant build-XXX-image label is present
  • A scenario is added, removed or renamed?

When using `nodejs-load-from-local`, the dd-trace-js repo was mounted
into the container as read-only (`ro`). At startup, `app.sh` runs
`npm link` inside `/volumes/dd-trace-js` to wire the local tracer into
the weblog. `npm link` executes the package's `prepare` lifecycle script
(in dd-trace-js: `cd vendor && npm ci --include=dev`), which needs to
write to the source directory.

`npm ci` always performs a clean reinstall — it removes the existing
`node_modules` before reinstalling — so it requires write access even
if `vendor/node_modules` is already present. The `ro` mount made this
impossible, causing an `EROFS: read-only file system` error and the
weblog container to exit immediately.

Notably, `npm link --ignore-scripts` does not fix this: npm v7+ runs
`prepare` scripts unconditionally during local linking, regardless of
the `--ignore-scripts` flag.

The fix is to mount the volume as `rw`. This is appropriate because
`npm link` is inherently a write operation on the source directory —
the same writes (`vendor/node_modules`) would occur if the user ran
`npm install` locally. Unlike the Python `load-from-local` approach
(which only reads sources via `PYTHONPATH`), Node.js local linking
requires the package to be built in-place.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 9, 2026

CODEOWNERS have been resolved as:

utils/_context/containers.py                                            @DataDog/system-tests-core

@datadog-datadog-prod-us1-2
Copy link
Copy Markdown

datadog-datadog-prod-us1-2 bot commented Apr 9, 2026

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: d50be75 | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant