{"record":{"id":"6ecaae651904b0dd","repo":"facebook/flow","slug":"unknown-exception-reading-from-the-server","errorCode":null,"errorMessage":"Unknown exception reading from the server: {}","messagePattern":"Unknown exception reading from the server: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"rust_port/crates/flow_cli/src/command_utils.rs","lineNumber":3058,"sourceCode":"                            | std::io::ErrorKind::UnexpectedEof\n                    ) =>\n                {\n                    if !quiet && flow_utils_tty::spinner_used() {\n                        let stderr = std::io::stderr();\n                        let mut stderr = stderr.lock();\n                        flow_utils_tty::print_clear_line(&mut stderr)\n                            .expect(\"failed to clear spinner line\");\n                    }\n                    return Err(());\n                }\n                Err(e) => {\n                    if !quiet && flow_utils_tty::spinner_used() {\n                        let stderr = std::io::stderr();\n                        let mut stderr = stderr.lock();\n                        flow_utils_tty::print_clear_line(&mut stderr)\n                            .expect(\"failed to clear spinner line\");\n                    }\n                    panic!(\"Unknown exception reading from the server: {}\", e)\n                }\n            };\n            match response {\n                MonitorToClientMessage::PleaseHold(server_status, watcher_status) => {\n                    let status_string = {\n                        if server_status::is_free(&server_status) {\n                            // Let's ignore messages from the server that it is free.\n                            // It's a confusing message for the user\n                            if watcher_status.1 == file_watcher_status::StatusKind::Ready {\n                                None\n                            } else {\n                                Some(file_watcher_status::string_of_status(&watcher_status))\n                            }\n                        } else {\n                            Some(server_status::string_of_status(\n                                use_emoji,\n                                false,\n                                &server_status,","sourceCodeStart":3040,"sourceCodeEnd":3076,"githubUrl":"https://github.com/facebook/flow/blob/f88ac94bcf6992f5d5a158854d94613ebb92c6e6/rust_port/crates/flow_cli/src/command_utils.rs#L3040-L3076","documentation":"The flow CLI client reads MonitorToClientMessage frames from the running flow server over a socket. Known disconnect-style io::Error kinds are handled gracefully (spinner line cleared, Err(()) returned so the retry loop can reconnect); this panic fires for any other read error, i.e. an unexpected OS-level or decode failure while waiting for a server response.","triggerScenarios":"Reading a MonitorToClientMessage from the server socket returns an io::Error whose kind is not in the handled set: server crashes mid-write leaving truncated data, socket reset in an unusual way, garbage bytes causing a decode failure, or transport errors during machine suspend/resume.","commonSituations":"Flow server OOM-killed while processing a large check; CLI and server from different flow installations sharing a socket dir (protocol mismatch); laptop suspend/resume dropping the connection; stale daemon left running after a flow upgrade.","solutions":["Stop the stale server (flow stop, or kill the daemon) and rerun the command so a fresh server spawns","Check server logs and dmesg for OOM kills or crashes; reduce memory pressure (fewer workers, smaller project, more RAM)","Ensure the CLI and the daemon resolve to the same flow installation/version (one flow on PATH)","If it persists, capture the underlying io::Error text from the panic and report it"],"exampleFix":"# before\nflow check   # panics: Unknown exception reading from the server: <e>\n\n# after\nflow stop\nflow check","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep exactly one flow installation so client and server versions always match","Run flow stop after upgrading flow before starting new commands","Watch server memory; OOM-killed servers are the most common source of mid-read failures"],"tags":["client-server","socket","io","panic","flow-server"],"backgroundTag":"server-connection-lost","analyzedSha":"f88ac94bcf6992f5d5a158854d94613ebb92c6e6","analyzedAt":"2026-08-20T10:41:37.992Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}