{"record":{"id":"0e35795c7dfe5f62","repo":"zed-industries/zed","slug":"unexpected-status-from-subprocess-other","errorCode":null,"errorMessage":"Unexpected status from subprocess: {other:?}","messagePattern":"Unexpected status from subprocess: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/etw_tracing/etw_tracing.rs","lineNumber":632,"sourceCode":"    let (stream, _) = listener.accept().context(\"Accept subprocess connection\")?;\n\n    let mut session = EtwSession {\n        output_path: output_path.to_path_buf(),\n        stream: BufReader::new(stream),\n        listener,\n        socket_path: sock_path,\n    };\n\n    let status: StatusMessage =\n        recv_json(&mut session.stream).context(\"Wait for Started status\")?;\n\n    match status {\n        StatusMessage::Started => {}\n        StatusMessage::Error { message } => {\n            bail!(\"Subprocess reported error during start: {message}\");\n        }\n        other => {\n            bail!(\"Unexpected status from subprocess: {other:?}\");\n        }\n    }\n\n    Ok(session)\n}\n\n#[derive(Debug, serde::Serialize, serde::Deserialize)]\n#[serde(tag = \"type\")]\npub enum StatusMessage {\n    Started,\n    Stopped,\n    TimedOut,\n    Cancelled,\n    Error { message: String },\n}\n\n#[derive(Debug, serde::Serialize, serde::Deserialize)]\n#[serde(tag = \"type\")]","sourceCodeStart":614,"sourceCodeEnd":650,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/etw_tracing/etw_tracing.rs#L614-L650","documentation":"During the ETW recording handshake, launch_etw_recording() expected the elevated subprocess's first StatusMessage to be Started (or Error), but received another variant such as Stopped or TimedOut. Stopped/TimedOut are terminal states the child only sends after a recording session ends, so receiving one as the first message means the IPC protocol state machine desynchronized - typically a version mismatch between the parent process and the elevated child it spawned.","triggerScenarios":"accept() on the ETW Unix socket returns a stream whose first JSON line deserializes to StatusMessage::Stopped or StatusMessage::TimedOut instead of Started. Happens when the elevated child is a different Zed build than the running parent (exe replaced by an update/staged install between parent start and elevation), or a child bug sends the terminal status early.","commonSituations":"Zed auto-updated or the binary was swapped (e.g. cargo install / CI deploy) while an older instance was still running and then started an ETW recording; running mixed-version Zed binaries side by side where ShellExecuteW launches the new exe while the old parent expects the old protocol.","solutions":["Restart Zed so parent and elevated child run the same binary, then retry the recording","Ensure only one Zed installation/version is in play (the elevated child is launched from std::env::current_exe(), so both come from the same path - check for concurrent updates or file replacement)","If it reproduces on a fresh same-version process, capture logs of both processes and report a Zed bug with the {other:?} payload"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match launch_etw_recording(heap_pid, output_path) {\n    Ok(session) => Ok(session),\n    Err(err) if err.to_string().contains(\"Unexpected status from subprocess\") => {\n        // protocol/version mismatch: restarting the app realigns parent and child\n        suggest_restart();\n        Err(err)\n    }\n    Err(err) => Err(err),\n}","preventionTips":["Avoid swapping the Zed binary underneath a running instance (updates should apply after restart)","Treat this specific message as a 'restart and retry' signal rather than a configuration problem","Keep parent and elevated child on the same build; do not mix install sources"],"tags":["windows","etw","ipc","protocol-mismatch","handshake"],"backgroundTag":"ipc-protocol-state-mismatch","analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}