{"record":{"id":"110485b308fbc85c","repo":"Seldaek/monolog","slug":"the-optional-cwd-argument-must-be-a-non-empty-stri","errorCode":null,"errorMessage":"The optional CWD argument must be a non-empty string or null.","messagePattern":"The optional CWD argument must be a non-empty string or null\\.","errorType":"exception","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"src/Monolog/Handler/ProcessHandler.php","lineNumber":70,"sourceCode":"        0 => ['pipe', 'r'],  // STDIN is a pipe that the child will read from\n        1 => ['pipe', 'w'],  // STDOUT is a pipe that the child will write to\n        2 => ['pipe', 'w'],  // STDERR is a pipe to catch the any errors\n    ];\n\n    /**\n     * @param  string                    $command Command for the process to start. Absolute paths are recommended,\n     *                                            especially if you do not use the $cwd parameter.\n     * @param  string|null               $cwd     \"Current working directory\" (CWD) for the process to be executed in.\n     * @param  float                     $timeout The maximum timeout (in seconds) for the stream_select() function.\n     * @throws \\InvalidArgumentException\n     */\n    public function __construct(string $command, int|string|Level $level = Level::Debug, bool $bubble = true, ?string $cwd = null, float $timeout = 1.0)\n    {\n        if ($command === '') {\n            throw new \\InvalidArgumentException('The command argument must be a non-empty string.');\n        }\n        if ($cwd === '') {\n            throw new \\InvalidArgumentException('The optional CWD argument must be a non-empty string or null.');\n        }\n\n        parent::__construct($level, $bubble);\n\n        $this->command = $command;\n        $this->cwd = $cwd;\n        $this->timeout = $timeout;\n    }\n\n    /**\n     * Writes the record down to the log of the implementing handler\n     *\n     * @throws \\UnexpectedValueException\n     */\n    protected function write(LogRecord $record): void\n    {\n        $this->ensureProcessIsStarted();\n","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/Seldaek/monolog/blob/57eb1028342134e701e77c617565d51b6e5a2a53/src/Monolog/Handler/ProcessHandler.php#L52-L88","documentation":"Error \"The optional CWD argument must be a non-empty string or null.\" thrown in Seldaek/monolog.","triggerScenarios":"Thrown at src/Monolog/Handler/ProcessHandler.php:70 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"}