{"record":{"id":"c54cbfe9aa30754e","repo":"astrid-runtime/astrid","slug":"running-daemon-returned-unknown-unload-status-oth","errorCode":null,"errorMessage":"running daemon returned unknown unload status {other:?}","messagePattern":"running daemon returned unknown unload status (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-cli/src/commands/capsule/live_load.rs","lineNumber":165,"sourceCode":"        astrid_types::ipc::IpcPayload::RawJson(val),\n        session_uuid,\n    );\n    client\n        .send_message(msg)\n        .await\n        .context(\"failed to send live capsule unload request\")?;\n\n    let raw = client\n        .read_until_topic(response_topic.as_str(), std::time::Duration::from_secs(15))\n        .await\n        .context(\"running daemon did not confirm live capsule unload\")?;\n\n    match crate::socket_client::SocketClient::extract_kernel_response(&raw) {\n        Some(KernelResponse::Success(data)) => {\n            match data.get(\"status\").and_then(serde_json::Value::as_str) {\n                Some(\"unloaded\") => Ok(LiveUnload::Unloaded),\n                Some(\"not_loaded\") => Ok(LiveUnload::NotLoaded),\n                Some(other) => bail!(\"running daemon returned unknown unload status {other:?}\"),\n                None => bail!(\"running daemon returned unload success without a status\"),\n            }\n        },\n        Some(KernelResponse::Error(reason)) => {\n            bail!(\"running daemon declined live capsule unload: {reason}\")\n        },\n        _ => bail!(\"running daemon returned a malformed live capsule unload response\"),\n    }\n}\n\nasync fn daemon_socket_reachable() -> bool {\n    let path = crate::socket_client::proxy_socket_path();\n    matches!(\n        astrid_core::local_transport::connect_outcome(&path).await,\n        Ok(astrid_core::local_transport::ConnectOutcome::Connected(_))\n    )\n}\n","sourceCodeStart":147,"sourceCodeEnd":183,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-cli/src/commands/capsule/live_load.rs#L147-L183","documentation":"Raised by `try_daemon_unload` when a live-unload request succeeds at the transport level (`KernelResponse::Success`) but the `status` string inside the response data is neither `unloaded` nor `not_loaded` — an unrecognized status value. The daemon acknowledged the request but returned a status the CLI does not know, indicating protocol drift or a non-conforming daemon.","triggerScenarios":"Attempting a live unload of a running capsule where the daemon's Success payload contains `status` values like a new `\"partial\"`, localized, or version-skewed status string that this CLI build does not map to `LiveUnload::Unloaded`/`NotLoaded`.","commonSituations":"Daemon running a newer build that emits new unload statuses while the CLI is older; custom daemon builds with different status vocabulary; manual edits or middleware altering the response JSON.","solutions":["Note the unknown status printed in `{other:?}` and upgrade the CLI to match the daemon's protocol.","Restart the daemon on the matching version so both binaries agree on status vocabulary.","As a fallback, perform a full (non-live) uninstall/reinstall of the capsule instead of live unload.","Check whether any proxy or wrapper is modifying daemon responses."],"exampleFix":"// before: newer daemon returns \"partially_unloaded\"\n// error: running daemon returned unknown unload status \"partially_unloaded\"\n\n// after: align versions\nastrid upgrade cli && astrid daemon restart\nastrid capsule live-unload my-capsule","handlingStrategy":"type-guard","validationCode":"if let Some(status) = data.get(\"status\").and_then(|v| v.as_str()) {\n    if !matches!(status, \"unloaded\" | \"not_loaded\") {\n        eprintln!(\"Daemon reported unrecognized unload status '{status}'; upgrade the CLI.\");\n    }\n}","typeGuard":"fn known_unload_status(data: &serde_json::Value) -> Option<LiveUnload> {\n    match data.get(\"status\").and_then(serde_json::Value::as_str)? {\n        \"unloaded\" => Some(LiveUnload::Unloaded),\n        \"not_loaded\" => Some(LiveUnload::NotLoaded),\n        _ => None,\n    }\n}","tryCatchPattern":"match try_daemon_unload(name).await {\n    Ok(LiveUnload::Unloaded) | Ok(LiveUnload::NotLoaded) => proceed(),\n    Err(e) if e.to_string().contains(\"unknown unload status\") => {\n        eprintln!(\"{e:#}\\nCLI/daemon version mismatch - upgrade the CLI or use full uninstall.\");\n    },\n    Err(e) => return Err(e),\n}","preventionTips":["Keep CLI and daemon on the same release so status vocabularies match.","Fall back to a full uninstall/reinstall when live unload reports an unrecognized status.","Log the raw daemon payload when adding new status strings to avoid silent mismatches.","Test live-unload against your daemon build before automating it."],"tags":["daemon","ipc","protocol","capsule"],"backgroundTag":"unexpected-response-shape","analyzedSha":"affd8760f44190dbdfbec23403f4c4b642c33112","analyzedAt":"2026-09-09T21:28:12.402Z","contentChangedAt":"2026-09-09T21:28:12.402Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}