Repository navigation
Description
Summary
When installing a bb host daemon on Linux with Node.js managed by fnm, the installer saves a temporary fnm_multishells executable path in the systemd service's ExecStart.
The installation initially works, but after restarting WSL the temporary path disappears. The service fails repeatedly with status=203/EXEC, leaving the machine Offline in bb instead of reconnecting automatically.
Versions and environment
- bb: 0.48.1
- Installation method: Machine enrollment via the server-provided
install.sh - Host OS: Windows with WSL2
- Linux: Ubuntu 26.04.1 LTS (Resolute Raccoon)
- Node.js: v24.22.1
- Node version manager: fnm 1.39.0
- Default Node.js version:
fnm default 24 - Init system: systemd (PID 1)
- Service: Enabled systemd user unit (
bb-host-daemon-*.service) - User lingering: Enabled via
loginctl enable-linger - Host daemon port: 38888
- Setup: Remote WSL machine connected to a bb server
- Observed: October 31, 2026
- Latest-release verification: Reproduced with bb 0.48.1; not independently verified against the latest release or
main
No provider-specific steps are involved: the failure occurs before the host daemon starts.
Steps to reproduce
-
Use a Linux system with systemd and Node.js installed through
fnm(in my case, Ubuntu on WSL2). -
Select the default Node.js version:
fnm install 24 fnm default 24
-
Verify that Node.js resolves through a temporary fnm path:
command -v node # /run/user/1000/fnm_multishells/<session>/bin/node
-
Install and enroll a bb host machine using the server-provided
install.shcommand. -
Inspect the generated systemd service:
systemctl --user cat bb-host-daemon-<machine>.service
Observe that
ExecStartcontains the temporary/run/user/1000/fnm_multishells/.../bin/nodepath. -
Restart WSL using
wsl --shutdownfrom Windows PowerShell, then start the distribution again. Alternatively, reboot Windows and start WSL. -
Inspect the host daemon service:
systemctl --user status bb-host-daemon-<machine>.service
-
Observe that the service fails with
status=203/EXECbecause the previously saved Node.js path no longer exists.
The machine remains Offline in bb.
Expected vs actual
**Expected behavior**
The installer should generate a persistent systemd service using a Node.js executable path that remains valid across restarts.
After WSL restarts, the host daemon should start and reconnect automatically when the bb server is reachable.
**Actual behavior**
The generated service contains a temporary fnm executable path:
ExecStart="/run/user/1000/fnm_multishells/476_1793101823158/bin/node" "/home/<user>/.bb-machines/<server>/npm/bin/bb-app" host-daemon --auto-update ...
After restarting WSL, systemd repeatedly fails to execute Node.js.
Actual journal output:
Unable to locate executable '/run/user/1000/fnm_multishells/476_1793101823158/bin/node': No such file or directory
Failed at step EXEC spawning /run/user/1000/fnm_multishells/476_1793101823158/bin/node: No such file or directory
Main process exited, code=exited, status=203/EXEC
Service status:
Active: activating (auto-restart) (Result: exit-code)
Result=exit-code
NRestarts=71
ExecMainStatus=203
Node.js is still installed and works correctly in an interactive shell:
$ node --version
v24.22.1
$ which node
/run/user/1000/fnm_multishells/500_1793464947596/bin/node
The current shell has a new fnm session path, but systemd continues using the old path saved during installation.
Evidence
Suspected root cause confirmed by the generated systemd unit and journal output
The installer captures the current Node.js executable path using command -v node:
[install-machine.sh, lines 393–410](
bb/apps/server/src/assets/install-machine.sh
Lines 393 to 410 in 916d684
| if ! command -v node >/dev/null 2>&1; then | |
| fail_step "bb-app requires Node.js 22.19 or newer (22.19, 24, and 26 are tested), but node is not on PATH." | |
| exit 1 | |
| fi | |
| node_version=$(node -p 'process.versions.node') | |
| # Open-ended floor rather than an allow-list of tested majors: Pi only requires | |
| # >=22.19, and a closed list turns every future release line into a hard | |
| # install failure on the day it ships. | |
| node_supported=$(node -e ' | |
| const [major, minor] = process.versions.node.split(".").map(Number); | |
| const supported = major > 22 || (major === 22 && minor >= 19); | |
| process.exit(supported ? 0 : 1); | |
| ' && echo yes || echo no) | |
| if [ "$node_supported" != yes ]; then | |
| fail_step "Node.js $node_version is too old; bb-app requires Node.js 22.19 or newer (22.19, 24, and 26 are tested)." | |
| exit 1 | |
| fi | |
| node_bin=$(command -v node) |
node_bin=$(command -v node)The captured path is then written directly into the persistent systemd service:
[install-machine.sh, lines 1155–1165](
bb/apps/server/src/assets/install-machine.sh
Lines 1155 to 1165 in 916d684
| cat >"$service_file" <<EOF | |
| [Unit] | |
| Description=bb host daemon for $server_host | |
| After=network-online.target | |
| Wants=network-online.target | |
| [Service] | |
| ExecStart="$escaped_node_bin" "$escaped_bb_app" host-daemon --auto-update --host-daemon-port "$host_daemon_port" --server-url "$escaped_server" | |
| Environment="BB_APP_NPM_PREFIX=$escaped_bb_app_npm_prefix" | |
| Environment="BB_DATA_DIR=$escaped_data_dir" | |
| Restart=always |
ExecStart="$escaped_node_bin" "$escaped_bb_app" host-daemon ...With fnm, command -v node can return a session-specific path under /run/user/1000/fnm_multishells/. This path is not guaranteed to exist after WSL restarts.
Related implementation
Interestingly, bb already accounts for changing fnm multishell paths when comparing shell environments:
- [runtime-manager.ts]()
bb/apps/host-daemon/src/runtime-manager.ts
Lines 234 to 245 in 916d684
const FNM_MULTISHELL_PATH_ENTRY = /([\\/]fnm_multishells[\\/])[^\\/]+/; function comparableShellEnvValue(key: string, value: string): string { if (key !== "PATH") return value; return value .split(path.delimiter) .map((entry) => entry.replace(FNM_MULTISHELL_PATH_ENTRY, "$1*")) .join(path.delimiter); } function shellEnvEquals( left: NonNullable<AgentRuntimeOptions["shellEnv"]>, - [runtime-manager.test.ts]()
bb/apps/host-daemon/src/runtime-manager.test.ts
Lines 1231 to 1252 in 916d684
it("keeps runtimes when only fnm multishell PATH entries change", async () => { const dataDir = await makeTempDir("bb-provider-maintenance-fnm-"); const runtime = createFakeRuntime(); const createRuntime = vi.fn(() => runtime); const manager = new RuntimeManager({ createRuntime, shellEnv: { PATH: "/Users/me/Library/Caches/fnm_multishells/123_1/bin:/usr/bin", }, }); await manager.ensureProviderMaintenanceRuntime({ dataDir }); await manager.replaceBaseShellEnv({ PATH: "/Users/me/Library/Caches/fnm_multishells/456_2/bin:/usr/bin", }); expect(runtime.shutdown).not.toHaveBeenCalled(); await expect( manager.ensureProviderMaintenanceRuntime({ dataDir }), ).resolves.toBe(runtime); expect(createRuntime).toHaveBeenCalledOnce();
However, this handling does not apply to systemd service generation.
Suggested fix
Resolve the temporary executable path to a persistent location before writing the service, for example:
node_bin=$(node -p 'require("node:fs").realpathSync(process.execPath)')Alternatively, support a stable fnm alias when available:
~/.local/share/fnm/aliases/default/bin/node
The first approach would survive a reboot but would require updating the service if that specific Node.js installation is removed.
A regression test should verify that installing with an fnm_multishells PATH entry does not generate a service depending on the temporary directory.
What you ruled out
- Not a systemd initialization issue: systemd is running as PID 1.
- Not a disabled service: The bb host daemon systemd user unit is installed and enabled.
- Not a missing Node.js installation: Node.js v24.22.1 runs successfully from the interactive shell.
- Not a network or enrollment failure: systemd fails at the EXEC step before Node.js or the host daemon starts.
- Not the same as Provider usage fails with "Provider is not running" when the login-shell PATH differs per shell (fnm) #6533 or claude-code: new thread's first turn silently killed by idle-runtime eviction on cosmetic shell-env drift (fnm multishells) — stuck on "Working…" forever #1156: Those issues concern fnm-related shell environment changes and provider runtime lifecycle, not the persistent systemd service executable path.
- Stable fnm alias available:
~/.local/share/fnm/aliases/default/bin/node --versionsuccessfully returnsv24.22.1. - Workaround identified: A systemd
ExecStartoverride using the persistent fnm alias should avoid the missing-path failure. Post-reboot verification of the workaround has not yet been completed.
Investigation prepared with AI assistance from actual systemd logs and bb source code.
Suggested priority and effort (optional)
Medium priority, likely low effort — affects Linux users with Node.js managed by fnm, preventing automatic host reconnection after reboot. A manual systemd override is available as a workaround. No known data loss.
Checks
- I reproduced this on the latest release or on
main, or I say above that I could not. - I searched open and closed issues for the same problem.
- If an agent wrote this, the body ends with
> AGENT GENERATEDand links the thread or report.
Activity
bb-slop-cop commentedon Oct 31, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilothost,confirmed-repro. All were missing and are now applied.ExecStart; removing that session symlink leaves the persisted executable path unusable (ENOENT).Persist fnm's stable Node link instead of the resolved binary
fix(host): keep fnm's stable Node link in machine services (get-bb#6774)