SonarQube hosted on Azure serveId keeps getting reset almost everyday

  • Version: SonarQube 10-developer image version
  • how is SonarQube deployed: Docker image hosted to Web App with azure sql database server via Azure Bicep
  • what are you trying to achieve: make sure server id stays the same
  • what have you tried so far to achieve this: checking sonarqube web instance app configuration, check database audit logs to see if someone changed the resource

Issues:
We used to run SonarQube 8.9 developer for a long. Quite stable. Monday this week I upgraded the docker image version to 10-developer. After that, the server ID got reset. The first time might make sense. However, this week Thursday and now Friday, the server id gets reset again without any changes from our infrastructure side.

During the upgrade, what I have done was only changing the image version from 8.9-developer to 10-developer for a more powerful version.

However, because of server id keeps changing, I need to reconfigure each time the service connection, regenerate PAT, user permissions, etc.,

Please give insights of what would be the cause. I attached the app configuration in case you find any related causes.

resource sonarqubeAppConfig 'Microsoft.Web/sites/config@2021-02-01' = {
  name: 'appsettings'
  parent: sonarquebeAppService
  properties: {
    'SONARQUBE_JDBC_USERNAME':'${sqlServerAdministratorUsername}'
    'SONARQUBE_JDBC_PASSWORD': '@Microsoft.KeyVault(VaultName=${keyVaultName};SecretName=SonarQube-Sql-Admin-Password)'
    'sonar.path.data':'/home/sonarqube/data'
    'SONAR_SEARCH_JAVAADDITIONALOPTS': '-Dnode.store.allow_mmap=false'
    'SONARQUBE_JDBC_URL':   'jdbc:sqlserver://${sqlServerName}.database.windows.net;databaseName=${sqlDatabaseName};encrypt=true;trustServerCertificate=false;hostNameInCertificate=${sqlServerName}.database.windows.net;loginTimeout=30;'
  }
}
``

Hi team do you have an update on this ticket to share with us please?

This is the first time we performed an upgrade. The more I searched for in sonarqube community, the more customers having the same troubles.

Server ID changed on upgrade? - SonarQube - Sonar Community (sonarsource.com)

Will the Server ID change if I move SonarQube to a new host/instance? - SonarQube - Sonar Community (sonarsource.com)

In our case, the bicep deployment should not create a new db since it performs as add or update. The URL has not been touched. It is a mystery why the serverID had been refreshed. Anything you logged that could trigger serverID refresh? If so, I can monitor the logs.

Hey @LWEN

This is a community forum, not a Service Desk. Feel free to review this section of our FAQ.

If all you’re changing is the image being used (and none of the other configuration), you may have missed that the environment variables prefixed with SONARQUBE_ no longer work (and your instance is probably falling back on the internal H2 database). This is noted in this upgrade note:

Release 9.9 upgrade notes

Docker images updated

  • The deprecated SONARQUBE_JDBC_USERNAME, SONARQUBE_JDBC_PASSWORD, and SONARQUBE_JDBC_URL variables have been removed. See Environment variables for up-to-date configuration variables.

You will need to use SONAR_JDBC_USERNAME, SONAR_JDBC_URL, AND SONAR_JDBC_PASSWORD instead.

Also keep in mind that to perform an upgrade from 8.9 to 10.2, you’ll have to make a stop at 9.9.

hi Colin,

Thanks for your reply and the tip. I will check out the environment variables.

One question about making a stop at 9.9. Why that is needed before going to v10?

It’s necessary to stop at intermediate LTS versions, as once the major version ticks over, the database migrations are no longer included for previous versions.

Thanks.

After I stop at 9.9 and upgrade to 10, I keep getting this message. Didn’t find any clue why.

Time for Step 6 of the Upgrade Guide:

  1. Browse to http://yourSonarQubeServerURL/setup and follow the setup instructions

You’ll also need to do this on 9.9 before going to 10.2.