{"record":{"id":"bf298e9081dd6d24","repo":"pbakaus/impeccable","slug":"live-server-not-running-start-one-with-cmd","errorCode":null,"errorMessage":"Live server not running. Start one with: {cmd}\n","messagePattern":"Live server not running\\. Start one with: (.+?)\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/live/src/live_poll.rs","lineNumber":647,"sourceCode":"    print_poll_event(&mut event, io);\n    event\n}\n\nfn handle_poll_error(err: PollError, io: &mut Io) -> i32 {\n    let cwd = io.cwd.to_string_lossy().into_owned();\n    let env = io.env.clone();\n    match err {\n        PollError::Auth => {\n            io.err(\"Authentication failed. The server token may have changed.\\n\");\n            io.err(&format!(\n                \"Try restarting: {} stop && {}\\n\",\n                script_cmd(&env, &cwd, \"live-server\"),\n                script_cmd(&env, &cwd, \"live\")\n            ));\n            1\n        }\n        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        PollError::AckTimeout(m) => {\n            io.err(&format!(\"{}\\n\", m));\n            1\n        }\n        PollError::Other(m) => {\n            io.err(&format!(\"Poll failed: {}\\n\", m));\n            1\n        }\n    }\n}\n\nfn arg_value_int(args: &[String], prefix: &str, default: i64) -> i64 {\n    match args.iter().find(|a| a.starts_with(prefix)) {","sourceCodeStart":629,"sourceCodeEnd":665,"githubUrl":"https://github.com/pbakaus/impeccable/blob/2bc2879276c1f321a53c4ca99d3371e411329b52/crates/live/src/live_poll.rs#L629-L665","documentation":"handle_poll_error maps PollError::ConnRefused to this message and exits with code 1. The poller could not open a TCP connection to the local live server, meaning no server is listening on the expected port.","triggerScenarios":"Poll loop gets connection-refused: live-server was never started, already exited, or listens on a different port than the client's saved state expects.","commonSituations":"Machine rebooted or server crashed; server killed by Ctrl-C while the poll session persisted; stale port/state file after `live-server stop`; dev-server port changed.","solutions":["Start a live server with the printed command: `<live>` (which boots live-server as needed).","If a server should be running, check its process and port (`lsof -i :<port>`) and restart it.","Delete stale client state/port files for the project and re-run `live` to re-bind."],"exampleFix":"// before\n$ impeccable live-poll\nLive server not running. Start one with: impeccable live\n// after\n$ impeccable live   # starts live-server, then polls","handlingStrategy":"retry","validationCode":"// Check the port is listening before polling\nconst net = require('node:net');\nconst s = net.connect(port, '127.0.0.1');\ns.on('error', () => console.error('live-server not listening; start it with `impeccable live`'));\ns.on('connect', () => s.end());","typeGuard":null,"tryCatchPattern":"for (let i = 0; i < 3; i++) {\n  const res = await poll().catch(e => e);\n  if (!(res instanceof ConnRefused)) return res;\n  await startLiveServer();\n  await sleep(500);\n}\nthrow new Error('Live server did not come up');","preventionTips":["Always start the live server (or `impeccable live`, which boots it) before polling.","Clean up stale port/state files after crashes or reboots.","Pin the server port per project so the client's saved port stays valid."],"tags":["connection-refused","live-server","cli","network"],"backgroundTag":"connection-refused","analyzedSha":"2bc2879276c1f321a53c4ca99d3371e411329b52","analyzedAt":"2026-09-08T04:51:14.109Z","contentChangedAt":"2026-09-08T04:51:14.109Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}