Skip to content

fix #73837: stop after failed Node package installs#91528

Merged
vincentkoc merged 1 commit into
openclaw:mainfrom
mushuiyu886:feat/issue-73837
Jun 11, 2026
Merged

fix #73837: stop after failed Node package installs#91528
vincentkoc merged 1 commit into
openclaw:mainfrom
mushuiyu886:feat/issue-73837

Conversation

@mushuiyu886

@mushuiyu886 mushuiyu886 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Fixes #73837.

Summary

  • Stop Linux Node.js installer paths immediately when required package-manager steps fail.
  • Keep the existing noninteractive apt wrapper and final Node runtime validation, but prevent failed NodeSource setup/install commands from falling through to a misleading success path.
  • Add regression coverage for NodeSource setup failure and apt nodejs install failure when install_node is called from a conditional shell context.

Root Cause

  • Fix classification: Root-cause Linux installer failure handling bug fix.
  • Maintainer-ready confidence: High. The patch stays inside scripts/install.sh Node runtime installation and the adjacent installer test file.
  • Root cause: The root cause is Bash's conditional-function errexit suppression: because install_node can be invoked from an if install_node shell context, bare run_quiet_step failures inside that function no longer abort the function, which caused failed NodeSource setup or package install commands to continue into later installer logic instead of stopping at the failed step.
  • Why this is root-cause fix: Required Linux Node installation commands now go through run_required_step, which exits immediately if run_quiet_step reports failure. The existing post-install finish_linux_node_install validation remains in place, so success is only printed after a supported node binary is active on PATH.
  • Patch quality notes: Patch quality/default-return warning is intentional: run_required_step returns only after a successful wrapped command and exits on failure, so it cannot mask the failed package-manager command. No package manager selection, apt noninteractive flags, Node minimum version, npm install path, or macOS behavior changed.

Real behavior proof

  • Behavior or issue addressed: A failed NodeSource setup or apt nodejs install no longer falls through and reports a successful Node.js install before later crashing.
  • Real environment tested: Disposable Debian 12 Docker container from the local pgvector/pgvector:pg17 image, with the patched worktree mounted read-only and Docker run with --network none. The proof sources production scripts/install.sh, sets OS=linux, and invokes install_node from an if install_node; then conditional shell context. The container image has Debian's real /usr/lib/apt/apt-helper download-file but no curl/wget, so the proof exposes apt-helper through a temporary curl-compatible wrapper in /tmp/proof-bin; no repository code or installer function was changed.
  • Exact steps or command run after this patch:
cd /media/vdc/code/ai/aispace/openclaw-worktrees/issue-73837
sudo docker run --rm --network none --entrypoint bash \
  -v "$PWD:/repo:ro" -w /repo pgvector/pgvector:pg17 -lc '
    set -Eeuo pipefail
    mkdir -p /tmp/proof-bin
    # /tmp/proof-bin/curl adapts Debian apt-helper download-file to the curl -o URL shape used by install.sh.
    export PATH="/tmp/proof-bin:$PATH"
    export OPENCLAW_INSTALL_SH_NO_RUN=1 TERM=dumb CI=1
    source scripts/install.sh
    OS=linux
    if install_node; then echo "UNEXPECTED: install_node returned success"; fi
  '
  • Evidence after fix:
inside-container: invoking install_node
· Installing Node.js via NodeSource
· Downloading NodeSource setup script
✗ Downloading NodeSource setup script failed — re-run with --verbose for details
Ign:1 https://deb.nodesource.com/setup_24.x
Err:1 https://deb.nodesource.com/setup_24.x
  Temporary failure resolving 'deb.nodesource.com'
E: Failed to fetch https://deb.nodesource.com/setup_24.x  Temporary failure resolving 'deb.nodesource.com'
E: Download Failed
docker_run_exit_status=1
assert:exit_status_1=true
assert:nodesource_step_failed=true
assert:real_dns_failure=true
assert:no_install_node_success=true
assert:no_linux_success_message=true
ASSERT_PASS: install_node exited at the failed required NodeSource step and did not print success
  • Observed result after fix: The production installer reached the required NodeSource download step in a real Linux container, hit the real container DNS/network failure for deb.nodesource.com, exited with status 1 through run_required_step, and did not continue to apt_get_install nodejs, finish_linux_node_install, or any Node.js success message.
  • Secondary deterministic regression proof: I also ran /media/vdc/code/ai/aispace/openclaw-issue-73837-evidence/local-installer-node-failure-proof.mjs, which sources production scripts/install.sh and locks both previously reported conditional-errexit failure shapes: NodeSource setup failure and apt nodejs install failure both exit with status 1 and never return install_node success.
  • What was not tested: No successful Node installation was performed, and the host package manager was not modified. The real-environment proof intentionally uses a network-disabled disposable container to force the NodeSource failure path; the successful package-manager path remains covered by the existing post-install Node runtime validation rather than by this failure proof.

