symfony/process · warning · LogicException
Unknown timeout type
Error message
Unknown timeout type "%d".
What it means
ProcessTimedOutException carries a timeoutType (TYPE_GENERAL or TYPE_IDLE). getExceededTimeout() maps the type to the process timeout or idle timeout; an unknown type means the exception's internal invariant was violated (type not set via the class constants), so a LogicException is thrown.
Solutions
- Only construct ProcessTimedOutException via Process internals or with the class constants TYPE_GENERAL/TYPE_IDLE
- Before reading, check isGeneralTimeout()/isIdleTimeout() and read the corresponding process timeout directly
- Catch and inspect: wrap getExceededTimeout() in try/catch for LogicException and fall back to null
Example fix
// before $timeout = $e->getExceededTimeout(); // after $timeout = $e->isGeneralTimeout() ? $process->getTimeout() : ($e->isIdleTimeout() ? $process->getIdleTimeout() : null);
Defensive patterns
Strategy: try-catch
Validate before calling
$timeout = in_array($e->getTimeoutType(), [ProcessTimedOutException::TYPE_GENERAL, ProcessTimedOutException::TYPE_IDLE], true) ? $e->getExceededTimeout() : null;
Try / catch
try { $timeout = $e->getExceededTimeout(); } catch (\LogicException $e) { $timeout = null; } Prevention
- Only create ProcessTimedOutException with the class's TYPE_* constants
- Prefer isGeneralTimeout()/isIdleTimeout() over raw type ints
- Handle timeouts via Process::wait() exception flow rather than manual exception construction
When it happens
Trigger: Calling getExceededTimeout() on a ProcessTimedOutException whose $timeoutType constructor argument is neither TYPE_GENERAL nor TYPE_IDLE — normally only through manual construction of the exception or library-internal bugs.
Common situations: Manually instantiating ProcessTimedOutException with an arbitrary int, or catching the exception after a library version change that altered timeout type constants.
Understand the failure class
Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.
- Timeouts: ETIMEDOUT, deadlines, and hung requests — what actually expires when a request times out.
Related errors
- The timeout value must be a valid positive integer or float…
- Disabling output while the process is running is not…
- Output cannot be disabled while an idle timeout is set.
- Enabling output while the process is running is not…
- This PHP has been compiled with --enable-sigchild. Term…
AI-assisted analysis of symfony/process@99b85026db (2026-09-14).
Data as JSON: /api/errors/a7ce1ea5bfa26185.
Report an issue: GitHub.
Appendix: source
Thrown at Exception/ProcessTimedOutException.php:57
return $this->process;
}
public function isGeneralTimeout(): bool
{
return self::TYPE_GENERAL === $this->timeoutType;
}
public function isIdleTimeout(): bool
{
return self::TYPE_IDLE === $this->timeoutType;
}
public function getExceededTimeout(): ?float
{
return match ($this->timeoutType) {
self::TYPE_GENERAL => $this->process->getTimeout(),
self::TYPE_IDLE => $this->process->getIdleTimeout(),
default => throw new \LogicException(\sprintf('Unknown timeout type "%d".', $this->timeoutType)),
};
}
}
View on GitHub (pinned to 99b85026db)