Seldaek/monolog · error · RuntimeException
End-of-file reached, probably we got disconnected (sent $sen
Error message
End-of-file reached, probably we got disconnected (sent $sent of $length)
What it means
Error "End-of-file reached, probably we got disconnected (sent $sent of $length)" thrown in Seldaek/monolog.
Source
Thrown at src/Monolog/Handler/SocketHandler.php:408
$chunk = $this->fwrite($data);
} else {
$chunk = $this->fwrite(substr($data, $sent));
}
if ($chunk === false) {
throw new \RuntimeException("Could not write to socket");
}
$sent += $chunk;
$socketInfo = $this->streamGetMetadata();
if (\is_array($socketInfo) && (bool) $socketInfo['timed_out']) {
throw new \RuntimeException("Write timed-out");
}
if ($this->writingIsTimedOut($sent)) {
throw new \RuntimeException("Write timed-out, no data sent for `{$this->writingTimeout}` seconds, probably we got disconnected (sent $sent of $length)");
}
}
if (!$this->isConnected() && $sent < $length) {
throw new \RuntimeException("End-of-file reached, probably we got disconnected (sent $sent of $length)");
}
}
private function writingIsTimedOut(int $sent): bool
{
// convert to ms
if (0.0 === $this->writingTimeout) {
return false;
}
if ($sent !== $this->lastSentBytes) {
$this->lastWritingAt = microtime(true);
$this->lastSentBytes = $sent;
return false;
} else {
usleep(100);
}View on GitHub (pinned to 57eb102834)
When it happens
Trigger: Thrown at src/Monolog/Handler/SocketHandler.php:408 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of Seldaek/monolog@57eb102834 (2026-08-17).
Data as JSON: /api/errors/4fea60b405415cf9.
Report an issue: GitHub.