Review findings addressed

  • RF-001 — fixed: Added redacted terminal output from a disposable Debian 12 Docker container where patched production install_node hits a real NodeSource DNS/network failure for https://deb.nodesource.com/setup_24.x, exits with status 1 at Downloading NodeSource setup script, and does not print a Node.js success message.
  • RF-002 — stale / CI infrastructure: The previously in-progress check runs reached terminal state. Current non-success checks on head 3952d599015d7356ffd5a4251f3255c079141e5f are self-hosted runner communication failures, with GitHub annotations saying the runner lost communication with the server; there is no current-head test assertion failure attributable to this PR.
  • RF-003 — fixed: Replaced the prior proof-only fixture story with the real Linux container proof above. The local fixture proof is now only secondary deterministic regression evidence, not the primary real behavior proof.
  • RF-004 — maintainer decision disclosed: The 21 required Linux Node package-manager setup/install call sites intentionally fail closed on nonzero exit. This is the requested behavior boundary: a failed required Node runtime install should not rely on later validation or fallback before stopping.
  • RF-005 — fixed: Added actual Linux/container failure output from a disposable Debian container, including the real Temporary failure resolving 'deb.nodesource.com' NodeSource failure and the ASSERT_PASS checks for exit status and absence of success output.
  • RF-006 — stale / CI infrastructure: Final CI state is no longer pending; the remaining current-head failures are runner infrastructure failures rather than PR-code failures, so no code change is made for CI.
  • RF-007 — fixed / maintainer review remains: No automated repair was needed. The contributor-side proof gap is addressed with container evidence; maintainer review of the intentional fail-closed installer semantics still remains appropriate.
  • Proof judgment note: The local OpenClaw chat/RPC/gateway proof path is not applicable to this reviewer request because the changed behavior is the installer’s Linux package-manager failure path. The applicable local proof path is the Docker/Linux installer run above.

Tests

  • Target test file: test/scripts/install-sh.test.ts.
  • Scenario locked in: NodeSource repository setup failure and apt nodejs install failure stop install_node immediately and do not print Node.js installation success.
  • Why this is the smallest reliable guardrail: The tests source the real installer script and call install_node under the same conditional-shell shape that can suppress errexit, while keeping package-manager operations local and deterministic.
  • Exact commands run:
PNPM_CONFIG_VERIFY_DEPS_BEFORE_RUN=false corepack [email protected] --dir /media/vdc/code/ai/aispace/openclaw-worktrees/issue-73837 exec vitest run test/scripts/install-sh.test.ts --reporter=dot
PNPM_CONFIG_VERIFY_DEPS_BEFORE_RUN=false corepack [email protected] --dir /media/vdc/code/ai/aispace/openclaw-worktrees/issue-73837 exec oxfmt --check --threads=1 scripts/install.sh test/scripts/install-sh.test.ts
PNPM_CONFIG_VERIFY_DEPS_BEFORE_RUN=false corepack [email protected] --dir /media/vdc/code/ai/aispace/openclaw-worktrees/issue-73837 exec oxlint --deny-warnings test/scripts/install-sh.test.ts
OPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1 OPENCLAW_CHANGED_LANES_RAW_SYNC=1 CI=1 PNPM_CONFIG_VERIFY_DEPS_BEFORE_RUN=false corepack [email protected] --dir /media/vdc/code/ai/aispace/openclaw-worktrees/issue-73837 check:changed
git -C /media/vdc/code/ai/aispace/openclaw-worktrees/issue-73837 diff --check
  • Observed test result after fix: Installer Vitest passed 47/47 tests; oxfmt --check passed; oxlint --deny-warnings passed; check:changed passed the tooling lane; git diff --check passed with no output.

