{"record":{"id":"3a9a6ed45171b539","repo":"SonarSource/sonarqube","slug":"unsupported-workerspausestatus-status","errorCode":null,"errorMessage":"Unsupported WorkersPauseStatus: ${status}","messagePattern":"Unsupported WorkersPauseStatus: (.+?)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":500,"severity":"error","filePath":"server/sonar-webserver-webapi/src/main/java/org/sonar/server/ce/ws/InfoAction.java","lineNumber":77,"sourceCode":"      throw AbstractUserSession.insufficientPrivilegesException();\n    }\n\n    Ce.InfoWsResponse.Builder builder = Ce.InfoWsResponse.newBuilder();\n    CeQueue.WorkersPauseStatus status = ceQueue.getWorkersPauseStatus();\n    builder.setWorkersPauseStatus(convert(status));\n    WsUtils.writeProtobuf(builder.build(), request, response);\n  }\n\n  private static Ce.WorkersPauseStatus convert(CeQueue.WorkersPauseStatus status) {\n    switch (status) {\n      case PAUSING:\n        return Ce.WorkersPauseStatus.PAUSING;\n      case PAUSED:\n        return Ce.WorkersPauseStatus.PAUSED;\n      case RESUMED:\n        return Ce.WorkersPauseStatus.RESUMED;\n      default:\n        throw new IllegalStateException(\"Unsupported WorkersPauseStatus: \" + status);\n    }\n  }\n}\n","sourceCodeStart":59,"sourceCodeEnd":81,"githubUrl":"https://github.com/SonarSource/sonarqube/blob/184c821202192afc1c599fc912d0889b69fffa53/server/sonar-webserver-webapi/src/main/java/org/sonar/server/ce/ws/InfoAction.java#L59-L81","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","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"],"exampleFix":"// before\ndefault: throw new IllegalStateException(\"Unsupported WorkersPauseStatus: \" + status);\n// after\ncase UNKNOWN: return Ce.WorkersPauseStatus.UNKNOWN; // add mapping for new enum value","handlingStrategy":"try-catch","validationCode":"String status = ceInfo.rawPauseStatus();\nif (status == null || !Set.of(\"NONE\",\"PAUSED\",\"PAUSING\",\"RESUMED\").contains(status)) refreshOrUpgradeNode();","typeGuard":null,"tryCatchPattern":"try { GET api/ce/info } catch (ServerException e) if (e.message.contains(\"WorkersPauseStatus\")) { alignClusterVersions(); }","preventionTips":["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"],"tags":["java","sonarqube","enum","protobuf"],"backgroundTag":"invalid-enum-value","analyzedSha":"184c821202192afc1c599fc912d0889b69fffa53","analyzedAt":"2026-09-09T12:23:51.573Z","contentChangedAt":"2026-09-09T12:23:51.573Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}