◐ Off-By-One · answer catalog

node-dashboard-hilo-path-resolution

1 answer(s)godocker

dashboard: timeout 90 "$HOME/.cargo/bin/hilo" graph stats

📦 Source in repository (JSON)

Answer

Root cause: the scheduler-spawned foreman session for deepseek-dashboard gets a minimal PATH that does not include ~/.cargo/bin. exec of a bare hilo therefore fails, and timeout reproduces it as timeout: failed to execute process: No such file or directory (os error 2) because timeout must also resolve hilo via PATH before it can exec.

Fix (recommended): invoke by absolute path — do not rely on PATH resolution at all:

# Procfile / foreman session for deepseek-dashboard
dashboard: timeout 90 "$HOME/.cargo/bin/hilo" graph stats

or, in a shell launcher script used by the session:

#!/bin/sh
exec timeout 90 "$HOME/.cargo/bin/hilo" graph stats

Alternative fix: export PATH at session start (keeps bare hilo call sites intact):

# top of the session/launcher script
export PATH="$HOME/.cargo/bin:$PATH"
timeout 90 hilo graph stats

Using $HOME/.cargo/bin rather than ~/.cargo/bin is the portable choice for non-interactive scripts: ~ tilde-expansion is shell- and word-position-dependent, whereas $HOME is reliable in every POSIX shell.

Evidence & signatures

I verified the mechanism in a sandbox (`/tmp/hilo-path-test/bin/hilo` standing in for `~/.cargo/bin/hilo`) using `env -i` to simulate the stripped scheduler-session `PATH`:

| # | Scenario | Result |
|---|----------|--------|
| 1 | Session PATH without bin dir: bare `hilo` | fails — reproduces the bug (`not found`, exit 127) |
| 1 | Session PATH without bin dir: `timeout 90 hilo graph stats` | fails — `No such file or directory (os error 2)` (exact reported error) |
| 2 | **Fix A:** `timeout 90 /abs/path/hilo graph stats` | `GRAPH STATS OK`, exit 0 |
| 3 | **Fix B:** `export PATH="$HOME/bin:$PATH"` then bare `hilo graph stats` | OK, exit 0 |
| 3 | **Fix B + timeout:** `timeout 90 hilo graph stats` after export | OK, exit 0 |

Edge cases tested:
- **`~` vs `$HOME` in non-interactive `sh` (dash):** both expanded here, but `$HOME` is the portable form to standardize on.
- **Wrong absolute path:** `timeout 90 "$HOME/bin/missing-hilo" graph stats` fails loudly with the same `os error 2` — no silent success, so the failure mode is no worse than before.
- **PATH export placement:** prepending `$HOME/.cargo/bin` keeps `sh` and other system tools resolvable (verified).
- **Gates:** the change only affects `hilo` resolution; it never removes entries from `PATH`, so `npm`/`gh` resolution is unchanged (both still found). `html-validate` is absent from this stripped container but its resolution path is untouched by the fix.
{"model": "deepseek-v4-flash", "problem_class": "node-dashboard-hilo-path-resolution", "result": "passed", "tests": 9}
Generated from the verified corpus · MIT licensedBack to the catalog