| Previous | Next |
| ERROR_INVALID_RUNLEVEL_SETTING | ERROR_RUNLEVEL_SWITCH_AGENT_TIMEOUT |
ERROR_RUNLEVEL_SWITCH_TIMEOUT
Services exceeded the run-level switch deadline
ERROR_RUNLEVEL_SWITCH_TIMEOUT is Windows system result 15402 (0x00003C2A). One or more services failed to reach their requested state before the overall timeout.
ERROR_RUNLEVEL_SWITCH_TIMEOUT concerns service progress. The orchestrator needs the last checkpoint, wait hint, control request, and process state for each unfinished service rather than only the global elapsed time.
Where this value belongs
ERROR_RUNLEVEL_SWITCH_TIMEOUTcan be observed when a coordinated switch stops services before lowering the active level.ERROR_RUNLEVEL_SWITCH_TIMEOUTcan be observed when services are restarted while raising the level.ERROR_RUNLEVEL_SWITCH_TIMEOUTcan be observed when one service blocks in shutdown, initialization, or dependency cleanup.
A timeout does not prove that no service changed state. The transition may be partial, so automatic replay can issue duplicate controls or start services in the wrong order.
Common interpretation mistakes
ERROR_RUNLEVEL_SWITCH_TIMEOUTis mishandled when the global timeout is increased without diagnosing the stalled service.ERROR_RUNLEVEL_SWITCH_TIMEOUTis mishandled when checkpoint and wait-hint progress are not recorded.ERROR_RUNLEVEL_SWITCH_TIMEOUTis mishandled when a service process exits but its state remains pending.ERROR_RUNLEVEL_SWITCH_TIMEOUTis mishandled when partial completion is ignored before retry.
Diagnostic sequence
- Capture the deadline and elapsed time.
- List every service still STOP_PENDING or START_PENDING.
- Record checkpoints, wait hints, process IDs, and last progress times.
- Collect a dump or stack from the first stalled service when safe.
- Check dependency cleanup and control-handler logs.
- Reconcile all service states before another switch.
Evidence worth keeping
- For
ERROR_RUNLEVEL_SWITCH_TIMEOUT, preserve transition deadline and elapsed time. - For
ERROR_RUNLEVEL_SWITCH_TIMEOUT, preserve unfinished services and requested states. - For
ERROR_RUNLEVEL_SWITCH_TIMEOUT, preserve checkpoints, wait hints, and process IDs. - For
ERROR_RUNLEVEL_SWITCH_TIMEOUT, preserve service control and application logs. - For
ERROR_RUNLEVEL_SWITCH_TIMEOUT, preserve dump or trace of the first stalled process.
For ERROR_RUNLEVEL_SWITCH_TIMEOUT, a per-service progress timeline distinguishes a genuinely slow operation from a deadlocked or unresponsive service.
Correct handling and recovery
Fix the blocking service, dependency, or control-handler path and choose a timeout based on measured supported behavior.
Retry after the stalled service is repaired and partial state is reconciled. Increasing the deadline alone is justified only when evidence shows steady progress.
Difference from nearby values
ERROR_RUNLEVEL_SWITCH_AGENT_TIMEOUT is about an orchestration agent that did not answer. Code 15402 is about services that did not stop or restart within the switch deadline.
Practical scenario
A database service remains STOP_PENDING with an unchanged checkpoint while flushing a corrupted log. The orchestrator returns 15402; a service dump identifies the blocked flush, which is repaired before the switch is resumed.
Implementation guidance
Track progress per service and escalate an unchanged checkpoint earlier than the global deadline. Service authors should implement bounded control handlers and accurate wait hints.
For code 15402, record runlevel_timeout_service, runlevel_timeout_checkpoint, runlevel_timeout_wait_hint, runlevel_timeout_pid, and runlevel_timeout_elapsed_ms.
References
- Microsoft: System Error Codes 12000–15999 — official Microsoft documentation relevant to
ERROR_RUNLEVEL_SWITCH_TIMEOUT. - Microsoft: sc.exe config — official Microsoft documentation relevant to
ERROR_RUNLEVEL_SWITCH_TIMEOUT. - Microsoft: QueryServiceStatusEx — official Microsoft documentation relevant to
ERROR_RUNLEVEL_SWITCH_TIMEOUT. - Microsoft: Service status transitions — official Microsoft documentation relevant to
ERROR_RUNLEVEL_SWITCH_TIMEOUT.
Looking for a different code? Search another status or error code.