{"record":{"id":"d89ec523ae3e8426","repo":"facebook/flow","slug":"failed-to-clear-spinner-line-d89ec5","errorCode":null,"errorMessage":"failed to clear spinner line","messagePattern":"failed to clear spinner line","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"rust_port/crates/flow_command_utils/src/lib.rs","lineNumber":2959,"sourceCode":"                        bincode::config::legacy()\n                            .with_limit::<{ flow_commands_connect::command_connect_simple::MAX_FRAME_BYTES }>(),\n                    )\n                });\n            let response = match response {\n                Ok(r) => r,\n                Err(bincode::error::DecodeError::Io { inner, .. })\n                    if matches!(\n                        inner.kind(),\n                        std::io::ErrorKind::BrokenPipe\n                            | std::io::ErrorKind::ConnectionReset\n                            | std::io::ErrorKind::UnexpectedEof\n                    ) =>\n                {\n                    if show_progress && 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 show_progress && 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.","sourceCodeStart":2941,"sourceCodeEnd":2977,"githubUrl":"https://github.com/facebook/flow/blob/5c865861998a8ccb7dbc82b0c1f511e9ef60c3d9/rust_port/crates/flow_command_utils/src/lib.rs#L2941-L2977","documentation":"When the server tells the client to hold (PleaseHold) or otherwise returns a retryable state, the client clears the spinner line on stderr before returning; if print_clear_line fails, it panics with this message. Like other spinner panics, it indicates stderr became unwritable mid-command.","triggerScenarios":"During a server command with show_progress enabled and a spinner in use, the PleaseHold/Err(()) branch calls flow_utils_tty::print_clear_line on locked stderr and the write fails (closed pipe, unwritable target).","commonSituations":"Long `flow check`/IDE-status commands whose stderr pipe is closed by a supervisor, or output redirected to a file that became unwritable (disk full).","solutions":["Keep stderr attached and open for the whole flow command; avoid early-exiting pipe consumers.","Run without a TTY/spinner (redirect output, or disable progress) so the clear-line path is skipped.","Free disk space / fix permissions on the stderr target file."],"exampleFix":"// before\nflow status | grep -m1 ready   # grep exits, pipe closes\n// after\nflow status > out.log 2>&1; grep -m1 ready out.log","handlingStrategy":"fallback","validationCode":"[ -t 2 ] || [ -w /dev/stderr ] || echo 'stderr unusable; run without progress output'","typeGuard":null,"tryCatchPattern":"flow status > status.log 2>&1 || { cat status.log; exit 1; }","preventionTips":["Keep stderr open for the entire command lifetime.","Prefer file redirection over pipes for long flow commands.","Disable spinners in non-interactive environments."],"tags":["io","stderr","spinner","broken-pipe"],"backgroundTag":"broken-pipe","analyzedSha":"5c865861998a8ccb7dbc82b0c1f511e9ef60c3d9","analyzedAt":"2026-09-08T04:32:53.179Z","contentChangedAt":"2026-09-08T04:32:53.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}