SonarSource/sonarqube · error · IllegalStateException
Unsupported WorkersPauseStatus: ${status}
Error message
Unsupported WorkersPauseStatus: ${status} What it means
InfoAction.convert maps the internal WorkersPauseStatus enum (from the CE worker pause state) onto the protobuf enum Ce.WorkersPauseStatus for the api/ce/info response. A status value with no protobuf counterpart (unknown/new internal value, null) reaches the default branch and throws this IllegalStateException. It indicates an internal enum mismatch, typically after partial upgrades.
Source
Thrown at server/sonar-webserver-webapi/src/main/java/org/sonar/server/ce/ws/InfoAction.java:77
throw AbstractUserSession.insufficientPrivilegesException();
}
Ce.InfoWsResponse.Builder builder = Ce.InfoWsResponse.newBuilder();
CeQueue.WorkersPauseStatus status = ceQueue.getWorkersPauseStatus();
builder.setWorkersPauseStatus(convert(status));
WsUtils.writeProtobuf(builder.build(), request, response);
}
private static Ce.WorkersPauseStatus convert(CeQueue.WorkersPauseStatus status) {
switch (status) {
case PAUSING:
return Ce.WorkersPauseStatus.PAUSING;
case PAUSED:
return Ce.WorkersPauseStatus.PAUSED;
case RESUMED:
return Ce.WorkersPauseStatus.RESUMED;
default:
throw new IllegalStateException("Unsupported WorkersPauseStatus: " + status);
}
}
}
View on GitHub (pinned to 184c821202)
Solutions
- Upgrade all app nodes (web/CE) to the same SonarQube version
- Inspect the CE pause state (api/ce/info source data / internal table) and reset it, e.g. resume workers via api/ce/restart or clear stale config
- Report a bug if a valid new status is unhandled — the mapping needs a case
- Check server logs to identify the exact status string that hit default
Example fix
// before
default: throw new IllegalStateException("Unsupported WorkersPauseStatus: " + status);
// after
case UNKNOWN: return Ce.WorkersPauseStatus.UNKNOWN; // add mapping for new enum value Defensive patterns
Strategy: try-catch
Validate before calling
String status = ceInfo.rawPauseStatus();
if (status == null || !Set.of("NONE","PAUSED","PAUSING","RESUMED").contains(status)) refreshOrUpgradeNode(); Try / catch
try { GET api/ce/info } catch (ServerException e) if (e.message.contains("WorkersPauseStatus")) { alignClusterVersions(); } Prevention
- Run identical SonarQube versions on all web/CE nodes
- Reset stale CE pause state after upgrades
- Keep protobuf/model mappings in sync when adding enum values
When it happens
Trigger: GET api/ce/info when the pause status read from CE configuration is null or an internal enum constant that the switch does not handle (e.g. NONE/UNKNOWN after a version upgrade).
Common situations: SonarQube web and CE nodes running different versions sharing state; corrupt or missing pause-state entry in the CE config; new enum value added without updating this mapping.
Understand the failure class
Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.
Related errors
- Invalid message type:
- Unexpected message type:
- Fail to read locations from DB for issue %s
- Fail to read message formattings from DB for issue %s
- Invalid value for property %s: [%s], only [%s] are allowed
AI-assisted analysis of SonarSource/sonarqube@184c821202 (2026-09-09).
Data as JSON: /api/errors/3a9a6ed45171b539.
Report an issue: GitHub.