fix(dev): add openssh to lab service PATH for AFK git-over-ssh #69

Merged
dominik.polakovics merged 1 commit from fix/lab-afk-ssh-on-path into main 2026-06-01 18:52:37 +02:00

Symptom

Every Start AFK run fails immediately with:

git fetch origin: exit status 128: error: cannot run ssh: No such file or directory
fatal: unable to fork

Root cause

PR #68 added pkgs.git to the lab systemd service PATH but not pkgs.openssh. Project origins are SSH remotes (forgejo@git.cloonar.com:…), and git fetch origin in AddWorktree (git.go:62) forks the ssh binary via a PATH lookup. With no ssh on the service PATH the fork fails before the worktree is ever created, so the run never starts (and rolls the issue label back).

Fix

Add pkgs.openssh to systemd.services.lab.path in hosts/fw/vms/dev/modules/lab/default.nix. The lab service already runs as dominik with HOME=/home/dominik, so the existing SSH key and known_hosts apply once ssh is reachable. Also covers the later git push of the afk/<N> branch.

Verification

Reproduced the exact error by forcing git's bare-ssh PATH lookup (GIT_SSH_COMMAND=ssh) with ssh absent from PATH; the identical git fetch origin succeeds once openssh is on PATH. (A naive local repro was misleading because this notebook's git binary hardcodes an absolute ssh store path — but the error's bare ssh name proves the microvm git relies on PATH.) Pre-commit dry-build of fw: OK.

Note on test coverage

No clean regression seam: the Go tests substitute a fake Git, so they can't catch a missing runtime PATH package, and the pre-commit gate is eval-only — it never instantiates the running service. Undeclared runtime-PATH deps are structurally invisible to both gates.

## Symptom Every *Start AFK run* fails immediately with: ``` git fetch origin: exit status 128: error: cannot run ssh: No such file or directory fatal: unable to fork ``` ## Root cause PR #68 added `pkgs.git` to the lab systemd service PATH but not `pkgs.openssh`. Project origins are SSH remotes (`forgejo@git.cloonar.com:…`), and `git fetch origin` in `AddWorktree` (`git.go:62`) forks the `ssh` binary via a PATH lookup. With no `ssh` on the service PATH the fork fails before the worktree is ever created, so the run never starts (and rolls the issue label back). ## Fix Add `pkgs.openssh` to `systemd.services.lab.path` in `hosts/fw/vms/dev/modules/lab/default.nix`. The lab service already runs as `dominik` with `HOME=/home/dominik`, so the existing SSH key and known_hosts apply once `ssh` is reachable. Also covers the later `git push` of the `afk/<N>` branch. ## Verification Reproduced the exact error by forcing git's bare-`ssh` PATH lookup (`GIT_SSH_COMMAND=ssh`) with `ssh` absent from PATH; the identical `git fetch origin` succeeds once openssh is on PATH. (A naive local repro was misleading because *this notebook's* git binary hardcodes an absolute ssh store path — but the error's **bare** `ssh` name proves the microvm git relies on PATH.) Pre-commit dry-build of `fw`: OK. ## Note on test coverage No clean regression seam: the Go tests substitute a fake `Git`, so they can't catch a missing runtime PATH package, and the pre-commit gate is eval-only — it never instantiates the running service. Undeclared runtime-PATH deps are structurally invisible to both gates.
AFK runs fetch and push project repos whose origins are SSH remotes
(forgejo@git.cloonar.com:…). git forks `ssh` off PATH, but the lab
service path listed only git, so `git fetch origin` in AddWorktree died
with "cannot run ssh: No such file or directory / fatal: unable to
fork", failing every Start AFK run before the worktree was created.

Add pkgs.openssh to the service path. Verified by forcing git's
bare-ssh PATH lookup (GIT_SSH_COMMAND=ssh) with and without openssh on
PATH: absent -> the exact error above; present -> clean fetch.
dominik.polakovics deleted branch fix/lab-afk-ssh-on-path 2026-06-01 18:52:37 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Cloonar/nixos!69
No description provided.