Skip to content

Fix machine installation reliability and feedback - #1419

Merged
ymichael merged 3 commits into
mainfrom
bb/fix-machine-installation-issue-thr_q9uchtuvwh
Aug 12, 2026
Merged

ymichael merged 3 commits into
mainfrom
bb/fix-machine-installation-issue-thr_q9uchtuvwh

Conversation

@ymichael

@ymichael ymichael commented Aug 12, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • install server-matched bb-app packages under each enrollment's data directory instead of npm's system-wide global prefix
  • persist the private npm prefix into launchd/systemd so daemon protocol self-updates replace the same isolated package
  • show progress for the bootstrap and server-matched package downloads, with bounded network timeouts and retries
  • surface enrollment logs and periodic connection heartbeats instead of leaving long silent waits
  • match the bb terminal styling for active, completed, warning, failure, and ready states while keeping redirected and NO_COLOR output readable
  • preserve legacy global-update behavior for manual and older services without a configured prefix

This fixes machine enrollment failing with EACCES when npm's default global prefix is /usr/local, without requiring sudo, a PATH edit, or a user-wide npm configuration. It also makes the previously quiet package download and daemon connection waits visible and prevents enrollments for different bb servers from sharing one bb-app binary.

Testing

  • pnpm exec turbo run test --filter=@bb/server --force -- test/app/install-machine-script.test.ts — 16 tests
  • pnpm exec turbo run test --filter=@bb/host-daemon --force -- src/protocol-self-update.test.ts — 12 tests
  • pnpm exec turbo run test --filter=@bb/app --force -- src/components/dialogs/AddMachineDialog.test.tsx — 2 tests
  • pnpm exec turbo run test --filter=@bb/templates --force — 23 tests
  • pnpm exec turbo run typecheck --filter=@bb/server --filter=@bb/host-daemon --filter=@bb/templates
  • pnpm exec turbo run typecheck --filter=@bb/server --filter=@bb/app
  • sh -n apps/server/src/assets/install-machine.sh
  • Prettier and git diff --check

Hardware E2E

Validated the real generated installer from this branch against an Intel Mac over Tailscale. The remote machine's npm prefix remained /usr/local, enrollment completed without sudo or npm configuration changes, launchd used the private executable and prefix, the daemon connected successfully, and a provider-discovery RPC completed through the dev server.

AGENT GENERATED: by GPT-5

@ymichael

Copy link
Copy Markdown
Collaborator Author

E2E hardware validation passed on an Intel Mac (mbp-intel):

  • started this PR branch's dev server and exposed it over a separate Tailscale HTTPS port
  • confirmed the remote machine uses Node 24.16.0, npm 11.13.0, and an unwritable-for-users default global prefix of /usr/local
  • ran the real generated install.sh against the dev server's 32 MB bb-app.tgz artifact
  • npm completed successfully without sudo or npm configuration changes
  • verified the installed executable is under the enrollment data directory at npm/bin/bb-app
  • verified launchd persists both the private BB_APP_NPM_PREFIX and the private bb-app executable path with --auto-update
  • verified the daemon connected as mbp-intel with protocol version 108
  • successfully queried provider availability through the dev server using bb provider list --machine mbp-intel
  • rechecked that npm config get prefix still returns /usr/local

The dev instance and its dedicated Tailscale route remain running for inspection.

@ymichael ymichael changed the title Fix machine install npm permissions Fix machine installation reliability and feedback Aug 12, 2026
@ymichael
ymichael merged commit 65bab83 into main Aug 12, 2026
10 checks passed
@ymichael
ymichael deleted the bb/fix-machine-installation-issue-thr_q9uchtuvwh branch August 12, 2026 22:59
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