facebook/flow · critical
Daemon child: failed to write token to parent out-socket: {}
Error message
Daemon child: failed to write token to parent out-socket: {} What it means
As part of the daemon handshake, the child writes the shared token bytes to the parent's out-socket to authenticate itself. write_all failing here means the socket broke before/during the write: the parent closed its end (timeout, crash) yielding EPIPE/broken pipe, or the connection was reset mid-handshake.
Source
Thrown at rust_port/crates/flow_daemon/src/daemon.rs:548
parent_out_addr,
token,
param_bytes,
} = context;
let mut child_in_sock = TcpStream::connect(parent_out_addr).unwrap_or_else(|e| {
panic!(
"Daemon child: failed to connect to parent out-socket (child read end): {}",
e
)
});
child_in_sock.set_nodelay(true).unwrap_or_else(|e| {
panic!(
"Daemon child: failed to set TCP_NODELAY on parent out-socket: {}",
e
)
});
child_in_sock.write_all(&token).unwrap_or_else(|e| {
panic!(
"Daemon child: failed to write token to parent out-socket: {}",
e
)
});
let mut child_out_sock = TcpStream::connect(parent_in_addr).unwrap_or_else(|e| {
panic!(
"Daemon child: failed to connect to parent in-socket (child write end): {}",
e
)
});
child_out_sock.set_nodelay(true).unwrap_or_else(|e| {
panic!(
"Daemon child: failed to set TCP_NODELAY on parent in-socket: {}",
e
)
});
child_out_sock.write_all(&token).unwrap_or_else(|e| {
panic!(View on GitHub (pinned to f88ac94bcf)
Solutions
- Retry the flow command; transient handshake races usually clear
- Reduce load or increase resources if the machine is heavily loaded during startup
- Run flow stop to clear stale daemon state before retrying
- Check parent-side logs for the reason it closed the socket early
Defensive patterns
Strategy: retry
Prevention
- Reduce machine load during daemon startup so the handshake completes inside parent timeouts
- Configure supervisors not to kill the flow parent mid-spawn
- Retry the command once after flow stop if a handshake pipe breaks
When it happens
Trigger: Parent flow process exits or times out waiting for the token before the child writes it; parent-side accept loop already gave up; connection reset by the OS or an intermediary on loopback.
Common situations: Slow/loaded machines stretching the handshake past the parent's timeout; process supervisors killing the parent tree mid-spawn; resource pressure causing the parent to abort startup.
Related errors
- Daemon child: failed to write token to parent in-socket: {}
- Daemon child: failed to connect to parent out-socket (child
- Daemon child: failed to set TCP_NODELAY on parent out-socket
- Daemon child: failed to connect to parent in-socket (child w
- Daemon child: failed to set TCP_NODELAY on parent in-socket:
AI-assisted analysis of facebook/flow@f88ac94bcf (2026-08-20).
Data as JSON: /api/errors/8bc72e840649e24b.
Report an issue: GitHub.