{"record":{"id":"4fea60b405415cf9","repo":"Seldaek/monolog","slug":"end-of-file-reached-probably-we-got-disconnected","errorCode":null,"errorMessage":"End-of-file reached, probably we got disconnected (sent $sent of $length)","messagePattern":"End-of-file reached, probably we got disconnected \\(sent \\$sent of \\$length\\)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/Monolog/Handler/SocketHandler.php","lineNumber":408,"sourceCode":"                $chunk = $this->fwrite($data);\n            } else {\n                $chunk = $this->fwrite(substr($data, $sent));\n            }\n            if ($chunk === false) {\n                throw new \\RuntimeException(\"Could not write to socket\");\n            }\n            $sent += $chunk;\n            $socketInfo = $this->streamGetMetadata();\n            if (\\is_array($socketInfo) && (bool) $socketInfo['timed_out']) {\n                throw new \\RuntimeException(\"Write timed-out\");\n            }\n\n            if ($this->writingIsTimedOut($sent)) {\n                throw new \\RuntimeException(\"Write timed-out, no data sent for `{$this->writingTimeout}` seconds, probably we got disconnected (sent $sent of $length)\");\n            }\n        }\n        if (!$this->isConnected() && $sent < $length) {\n            throw new \\RuntimeException(\"End-of-file reached, probably we got disconnected (sent $sent of $length)\");\n        }\n    }\n\n    private function writingIsTimedOut(int $sent): bool\n    {\n        // convert to ms\n        if (0.0 === $this->writingTimeout) {\n            return false;\n        }\n\n        if ($sent !== $this->lastSentBytes) {\n            $this->lastWritingAt = microtime(true);\n            $this->lastSentBytes = $sent;\n\n            return false;\n        } else {\n            usleep(100);\n        }","sourceCodeStart":390,"sourceCodeEnd":426,"githubUrl":"https://github.com/Seldaek/monolog/blob/57eb1028342134e701e77c617565d51b6e5a2a53/src/Monolog/Handler/SocketHandler.php#L390-L426","documentation":"Error \"End-of-file reached, probably we got disconnected (sent $sent of $length)\" thrown in Seldaek/monolog.","triggerScenarios":"Thrown at src/Monolog/Handler/SocketHandler.php:408 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"57eb1028342134e701e77c617565d51b6e5a2a53","analyzedAt":"2026-08-17T02:36:30.259Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}