Skip to content

[Bug]: Floating node:24-alpine base pulls Node 24.19.0, which kills the daemon with a RemoveEnvironmentCleanupHook assertion #6462

Open

Description

@jiulongche

What happened?

deploy/Dockerfile pins its base image to a floating tag:

ARG NODE_IMAGE=docker.io/library/node:24-alpine
ARG RUNTIME_IMAGE=docker.io/library/node:24-alpine

Node 24.19.0 was released on 2026-08-03. Any image rebuilt after that date picks it up — and on 24.19.0 the daemon is killed by a native assertion mid-run:

#  node[7]: void node::RemoveEnvironmentCleanupHook(v8::Isolate*, CleanupHook, void*) at ../src/api/hooks.cc:142
#  Assertion failed: (env) != nullptr

----- Native stack trace -----

(nothing follows)

The process aborts, restart: always brings it back ~4s later, and every request proxied during that window fails. The user-visible symptom is an intermittent 500 Internal Server Error and a run that dies partway through.

I rebuilt our image on 08-04 without touching the Open Design version, and it went from zero crashes to 17 of 21 runs killed (81%). Nothing in the error points at Node, so this cost a full day to track down — hence writing it up.

Steps to reproduce

  1. Build the daemon image from deploy/Dockerfile on/after 2026-08-03 so the floating node:24-alpine resolves to 24.19.0 (verify with docker run --rm --entrypoint node <image> -v).
  2. Start a run that streams for more than a minute (any agent — reproduced with both claude and codex).
  3. The daemon aborts with the assertion above. It reproduced every 1.5–20 minutes of active run time for us.

Expected behavior

A rebuild of the same Open Design source should produce a working image. Build output should be determined by its inputs, not by the date it was built.

Likely root cause

Node 24.19.0 includes src: add cleanup hooks to node::ObjectWrap (nodejs/node#63642). better-sqlite3 (12.10.0) and node-pty (1.1.0) are NAN-style ObjectWrap addons, which is exactly the surface that PR touches. The assertion fires from RemoveEnvironmentCleanupHook — a cleanup hook being removed after the Environment is already gone.

Evidence that Node is the variable rather than Open Design:

  • dependency versions are byte-identical between the working and broken builds ([email protected], [email protected] in both)
  • the only delta between our last good base image and the broken one is Node 24.18.0 → 24.19.0
  • rebuilding the same Open Design source with --build-arg NODE_IMAGE=node:24.18.0-alpine fixes it: runs that previously died 15-out-of-18 times in one project now complete, RestartCount stays 0

Not memory — the container sat at 148MB against a 1024MB heap cap, OOMKilled=false, host had 4.4GB free and untouched swap.

Suggested fix

Pin the Node minor in deploy/Dockerfile (e.g. node:24.18.0-alpine) and bump it deliberately. Same reasoning as any lockfile: a rebuild shouldn't silently change the runtime underneath the app. Happy to send a PR if that's the direction you'd want.

Diagnostic note for anyone hitting this

--report-on-fatalerror / --report-uncaught-exception will not capture this one. Generating the report itself needs the Environment, and it's already nullptr — so the report never lands and the native stack prints empty (same root cause for both). We enabled both, crashed twice, and the report directory stayed empty. Don't lose time there like we did.

Open Design version

0.17.0

Platform

Linux (self-hosted Docker, amd64)

Activity

  1. open-design-bot commented on Aug 5, 2026

    @open-design-bot
    Contributor

    🎉 ✨ Welcome to Open Design, @jiulongche!

    Spark card for @jiulongche

    ✨ 🔥 Lit the spark.

    🌱 Every contribution adds energy to the project. Thanks for showing up and helping Open Design grow.

    💛 Thanks for helping Open Design grow. Keep building in the open. 🚀

    🔗 Share on X (English) · 分享到 X(中文)

  2. lefarcen commented on Aug 5, 2026

    @lefarcen
    Contributor

    Hi @jiulongche! 👋

    This is a strong report. The floating node:24-alpine tags in deploy/Dockerfile are real, and your write-up narrows the regression down in a way that's immediately actionable.

    From the repo side, deploy/Dockerfile currently builds and runs on docker.io/library/node:24-alpine, while the daemon/runtime path still relies on native modules like better-sqlite3 and node-pty. That makes your Node 24.18.0 -> 24.19.0 delta a credible working hypothesis rather than just a coincidence.

    We haven't confirmed the exact upstream addon teardown path yet, so I'm treating that part as a working hypothesis for now, but the build reproducibility problem itself is clear. A PR that pins both Docker base args to a known-good Node image and documents why would be welcome here.

    Thanks for including the repro rate, the RestartCount comparison, and the note about fatal-error reports staying empty - that saves a lot of dead-end debugging.

  3. added
    bugSomething isn't working
    help wantedExtra attention is needed
    on Aug 5, 2026
  4. lefarcen commented on Aug 5, 2026

    @lefarcen
    Contributor

    PR #6467 is now up with the narrow reproducibility fix: it pins both deploy/Dockerfile base-image args to node:24.18.0-alpine and documents why the floating node:24-alpine tag caused rebuilds from unchanged source to drift into the crashing runtime. Keeping this issue open until that PR lands, since the underlying user-facing regression here is the intermittent daemon crash loop on rebuilt self-hosted images.

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

    bugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions