{"record":{"id":"f922f75f855c9595","repo":"SonarSource/sonarqube","slug":"unsupported-in-cluster-mode","errorCode":null,"errorMessage":"Unsupported in cluster mode","messagePattern":"Unsupported in cluster mode","errorType":"http","errorClass":"ServerException","httpStatus":501,"severity":"error","filePath":"server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/system/controller/HealthController.java","lineNumber":75,"sourceCode":"    this.healthChecker = healthChecker;\n    this.systemPasscode = systemPasscode;\n    this.nodeInformation = nodeInformation;\n    this.userSession = userSession;\n  }\n\n  @GetMapping\n  public Health getHealth(@RequestHeader(value = \"X-Sonar-Passcode\", required = false) String requestPassCode) {\n    if (systemPasscode.isValidPasscode(requestPassCode) || isSystemAdmin()) {\n      return getHealth();\n    }\n    throw new ForbiddenException(\"Insufficient privileges\");\n  }\n\n  private Health getHealth() {\n    if (nodeInformation == null || nodeInformation.isStandalone()) {\n      return healthChecker.checkNode();\n    }\n    throw new ServerException(HTTP_NOT_IMPLEMENTED, \"Unsupported in cluster mode\");\n  }\n\n  private boolean isSystemAdmin() {\n    if (userSession == null) {\n      return false;\n    }\n    return userSession.isSystemAdministrator();\n  }\n}\n","sourceCodeStart":57,"sourceCodeEnd":85,"githubUrl":"https://github.com/SonarSource/sonarqube/blob/184c821202192afc1c599fc912d0889b69fffa53/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/system/controller/HealthController.java#L57-L85","documentation":"ServerException with HTTP 501 thrown by HealthController's private getHealth() when the node is part of a cluster (nodeInformation is present and not standalone). The v2 system health endpoint only supports standalone SonarQube instances; cluster health must be obtained elsewhere.","triggerScenarios":"Calling GET /api/v2/system/health with valid authorization on an Application/Cluster (Data Center Edition) node.","commonSituations":"Same monitoring scripts used against both standalone and DCE installations; DCE customers expecting the standalone health API to work on cluster nodes.","solutions":["Use the cluster-appropriate health endpoint (e.g. api/system/health on the app node or the cluster health API) instead","Run the call against a standalone node if that's the intent","Check nodeInformation configuration to confirm deployment mode"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// call cluster health instead when on DCE\n// app nodes: GET api/system/health ; compute cluster health from node statuses","typeGuard":null,"tryCatchPattern":"try {\n    health = api.v2SystemHealth(passcode);\n} catch (ServerErrorException e) {\n    if (e.getResponse().getStatus() == 501) {\n        health = clusterHealthApi.get(); // fallback for DCE\n    }\n}","preventionTips":["Detect deployment mode (standalone vs DCE) before choosing the health endpoint","Use the DCE cluster health API for cluster installations","Don't reuse standalone monitoring scripts unchanged on DCE"],"tags":["java","cluster","http-501"],"backgroundTag":"unsupported-operation","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"}