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
- Rerun the command; the retry path usually reconnects once the server is restarted
- Run flow stop to clear any half-dead daemon, then retry
- Verify client and server come from the same flow version and installation
- Investigate server-side crashes (logs, dmesg/OOM) if sends repeatedly fail
Defensive patterns
Strategy: retry
Prevention
- Rerun the command when a server dies mid-send; the built-in retry path needs a healthy server
- Pin client and server to the same flow build in CI and on dev machines
- Avoid killing the flow server while commands are in flight
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
- Unknown exception reading from the server: {}
- failed to dup server->monitor channel
- failed to dup monitor->server channel
- Daemon child: failed to connect to parent out-socket (child
- Daemon child: failed to set TCP_NODELAY on parent out-socket
AI-assisted analysis of facebook/flow@f88ac94bcf (2026-08-20).
Data as JSON: /api/errors/e2a99f9f2459e29e.
Report an issue: GitHub.