{"record":{"id":"5e87255983153fdb","repo":"SonarSource/sonarqube","slug":"the-local-version-s-is-not-the-same-as-the-cluste","errorCode":null,"errorMessage":"The local version %s is not the same as the cluster %s","messagePattern":"The local version (.+?) is not the same as the cluster (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"server/sonar-main/src/main/java/org/sonar/application/cluster/ClusterAppStateImpl.java","lineNumber":164,"sourceCode":"  private void tryToReleaseWebLeaderLock(UUID uuidOfLeader) {\n    DistributedReference<UUID> leader = hzMember.getAtomicReference(LEADER);\n    leader.compareAndSet(uuidOfLeader, null);\n  }\n\n  @Override\n  public void reset() {\n    throw new IllegalStateException(\"state reset is not supported in cluster mode\");\n  }\n\n  @Override\n  public void registerSonarQubeVersion(String sonarqubeVersion) {\n    DistributedReference<String> sqVersion = hzMember.getAtomicReference(SONARQUBE_VERSION);\n    boolean wasSet = sqVersion.compareAndSet(null, sonarqubeVersion);\n\n    if (!wasSet) {\n      String clusterVersion = sqVersion.get();\n      if (!sqVersion.get().equals(sonarqubeVersion)) {\n        throw new IllegalStateException(\n          format(\"The local version %s is not the same as the cluster %s\", sonarqubeVersion, clusterVersion));\n      }\n    }\n  }\n\n  @Override\n  public void registerClusterName(String clusterName) {\n    DistributedReference<String> property = hzMember.getAtomicReference(CLUSTER_NAME);\n    boolean wasSet = property.compareAndSet(null, clusterName);\n\n    if (!wasSet) {\n      String clusterValue = property.get();\n      if (!property.get().equals(clusterName)) {\n        throw new MessageException(\n          format(\"This node has a cluster name [%s], which does not match [%s] from the cluster\", clusterName, clusterValue));\n      }\n    }\n  }","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/SonarSource/sonarqube/blob/184c821202192afc1c599fc912d0889b69fffa53/server/sonar-main/src/main/java/org/sonar/application/cluster/ClusterAppStateImpl.java#L146-L182","documentation":"When a cluster node registers its SonarQube version, the first member sets the version in a Hazelcast atomic reference; later members must match it. If the reference is already set and the local version differs from the cluster value, registration fails with IllegalStateException, because mixed-version cluster members are not supported.","triggerScenarios":"Starting a node with a different sonarqubeVersion than the one already registered by other cluster members, typically while a rolling upgrade is in progress or one node was not upgraded.","commonSituations":"Rolling upgrades where some members still run the old SonarQube version, nodes pulled from different Docker image tags in the same cluster, or a node restarting against a cluster upgraded while it was down.","solutions":["Upgrade or downgrade the node so its SonarQube version exactly matches the rest of the cluster","Pin all cluster members to the same release (same Docker tag / same artifact) before restarting","Follow the official rolling-upgrade sequence: upgrade, restart and verify all nodes one at a time with identical versions","Check the currently registered cluster version in logs and align the failing node's deployment to it"],"exampleFix":"// before (docker-compose, mixed tags)\nimage: sonarqube:9.9-community  # node A\nimage: sonarqube:10.3-community # node B -> error\n// after\nimage: sonarqube:10.3-community # all nodes identical","handlingStrategy":"validation","validationCode":"String expected = \"10.3\";\nString running = detectDeployedSonarVersion(); // from image/artifact metadata\nif (!expected.equals(running)) {\n  throw new IllegalStateException(\"node version \" + running + \" != cluster version \" + expected);\n}","typeGuard":null,"tryCatchPattern":"try {\n  node.start();\n} catch (IllegalStateException e) {\n  if (e.getMessage().startsWith(\"The local version\")) {\n    log.error(\"Version mismatch in cluster; align all nodes to the same release\", e);\n  }\n}","preventionTips":["Pin every cluster member to the identical SonarQube version/image tag","Perform rolling upgrades one node at a time, verifying each before the next","Automate config/image drift detection across cluster members"],"tags":["java","cluster","version-mismatch"],"backgroundTag":"conflicting-config-options","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"}