diegosouzapw/OmniRoute · error · HeadroomError
STOP_FAILED
STOP_FAILED
Error message
Failed to stop headroom proxy: ${msg} What it means
stopHeadroomProxy(): process.kill(pid) threw while trying to SIGTERM the managed proxy (e.g. EPERM or an already-reaped pid racing the liveness check). The pid file is cleared and the kill error is wrapped in a STOP_FAILED HeadroomError.
Solutions
- If EPERM, run the stop with sufficient privileges to signal the proxy's owner
- Verify the process actually died; clearPid already ran so state is consistent for a fresh start
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at src/lib/headroom/process.ts:175 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25).
Data as JSON: /api/errors/efdb21ebe53b4b3f.
Report an issue: GitHub.
Appendix: source
Thrown at src/lib/headroom/process.ts:175
const pid = getManagedPid();
if (!pid) return { stopped: false, reason: "not_running" };
try {
process.kill(pid, "SIGTERM");
setTimeout(() => {
if (isPidAlive(pid)) {
try {
process.kill(pid, "SIGKILL");
} catch {
// already gone
}
}
}, STOP_GRACE_MS);
clearPid();
return { stopped: true, pid };
} catch (e) {
clearPid();
const msg = e instanceof Error ? e.message : String(e);
throw new HeadroomError(`Failed to stop headroom proxy: ${msg}`, "STOP_FAILED");
}
}
View on GitHub (pinned to a179ffed5b)