{"record":{"id":"728ddc8b0df65158","repo":"pbakaus/impeccable","slug":"live-server-not-running-start-one-with","errorCode":null,"errorMessage":"Live server not running. Start one with: {}\n","messagePattern":"Live server not running\\. Start one with: (.+?)\n","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/live/src/live_poll.rs","lineNumber":750,"sourceCode":"            Err(msg) => {\n                io.err(&format!(\"{}\\n\", msg));\n                return 1;\n            }\n        };\n        let then_poll = argv.iter().any(|a| a == \"--then-poll\");\n        return match post_reply(&base, &token, &reply) {\n            Ok(()) => {\n                let ack = reply_ack_json(&reply);\n                if then_poll {\n                    // One round trip instead of two: the reply is in, so wait\n                    // for what the browser does next (usually the accept).\n                    return one_shot_poll(&argv, &base, &token, Some(ack), io);\n                }\n                println(io, &serde_json::to_string(&ack).unwrap_or_default());\n                0\n            }\n            Err(PollError::ConnRefused) => {\n                io.err(&format!(\n                    \"Live server not running. Start one with: {}\\n\",\n                    script_cmd(&env, &cwd, \"live\")\n                ));\n                1\n            }\n            Err(PollError::Auth) => {\n                // JS: a 401 on the reply POST is a non-ok response -> \"Reply failed: <body.error>\"\n                io.err(\"Reply failed: Unauthorized\\n\");\n                1\n            }\n            Err(PollError::AckTimeout(m)) | Err(PollError::Other(m)) => {\n                io.err(&format!(\"Reply failed: {}\\n\", m));\n                1\n            }\n        };\n    }\n\n    let stream_mode = argv.iter().any(|a| a == \"--stream\");","sourceCodeStart":732,"sourceCodeEnd":768,"githubUrl":"https://github.com/pbakaus/impeccable/blob/f2c7051853848826aac2f4646581d62a732155ad/crates/live/src/live_poll.rs#L732-L768","documentation":"live-poll tried to contact the local live-mode server's HTTP endpoint and got a connection-refused error (PollError::ConnRefused), meaning nothing is listening on the expected port. The CLI prints instructions with the exact command to start the server (`script_cmd(&env, &cwd, \"live\")`) and exits 1.","triggerScenarios":"Running a live poll/ack command (e.g. `impeccable live-poll ...`) in a terminal before the live server process has been started, after the server crashed or exited, or when the server is running on a different port/base URL than the one `--base` (or default) points to.","commonSituations":"Fresh clone/first run where the live server was never started; server killed between sessions; port mismatch after changing config; firewall/sandbox blocking localhost connections.","solutions":["Start the live server using the command shown in the error message (the printed `live` script command) and retry the poll.","Verify the server is actually listening (check its process/log and the port) and that your --base URL/port matches it.","If the server crashed, inspect its logs, fix the startup failure, and restart before polling again."],"exampleFix":"// before (server not started)\n$ impeccable live-poll --base http://127.0.0.1:9 khu\n// Live server not running. Start one with: ...\n// after\n$ <live start command from the error message>\n$ impeccable live-poll --base http://127.0.0.1:9 khu","handlingStrategy":"retry","validationCode":"// Check the server is up before polling:\nconst res = await fetch(base + '/health').catch(() => null);\nif (!res || !res.ok) console.error('Live server not running; start it first.');","typeGuard":null,"tryCatchPattern":"try {\n  runLivePoll();\n} catch (e) {\n  if (e.code === 'ECONNREFUSED') {\n    startLiveServer(); // then retry with backoff\n    await waitForPort(base);\n    runLivePoll();\n  } else throw e;\n}","preventionTips":["Start the live server as part of your dev-session bootstrap before running poll commands.","Keep the --base/port in a shared config so client and server always agree.","Add a health/ready check or connection retry loop before the first poll."],"tags":["network","connection","live-server"],"backgroundTag":"connection-refused","analyzedSha":"f2c7051853848826aac2f4646581d62a732155ad","analyzedAt":"2026-09-16T20:43:47.549Z","contentChangedAt":"2026-09-16T20:43:47.549Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}