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

  1. Upgrade all app nodes (web/CE) to the same SonarQube version
  2. 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
  3. Report a bug if a valid new status is unhandled — the mapping needs a case
  4. 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

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


AI-assisted analysis of SonarSource/sonarqube@184c821202 (2026-09-09). Data as JSON: /api/errors/3a9a6ed45171b539. Report an issue: GitHub.