{"record":{"id":"26e1cb419afdd640","repo":"symfony/process","slug":"output-cannot-be-disabled-while-an-idle-timeout-is-set","errorCode":null,"errorMessage":"Output cannot be disabled while an idle timeout is set.","messagePattern":"Output cannot be disabled while an idle timeout is set\\.","errorType":"exception","errorClass":"LogicException","httpStatus":null,"severity":"error","filePath":"Process.php","lineNumber":594,"sourceCode":"\n        return $this;\n    }\n\n    /**\n     * Disables fetching output and error output from the underlying process.\n     *\n     * @return $this\n     *\n     * @throws RuntimeException In case the process is already running\n     * @throws LogicException   if an idle timeout is set\n     */\n    public function disableOutput(): static\n    {\n        if ($this->isRunning()) {\n            throw new RuntimeException('Disabling output while the process is running is not possible.');\n        }\n        if (null !== $this->idleTimeout) {\n            throw new LogicException('Output cannot be disabled while an idle timeout is set.');\n        }\n\n        $this->outputDisabled = true;\n\n        return $this;\n    }\n\n    /**\n     * Enables fetching output and error output from the underlying process.\n     *\n     * @return $this\n     *\n     * @throws RuntimeException In case the process is already running\n     */\n    public function enableOutput(): static\n    {\n        if ($this->isRunning()) {\n            throw new RuntimeException('Enabling output while the process is running is not possible.');","sourceCodeStart":576,"sourceCodeEnd":612,"githubUrl":"https://github.com/symfony/process/blob/99b85026db14a68f02c6f3eeb01a1170ca25c491/Process.php#L576-L612","documentation":"disableOutput() throws this LogicException when an idle timeout has been configured. The idle timeout mechanism relies on reading process output to detect inactivity; with output disabled there is no read stream to monitor, so the two options are mutually exclusive and the library rejects the combination.","triggerScenarios":"Calling setIdleTimeout(...) followed by disableOutput(), or calling disableOutput() after setIdleTimeout() was set on the same Process instance.","commonSituations":"Developers hardening long-running subprocesses against hangs (adding an idle timeout) who also try to silence output for performance; configuration code setting both options independently.","solutions":["Remove the setIdleTimeout() call if output must be disabled.","Keep the idle timeout and leave output enabled (do not call disableOutput()).","Use setTimeout() as a total-duration cap instead, which does not conflict with disabled output."],"exampleFix":"// before\n$process->setIdleTimeout(5.0);\n$process->disableOutput(); // LogicException\n\n// after\n$process->setTimeout(30.0);\n$process->disableOutput();","handlingStrategy":"validation","validationCode":"if (null !== $timeout && $process instanceof \\Symfony\\Component\\Process\\Process) {\n    // idle timeout requires output enabled: do not call disableOutput()\n}","typeGuard":null,"tryCatchPattern":"try {\n    $process->disableOutput();\n} catch (\\LogicException $e) {\n    // idle timeout is set; use setTimeout() instead or keep output enabled\n}","preventionTips":["Treat idle timeout and disabled output as mutually exclusive in your config schema.","Prefer setTimeout() (wall-clock cap) when output is disabled."],"tags":["process","symfony","logic-exception","conflicting-options","idle-timeout"],"backgroundTag":"mutually-exclusive-options","analyzedSha":"99b85026db14a68f02c6f3eeb01a1170ca25c491","analyzedAt":"2026-09-14T11:23:33.683Z","contentChangedAt":"2026-09-14T11:23:33.683Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}