SonarSource/sonarqube · warning

Server ID is reset because it is not valid anymore…

Error message

Server ID is reset because it is not valid anymore. Database URL probably changed. The new server ID affects SonarSource licensed products.

What it means

ServerIdManager keeps a server ID whose checksum must match a checksum computed from the server ID (which encodes the DB connection URL). When the stored checksum does not match the recomputed one, SonarQube logs this warning and resets (regenerates) the server ID, because the ID is tied to the database URL and its stored validation no longer holds.

Solutions

  1. If the DB URL change was intended, accept the reset: note that the new server ID requires re-entering license keys for commercial plugins.
  2. If unintended, restore the original database URL and confirm jdbc url in sonar.properties matches the DB the checksum was generated against.
  3. Re-apply product licenses after the reset (new server ID).
  4. Avoid copying databases between environments without expecting a server-ID reset.

Example fix

// before: sonar.properties pointing to a different DB than the one the server ID was created with
sonar.jdbc.url=jdbc:postgresql://newdb:5432/sonar
// after: restore original URL (or accept license re-entry after reset)
sonar.jdbc.url=jdbc:postgresql://originaldb:5432/sonar
Defensive patterns

Strategy: validation

Validate before calling

-- verify checksum consistency before upgrade/migration
SELECT * FROM internal_properties WHERE kee LIKE 'serverId%';
-- recompute expected checksum from the current JDBC URL and compare

Prevention

When it happens

Trigger: Calling keepOrReplaceCurrentServerId -> keepServerId when a checksum is present but serverIdChecksum.computeFor(serverId.toString()) differs from the stored checksum — typically after the database URL changed or the checksum row was tampered with/restored inconsistently.

Common situations: Migrating SonarQube to a different database (or restored DB copy from another instance/URL); DB host, port, or schema name changed; copying a production DB into a test environment; manually editing the sonar.server_id / internal property rows.

Understand the failure class

Background: Checksum mismatch errors: "checksum verification failed", "digest mismatch", "expected vs actual checksum" — what they mean and how to fix them — this error's family across 41 libraries.

Related errors


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

Appendix: source

Thrown at server/sonar-webserver-core/src/main/java/org/sonar/server/platform/serverid/ServerIdManager.java:91

      }
    }
  }

  private ServerId keepOrReplaceCurrentServerId(DbSession dbSession, ServerId currentServerId, Optional<String> checksum) {
    if (keepServerId(currentServerId, checksum)) {
      return currentServerId;
    }

    ServerId serverId = replaceCurrentServerId(currentServerId);
    persistServerId(dbSession, serverId);
    return serverId;
  }

  private boolean keepServerId(ServerId serverId, Optional<String> checksum) {
    if (checksum.isPresent()) {
      String expectedChecksum = serverIdChecksum.computeFor(serverId.toString());
      if (!expectedChecksum.equals(checksum.get())) {
        LOGGER.warn("Server ID is reset because it is not valid anymore. Database URL probably changed. The new server ID affects SonarSource licensed products.");
        return false;
      }
    }

    // Existing server ID must be kept when upgrading to 6.7+. In that case the checksum does not exist.
    return true;
  }

  private ServerId replaceCurrentServerId(ServerId currentServerId) {
    return serverIdFactory.create(currentServerId);
  }

  private ServerId createFirstServerId(DbSession dbSession) {
    ServerId serverId = serverIdFactory.create();
    persistServerId(dbSession, serverId);
    return serverId;
  }

View on GitHub (pinned to 184c821202)