Risk / Scope

  • Why it matters / User impact: Linux users no longer see a successful Node.js install message after a failed NodeSource setup or apt install step.
  • What did NOT change: Only required Linux Node package-manager failure handling changed; the Node version floor, NodeSource URL, apt noninteractive wrapper, package-manager detection order, npm installation behavior, Homebrew path, and installer UI copy are unchanged, with no unrelated installer scope expansion.
  • Architecture / source-of-truth check: The source-of-truth boundary is the installer step wrapper plus the existing Node runtime validation path: run_required_step owns required command failure handling, and finish_linux_node_install remains the validation gate before any installed-success message.
  • Risk labels considered: merge-risk: 🚨 availability, merge-risk: 🚨 compatibility.
  • Risk explanation: The installer now exits earlier when package-manager setup/install commands fail; this changes only failed installation flows that previously continued misleadingly.
  • Why acceptable: Continuing after a failed required Node runtime install cannot produce a valid OpenClaw install, and the final supported-node validation remains unchanged for successful installs.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: S proof: supplied External PR includes structured after-fix real behavior proof. labels Jun 9, 2026
@clawsweeper

clawsweeper Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed June 11, 2026, 9:54 AM ET / 13:54 UTC.

Summary
Review failed before ClawSweeper could summarize the requested change.

PR surface: Tests +80, Other +9. Total +89 across 2 files.

Reproducibility: unclear. The review failed before ClawSweeper could establish a reproduction path.

Review metrics: none identified.

Stored data model
Persistent data-model change detected: persistent cache schema: scripts/install.sh, persistent cache schema: test/scripts/install-sh.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🌊 off-meta tidepool
Proof: 🌊 off-meta tidepool
Patch quality: 🌊 off-meta tidepool
Result: rating does not apply to this item.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Risk before merge

  • [P1] No close action taken because the review did not complete.

Maintainer options:

  1. Decide the mitigation before merge
    Retry the Codex review after fixing the execution failure.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P1] Review did not complete, so no work-lane recommendation was made.
Review details

Best possible solution:

Retry the Codex review after fixing the execution failure.

Do we have a high-confidence way to reproduce the issue?

Unclear. The review failed before ClawSweeper could establish a reproduction path.

Is this the best way to solve the issue?

Unclear. Retry the review first so ClawSweeper can evaluate the actual issue and fix direction.

AGENTS.md: unclear because the file could not be read completely.

Codex review notes: model internal, reasoning high; reviewed against 2bec2caf0c69.

Label changes

Label changes:

  • add rating: 🌊 off-meta tidepool: Overall readiness is 🌊 off-meta tidepool; proof is 🌊 off-meta tidepool and patch quality is 🌊 off-meta tidepool.
  • remove P2: Current review triage priority is none.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🌊 off-meta tidepool, so this older rating label is no longer current.
  • remove merge-risk: 🚨 compatibility: Current PR review selected no merge-risk labels.
  • remove status: 👀 ready for maintainer look: Current PR status no longer selects a status label.

Label justifications:

  • rating: 🌊 off-meta tidepool: Overall readiness is 🌊 off-meta tidepool; proof is 🌊 off-meta tidepool and patch quality is 🌊 off-meta tidepool.
Evidence reviewed

PR surface:

Tests +80, Other +9. Total +89 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 84 4 +80
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 30 21 +9
Total 2 114 25 +89

What I checked:

  • failure reason: retryable codex transport failure.
  • codex failure detail: Codex review failed for this PR with exit 1.
  • codex stderr: merging.

Likely related people:

  • unknown: Codex failed before it could trace repository history. (role: review did not complete; confidence: low)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 9, 2026
@vincentkoc vincentkoc self-assigned this Jun 11, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 11, 2026
@clawsweeper clawsweeper Bot added rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jun 11, 2026
@vincentkoc

Copy link
Copy Markdown
Member

Maintainer pass complete; this is land-ready.

Proof run:

  • bash -n scripts/install.sh
  • node scripts/run-vitest.mjs test/scripts/install-sh.test.ts
  • node scripts/run-oxlint.mjs test/scripts/install-sh.test.ts
  • git diff --check origin/main...HEAD
  • .agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main — clean, patch correct 0.86
  • Azure Crabbox check:changed on cbx_6286dc1e287b (swift-crayfish, Standard_D4ads_v6) — passed, exit 0, lease stopped

I also rebased the branch onto current main before the final proof. Latest head is f78d8431859ac8171f5d8800f1fa5a43507102a2.

@vincentkoc
vincentkoc merged commit 777f740 into openclaw:main Jun 11, 2026
156 of 160 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. scripts Repository scripts size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Node.js auto-installer fails silently with ioctl errors then falsely reports success before crashing

2 participants