{"record":{"id":"e5aff35caff4fe4b","repo":"pbakaus/impeccable","slug":"timed-out-waiting-for-live-server-to-start","errorCode":null,"errorMessage":"Timed out waiting for live server to start.\n","messagePattern":"Timed out waiting for live server to start\\.\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/live/src/live_server.rs","lineNumber":114,"sourceCode":"    }\n\n    if argv.iter().any(|a| a == \"stop\") {\n        return stop(&argv, &cwd, io);\n    }\n\n    if argv.iter().any(|a| a == \"--background\") {\n        let child_args: Vec<String> = argv\n            .iter()\n            .filter(|a| *a != \"--background\")\n            .cloned()\n            .collect();\n        return match crate::server::spawn_detached_with_args(&cwd, &env, &child_args) {\n            Some(info) => {\n                println(io, &serde_json::to_string(&info).unwrap_or_default());\n                0\n            }\n            None => {\n                io.err(\"Timed out waiting for live server to start.\\n\");\n                1\n            }\n        };\n    }\n\n    // Check for existing session\n    if let Some((existing, path)) = read_live_server_info(&cwd, &env) {\n        let alive = existing\n            .pid\n            .map(|p| crate::util::kill0(p).is_ok())\n            .unwrap_or(false);\n        if alive {\n            let port = existing\n                .raw\n                .get(\"port\")\n                .map(js_display)\n                .unwrap_or_else(|| \"undefined\".to_string());\n            let pid = existing","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/pbakaus/impeccable/blob/2bc2879276c1f321a53c4ca99d3371e411329b52/crates/live/src/live_server.rs#L96-L132","documentation":"The `live` command spawns the live server as a detached child via `spawn_detached_with_args`, which waits for the server to come up. If the process cannot be started or does not become ready before the internal deadline, it returns None and the command prints this timeout message and exits 1.","triggerScenarios":"Running the `live` command when `crate::server::spawn_detached_with_args(&cwd, &env, &child_args)` returns None — the detached server process failed to bind/respond within the wait window (spawn failure, immediate crash, or slow startup).","commonSituations":"Another process occupying the port range so the child crashes on bind; a slow machine or loaded CI runner exceeding the readiness timeout; the engine binary unable to spawn (permissions, missing runtime); antivirus/SELinux blocking detached process creation.","solutions":["Re-run the `live` command once — transient startup slowness often resolves on retry.","Check for port conflicts or leftover processes (see EADDRINUSE / `live-server stop`) and clear them before starting.","Run the server in the foreground to see the underlying spawn or bind error."],"exampleFix":"// before\n$ ./scripts/impeccable live\nTimed out waiting for live server to start.\n// after\n$ <self_cmd> live-server stop   # clear any stale server\n$ ./scripts/impeccable live      # retry the start","handlingStrategy":"retry","validationCode":"// pre-flight: ensure no stale session and that the launcher is executable before starting\n[ ! -f .impeccable/live-server.json ] && [ -x ./scripts/impeccable ] && ./scripts/impeccable live","typeGuard":null,"tryCatchPattern":"// on startup timeout, stop any partial server and retry once\ntry {\n  execSync('./scripts/impeccable live', { timeout: 20000 });\n} catch (e) {\n  if (/Timed out waiting for live server/.test(String(e.stderr))) {\n    execSync('<self_cmd> live-server stop || true');\n    execSync('./scripts/impeccable live');\n  } else throw e;\n}","preventionTips":["Clear stale sessions (`live-server stop`) before starting.","Avoid starting the server on heavily loaded machines without a longer startup budget.","Verify the engine binary can run in the target environment (permissions, sandbox policies)."],"tags":["timeout","process-spawn","live-server"],"backgroundTag":"server-start-timeout","analyzedSha":"2bc2879276c1f321a53c4ca99d3371e411329b52","analyzedAt":"2026-09-08T04:51:14.109Z","contentChangedAt":"2026-09-08T04:51:14.109Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}