You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: SSH device host says "Could not connect to this host over SSH" when SSH works but Node is missing from the non-interactive PATH #20373
I searched existing issues and did not find a duplicate.
I included enough detail to reproduce or investigate the problem.
Area
apps/server
Steps to reproduce
On a macOS machine, put Node on PATH only in ~/.zprofile (common: many installers write there; zsh is the default shell).
On another environment (here a Windows server), Settings → Devices → Device hosts → add the Mac over SSH.
Open the Device panel or call device_list.
Expected behavior
Either the host works, or the status says what is actually wrong, e.g. "Node isn't on this host's non-interactive SSH PATH (add it to ~/.zshenv)".
Actual behavior
The host shows failed with "Could not connect to this host over SSH." SSH itself works: ssh -o BatchMode=yes user@host from the same Windows machine (same key, Windows OpenSSH) succeeds.
The real error is only in server.trace.ndjson, under SshDeviceHost.probe:
SshCommandError: Node is missing from the non-interactive SSH PATH
zsh does not read ~/.zprofile for non-interactive SSH commands, so the probe sees PATH=/usr/bin:/bin:/usr/sbin:/sbin.
Cause in code: apps/server/src/device/DeviceService.ts maps every error.step === "probe" failure to the generic "Could not connect to this host over SSH." (both the readiness mapping around L255–265 and the agent-tools mapping around L310–323), so the underlying SshCommandError message is dropped.
Impact
Misleading: it sends users to debug SSH keys, firewalls and host keys when the connection is fine. Likely common for Mac device hosts.
Version or commit
0.1.1-nightly.20261016.3218 (Windows server); Mac host on 0.1.1-nightly.20261016.3203.
Environment
Server: Windows 11. Device host: macOS 27.0.1, Xcode 27.1, Apple silicon, zsh default shell, Node installed under ~/.local/node.
Logs or stack traces
SshCommandError: Node is missing from the non-interactive SSH PATH
DeviceHostError: Device host <id> failed while probe.
DeviceHostUnavailableError: Device host <id> is unavailable: Could not connect to this host over SSH.
Workaround
Export the Node PATH in ~/.zshenv on the Mac (read by every zsh, including non-interactive SSH). The host then reported ready, simulators listed, and the Device panel streamed immediately, with no restart needed.
Suggestion: surface the probe error's own message when the SSH connection itself succeeded, and optionally mention ~/.zshenv in the Add host dialog.
Confirmed on main: this is a bug in the error mapping, not in your SSH setup.
SshDeviceHost already checks for this case. Before it runs node, the remote command prints Node is missing from the non-interactive SSH PATH and exits. But DeviceService.ts turns every step === "probe" failure into "Could not connect to this host over SSH.", both in readiness (~L262) and in agent readiness (~L321). The SshCommandError text only shows up in the trace, so a working SSH connection gets reported as a failed one.
Workaround (as you found): export Node's PATH in ~/.zshenv on the Mac. zsh doesn't read ~/.zprofile for non-interactive SSH commands.
Related: #4761 had the same non-interactive PATH root cause for agent CLIs over remote SSH (closed). It isn't a duplicate, because this is the device-host probe and its error message.
Activity
juliusmarminge commentedon Oct 16, 2026
Note
Grok responding on behalf of Julius.
Confirmed on main: this is a bug in the error mapping, not in your SSH setup.
SshDeviceHostalready checks for this case. Before it runsnode, the remote command printsNode is missing from the non-interactive SSH PATHand exits. ButDeviceService.tsturns everystep === "probe"failure into"Could not connect to this host over SSH.", both in readiness (~L262) and in agent readiness (~L321). TheSshCommandErrortext only shows up in the trace, so a working SSH connection gets reported as a failed one.Workaround (as you found): export Node's PATH in
~/.zshenvon the Mac. zsh doesn't read~/.zprofilefor non-interactive SSH commands.Related: #4761 had the same non-interactive PATH root cause for agent CLIs over remote SSH (closed). It isn't a duplicate, because this is the device-host probe and its error message.
Thanks for the precise trace and line references.