facebook/flow · critical

Error sending command to server: {}

Error message

Error sending command to server: {}

What it means

While sending a command to the flow server, the client tolerates expected disconnect error kinds (the match arm covering UnexpectedEof and friends clears the spinner and yields Err(()), which drives the 'Lost connection to the flow server (N retries remaining)' retry path). Any other send error is not retried and panics with the underlying io error.

Source

Thrown at rust_port/crates/flow_cli/src/command_utils.rs:3187

        Ok(()) => wait_for_response(&mut stream, quiet, env.emoji, root),
        Err(bincode::error::EncodeError::Io { inner, .. })
            if matches!(
                inner.kind(),
                std::io::ErrorKind::BrokenPipe
                    | std::io::ErrorKind::ConnectionReset
                    | std::io::ErrorKind::UnexpectedEof
            ) =>
        {
            if !quiet && flow_utils_tty::spinner_used() {
                let stderr = std::io::stderr();
                let mut stderr = stderr.lock();
                flow_utils_tty::print_clear_line(&mut stderr)
                    .expect("failed to clear spinner line");
            }
            Err(())
        }
        Err(e) => {
            panic!("Error sending command to server: {}", e);
        }
    };

    match response {
        Ok(response) => response,
        Err(()) => {
            flow_commands_connect::command_connect_simple::close_connection(&sockaddr);
            if !quiet {
                eprintf_with_spinner(&format!(
                    "Lost connection to the flow server ({} {} remaining)",
                    retries,
                    if retries == 1 { "retry" } else { "retries" },
                ));
            }
            connect_and_make_request_inner(
                flowconfig_name,
                connect_flags,
                root,

View on GitHub (pinned to f88ac94bcf)

Solutions

  1. Rerun the command; the retry path usually reconnects once the server is restarted
  2. Run flow stop to clear any half-dead daemon, then retry
  3. Verify client and server come from the same flow version and installation
  4. Investigate server-side crashes (logs, dmesg/OOM) if sends repeatedly fail
Defensive patterns

Strategy: retry

Prevention

When it happens

Trigger: Sending the serialized command to the server socket fails with an error kind outside the handled set: server dies before reading the request, socket torn down abnormally, or an OS-level send failure other than the recognized EOF/connection kinds.

Common situations: Server process killed (OOM, signal) right as the client sends a command; mismatched client/server versions sharing a daemon; flaky network filesystem or container runtime killing sockets; heavy load causing the server to close connections abruptly.

Related errors


AI-assisted analysis of facebook/flow@f88ac94bcf (2026-08-20). Data as JSON: /api/errors/e2a99f9f2459e29e. Report an issue: GitHub.