pbakaus/impeccable · error
Stop it first with: {self_cmd} live-server stop
Error message
Stop it first with: {self_cmd} live-server stop
What it means
This is the companion remediation line printed immediately after the 'Live server already running' message. It tells the user the exact command (`<self_cmd> live-server stop`, where self_cmd is the detected provider/CLI name) to stop the running server before starting a new one. It appears whenever a duplicate live-server start is attempted.
Source
Thrown at crates/live/src/live_server.rs:142
.map(|p| crate::util::kill0(p).is_ok())
.unwrap_or(false);
if alive {
let port = existing
.raw
.get("port")
.map(js_display)
.unwrap_or_else(|| "undefined".to_string());
let pid = existing
.raw
.get("pid")
.map(js_display)
.unwrap_or_else(|| "undefined".to_string());
io.err(&format!(
"Live server already running on port {} (pid {}).\n",
port, pid
));
let self_cmd = impeccable_context::provider::detect(&env, &cwd).self_cmd;
io.err(&format!(
"Stop it first with: {} live-server stop\n",
self_cmd
));
return 1;
}
let _ = std::fs::remove_file(&path);
}
let token = random_uuid();
let store = create_live_session_store(&cwd, &env, None);
let (log_tx, log_rx) = channel::<(bool, String)>();
let debug_events = env
.get("IMPECCABLE_LIVE_DEBUG_EVENTS")
.map(|v| matches!(v.to_ascii_lowercase().as_str(), "1" | "true" | "yes"))
.unwrap_or(false);
let detect_script = load_detect_script(&env, &cwd);
let shared: Shared = Arc::new_cyclic(|weak| {
Mutex::new(ServerState {View on GitHub (pinned to 2bc2879276)
Solutions
- Run the printed stop command (`<self_cmd> live-server stop`) before starting a new live server.
- Make start logic stop-then-start or check-then-start when a session already exists.
- Remove the stale info file if the recorded pid is no longer alive.
Example fix
// before $ ./scripts/impeccable live Stop it first with: impeccable live-server stop // after $ impeccable live-server stop $ ./scripts/impeccable live
Defensive patterns
Strategy: fallback
Validate before calling
// run the printed remediation automatically when a duplicate start is detected pid=$(jq -r .pid .impeccable/live-server.json 2>/dev/null) if [ -n "$pid" ] && kill -0 "$pid" 2>/dev/null; then <self_cmd> live-server stop; fi
Prevention
- Treat `live-server stop` as the required transition step before every fresh start in scripts.
- Log session lifecycle (start/stop) so duplicate starts are visible.
- In CI, always stop the server in a teardown step, even on failure.
When it happens
Trigger: Same as error 146: a `live` start attempt while an existing session info file with port/pid exists; this line is the second stderr line emitted before returning exit code 1.
Common situations: Scripts that blindly call `live` on every run without checking for an existing session; CI jobs reusing a workspace with a live server still registered.
Understand the failure class
Background: "Invalid state transition" errors: "status must be X, actually Y", "already rejected/charging/uninstalled", "cannot ... while running" — what they mean when a library rejects your call — this error's family across 31 libraries.
Related errors
- No running live server found. Start one with: {cmd}
- Live server already running on port {port} (pid {pid}).
- Status failed: ${res.status} ${res.statusText}
- Poll failed: ${res.status} ${res.statusText}
- Live browser script part missing: ${part.name} (${part.path}
AI-assisted analysis of pbakaus/impeccable@2bc2879276 (2026-09-08).
Data as JSON: /api/errors/3f7110226fa6b0b7.
Report an issue: GitHub.