Skip to content

fix: provision remote hosts without Node or nvm - #24

Merged
Golden-Pigeon merged 1 commit into
mainfrom
fix/20-bootstrap-node-prelude
Nov 9, 2026
Merged

Golden-Pigeon merged 1 commit into
mainfrom
fix/20-bootstrap-node-prelude

Conversation

@Golden-Pigeon

Copy link
Copy Markdown
Owner

Fixes #20.

Original problem

On a fresh remote host without Node, the generated bootstrap exited with status 2 before the automatic Node install could run. nodePathPrelude() ran an unguarded ls over the nvm version glob under set -euo pipefail; with no nvm installation, the glob did not match, ls exited non-zero, and set -e terminated the script.

Change

  • Treat the nvm probe as best-effort (|| true) so a missing nvm directory cannot abort the bootstrap.
  • Add a POSIX-shell regression test that executes the generated prelude with a temporary HOME containing no nvm and a PATH containing no node, and asserts the script continues.

Fixed during this change

  • None.

Resolved

  • Remote provisioning on hosts without Node/nvm no longer exits before installing the configured Node version.
  • Added regression coverage for the no-nvm prelude path.

Unresolved

Testing

  • pnpm --filter @dsh-remote/installer test (20/20)
  • pnpm --filter @dsh-remote/installer typecheck
  • pnpm --filter @dsh-remote/installer build
  • Real provisioning E2E against an isolated Ubuntu 24.04 container with no Node/nvm: the fixed installer uploaded the agent and ran the full bootstrap; Node 22.19.0 was auto-installed, DSH 0.2.2-rc.1 and the remote agent were installed, dsh web started, and the agent state reached ready.

The node path prelude ran an unguarded nvm glob under set -euo pipefail, so a missing nvm directory aborted the whole bootstrap before the configured Node auto-install step. Guard the glob with compgen and cover the no-nvm path by executing the prelude in a POSIX shell test.
@Golden-Pigeon
Golden-Pigeon merged commit e7962c6 into main Nov 9, 2026
2 checks passed
@Golden-Pigeon
Golden-Pigeon deleted the fix/20-bootstrap-node-prelude branch November 9, 2026 11:24
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.

Remote provisioning fails on fresh hosts without Node (bootstrap exits 2 in nodePathPrelude)

1 participant