| Previous | Next |
| ERROR_GPIO_INTERRUPT_ALREADY_UNMASKED | ERROR_INVALID_RUNLEVEL_SETTING |
ERROR_CANNOT_SWITCH_RUNLEVEL
Requested service run-level switch cannot complete
ERROR_CANNOT_SWITCH_RUNLEVEL is Windows system result 15400 (0x00003C28). The orchestrator could not construct or execute a valid transition to the target level.
ERROR_CANNOT_SWITCH_RUNLEVEL is an overall transition failure. It can result from dependency blockers, unsupported target state, service failures, or an unreconciled previous transition, so the first component-specific status is essential.
Where this value belongs
ERROR_CANNOT_SWITCH_RUNLEVELcan be observed when a system component coordinates an ordered group of service changes.ERROR_CANNOT_SWITCH_RUNLEVELcan be observed when a management tool requests a platform mode transition.ERROR_CANNOT_SWITCH_RUNLEVELcan be observed when a translated orchestration result reaches a Win32 status field.
The code does not identify one service by itself. Diagnosis begins with the transition plan, target level, and earliest service or agent that rejected the plan.
Common interpretation mistakes
ERROR_CANNOT_SWITCH_RUNLEVELis mishandled when the global code is logged without the first blocking service.ERROR_CANNOT_SWITCH_RUNLEVELis mishandled when the entire switch is retried while partial state is unknown.ERROR_CANNOT_SWITCH_RUNLEVELis mishandled when dependency order is reconstructed after services have already changed.ERROR_CANNOT_SWITCH_RUNLEVELis mishandled when an unsupported target level is treated as a timeout.
Diagnostic sequence
- Capture current level, target level, and transition ID.
- Persist the planned service order before execution.
- Find the earliest rejected or failed transition step.
- Query actual service states after the failure.
- Compare dependencies and load-order groups with the plan.
- Choose resume, rollback, or a fresh switch only after reconciliation.
Evidence worth keeping
- For
ERROR_CANNOT_SWITCH_RUNLEVEL, preserve transition plan and requested target. - For
ERROR_CANNOT_SWITCH_RUNLEVEL, preserve first blocking service or agent. - For
ERROR_CANNOT_SWITCH_RUNLEVEL, preserve service states before and after failure. - For
ERROR_CANNOT_SWITCH_RUNLEVEL, preserve dependency graph and load-order groups. - For
ERROR_CANNOT_SWITCH_RUNLEVEL, preserve rollback or reconciliation result.
For ERROR_CANNOT_SWITCH_RUNLEVEL, the global status should always be paired with the earliest component result; otherwise several unrelated failures look identical.
Correct handling and recovery
Correct the demonstrated blocker, reconcile partial service state, and submit a supported transition from the verified current level.
Do not blindly replay the full switch. A new attempt is safe only after ownership and current service states are known.
Difference from nearby values
ERROR_INVALID_RUNLEVEL_SETTING identifies invalid configuration. ERROR_CANNOT_SWITCH_RUNLEVEL can also arise from runtime blockers even when configuration is valid.
Practical scenario
A transition plan is valid, but a critical service rejects its stop request. The orchestrator records that service status, leaves the system at the current level, and retries only after the service defect is corrected.
Implementation guidance
Orchestrators need durable transition IDs, per-step outcomes, and explicit rollback policy. Administrators should fix the first blocker instead of treating code 15400 as a generic reboot request.
For code 15400, record runlevel_from, runlevel_to, runlevel_transition_id, runlevel_first_blocker, and runlevel_reconciled_state.
References
- Microsoft: System Error Codes 12000–15999 — official Microsoft documentation relevant to
ERROR_CANNOT_SWITCH_RUNLEVEL. - Microsoft: sc.exe config — official Microsoft documentation relevant to
ERROR_CANNOT_SWITCH_RUNLEVEL. - Microsoft: QueryServiceStatusEx — official Microsoft documentation relevant to
ERROR_CANNOT_SWITCH_RUNLEVEL.
Looking for a different code? Search another status or error code.