{"record":{"id":"3b43616f2d423a95","repo":"symfony/process","slug":"idle-timeout-cannot-be-set-while-the-output-is-disabled","errorCode":null,"errorMessage":"Idle timeout cannot be set while the output is disabled.","messagePattern":"Idle timeout cannot be set while the output is disabled\\.","errorType":"exception","errorClass":"LogicException","httpStatus":null,"severity":"error","filePath":"Process.php","lineNumber":1065,"sourceCode":"        $this->timeout = $this->validateTimeout($timeout);\n\n        return $this;\n    }\n\n    /**\n     * Sets the process idle timeout (max. time since last output) in seconds.\n     *\n     * To disable the timeout, set this value to null.\n     *\n     * @return $this\n     *\n     * @throws LogicException           if the output is disabled\n     * @throws InvalidArgumentException if the timeout is negative\n     */\n    public function setIdleTimeout(?float $timeout): static\n    {\n        if (null !== $timeout && $this->outputDisabled) {\n            throw new LogicException('Idle timeout cannot be set while the output is disabled.');\n        }\n\n        $this->idleTimeout = $this->validateTimeout($timeout);\n\n        return $this;\n    }\n\n    /**\n     * Enables or disables the TTY mode.\n     *\n     * @return $this\n     *\n     * @throws RuntimeException In case the TTY mode is not supported\n     */\n    public function setTty(bool $tty): static\n    {\n        if ('\\\\' === \\DIRECTORY_SEPARATOR && $tty) {\n            throw new RuntimeException('TTY mode is not supported on Windows platform.');","sourceCodeStart":1047,"sourceCodeEnd":1083,"githubUrl":"https://github.com/symfony/process/blob/99b85026db14a68f02c6f3eeb01a1170ca25c491/Process.php#L1047-L1083","documentation":"setIdleTimeout() throws this LogicException when a non-null timeout is requested while process output is disabled. Idle-timeout detection works by monitoring output reads; with output disabled there is nothing to observe, so the feature cannot function and the combination is rejected.","triggerScenarios":"Calling setIdleTimeout(float) after disableOutput() was called (outputDisabled === true). Passing null is allowed.","commonSituations":"Silencing output for a noisy subprocess then later adding a hang-protection idle timeout; configuration assembled from separate flags that independently enable disableOutput and setIdleTimeout.","solutions":["Re-enable output (enableOutput()) before setting the idle timeout.","Use setTimeout() (total runtime cap) instead of an idle timeout.","Order the calls: setIdleTimeout() first, then disableOutput() is itself rejected too — so drop one of the two options."],"exampleFix":"// before\n$process->disableOutput();\n$process->setIdleTimeout(5.0); // LogicException\n\n// after\n$process->setIdleTimeout(5.0); // keep output enabled\n$process->start();","handlingStrategy":"validation","validationCode":"if (null !== $timeout && $idleTimeoutDesired) {\n    // keep output enabled; skip disableOutput() and call setIdleTimeout() before start()\n}","typeGuard":null,"tryCatchPattern":"try {\n    $process->setIdleTimeout($timeout);\n} catch (\\LogicException $e) {\n    $process->setTimeout($timeout); // fall back to total-time cap\n}","preventionTips":["Enforce in config validation: idleTimeout implies output enabled.","Order setters: setIdleTimeout() first in the builder and assert output stays enabled."],"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"}