{"record":{"id":"64a0e6c868329828","repo":"pbakaus/impeccable","slug":"reply-failed","errorCode":null,"errorMessage":"Reply failed: {}\n","messagePattern":"Reply failed: (.+?)\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/live/src/live_poll.rs","lineNumber":735,"sourceCode":"                return 1;\n            }\n        };\n        return match post_reply(&base, &token, &reply) {\n            Ok(()) => 0,\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\");\n    let types_arg = argv\n        .iter()\n        .find(|a| a.starts_with(\"--types=\"))\n        .map(|a| a[\"--types=\".len()..].to_string());\n    let types = normalize_poll_types(types_arg.as_deref());\n    let ack_timeout_ms = arg_value_int(&argv, \"--ack-timeout=\", 600_000);\n\n    if stream_mode {\n        io.err(\"[impeccable-poll] stream mode: one JSON object per line on stdout; use --reply while this process stays running\\n\");\n        loop {\n            let event = match fetch_next_event(&base, &token, None, &types) {\n                Ok(e) => e,","sourceCodeStart":717,"sourceCodeEnd":753,"githubUrl":"https://github.com/pbakaus/impeccable/blob/2bc2879276c1f321a53c4ca99d3371e411329b52/crates/live/src/live_poll.rs#L717-L753","documentation":"Generic failure path for the reply POST: any `PollError::AckTimeout(m)` or `PollError::Other(m)` is printed as `Reply failed: <m>` and the command exits 1. The `{}` placeholder carries the underlying message — either the server never acknowledged the reply in time, or the HTTP request failed with some other error.","triggerScenarios":"`impeccable live-poll --reply` where `post_reply` returns AckTimeout (server did not ack within the timeout window) or Other (any non-401 HTTP/transport error, e.g. a 500 or malformed response).","commonSituations":"Live server busy or hung so the ack times out; server version mismatch producing an unexpected response; transient loopback failure mid-POST; server returning a non-OK status with an error body.","solutions":["Retry the reply once the live server is responsive (check with a simple poll or curl).","Restart the live server if it is consistently failing to ack, then retry.","Read the interpolated message in the actual output to identify the specific underlying cause (timeout vs HTTP error body)."],"exampleFix":"// before\n$ impeccable live-poll --reply --reply-text hi\nReply failed: ack timed out after 5000ms\n// after\n$ ./scripts/impeccable live &   # restart a healthy server\n$ impeccable live-poll --reply --reply-text hi","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"// catch any 'Reply failed: <msg>' exit and surface the interpolated message for diagnosis\ntry {\n  execSync('impeccable live-poll --reply --reply-text \"...\"', { stdio: 'pipe' });\n} catch (e) {\n  const msg = String(e.stderr).match(/^Reply failed: (.*)$/m)?.[1];\n  console.error('reply failed, underlying cause:', msg);\n  // AckTimeout -> restart server and retry; other -> report\n}","preventionTips":["Parse the interpolated message rather than assuming a single failure mode.","Add a bounded retry with backoff for AckTimeout-shaped failures.","Keep the live server healthy (restart on crash) so acks arrive within the timeout window."],"tags":["http","timeout","live-server"],"backgroundTag":"http-error-response","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"}