6.7.6 to 7.9.1 Upgrade is failing

Hi,
I am upgrading from v6.7.6 SonarQube to v7.9.1 SonarQube. The system resides on SQL Server 2016 SP2. The application tier sits on Windows Server 2016. As part of the upgrade of went from OpenJDK 8u212 to OpenJDK 11.0.4. I have followed the upgrade instructions, I believe, explicitly that are found at: https://docs.sonarqube.org/latest/setup/upgrading. I have transferred my properties from the old properties file to the new one in the v7.9.1 conf folder. I have unzipped the SonarQube v7.9.1 right alongside my v6.7.6 in c:\program files\sonarqube. So now to the two problems I am facing:

  1. When I ran the step “startsonar.bat” it ran nicely until it gave me the following message:

PS C:\Program Files\SonarQube\sonarqube-7.9.1\bin\windows-x86-64> .\StartSonar.bat
wrapper | --> Wrapper Started as Console
wrapper | Launching a JVM…
jvm 1 | Wrapper (Version 3.2.3)
jvm 1 | Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.
jvm 1 |
jvm 1 | 2019.08.28 17:50:24 INFO app[o.s.a.AppFileSystem] Cleaning or creating temp directory e:\SonarQube\temp
jvm 1 | 2019.08.28 17:50:24 INFO app[o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
jvm 1 | 2019.08.28 17:50:24 INFO app[o.s.a.ProcessLauncherImpl] Deleting outdated search index data directory e:\SonarQube\data\es5
jvm 1 | 2019.08.28 17:50:24 INFO app[o.s.a.ProcessLauncherImpl] Launch process[[key=‘es’, ipcIndex=1, logFilenamePrefix=es]] from [C:\Program Files\SonarQube\sonarqube-7.9.1\e
lasticsearch]: C:\Program Files\Java\openjdk-11u-11.0.4_11\bin\java -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -Des.networkaddr
ess.cache.ttl=60 -Des.networkaddress.cache.negative.ttl=10 -XX:+AlwaysPreTouch -Xss1m -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djna.nosys=true -XX:-OmitStackTraceInFastThrow
-Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true -Dio.netty.recycler.maxCapacityPerThread=0 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -Djava.io.tmpdir
=e:\SonarQube\temp -XX:ErrorFile=…/logs/es_hs_err_pid%p.log -Des.enforce.bootstrap.checks=true -Xms512m -Xmx512m -XX:+HeapDumpOnOutOfMemoryError -Delasticsearch -Des.path.home=C:\P
rogram Files\SonarQube\sonarqube-7.9.1\elasticsearch -Des.path.conf=e:\SonarQube\temp\conf\es -cp lib/* org.elasticsearch.bootstrap.Elasticsearch
jvm 1 | OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
jvm 1 | 2019.08.28 17:50:25 INFO app[o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
jvm 1 | 2019.08.28 17:50:26 INFO app[o.e.p.PluginsService] no modules loaded
jvm 1 | 2019.08.28 17:50:26 INFO app[o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
jvm 1 | 2019.08.28 17:50:44 INFO app[o.s.a.SchedulerImpl] Process[es] is up
jvm 1 | 2019.08.28 17:50:45 INFO app[o.s.a.ProcessLauncherImpl] Launch process[[key=‘web’, ipcIndex=2, logFilenamePrefix=web]] from [C:\Program Files\SonarQube\sonarqube-7.9.1
]: C:\Program Files\Java\openjdk-11u-11.0.4_11\bin\java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=e:\SonarQube\temp --add-opens=java.base/java.util=ALL-UNNAMED
–add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemor
yError -Dhttp.proxyHost=usproxy.na.bestbuy.com -Dhttp.proxyPort=8080 -Dhttp.nonProxyHosts=localhost|127.|[::1] -Dhttps.proxyHost=[proxy link that I removed as was not useful to resolving this issue and I had more than 6 links in this post so I needed to cut out some links to get below my limit] -Dhttps.proxyPort=8080 -cp .
/lib/common/
;C:\Program Files\SonarQube\sonarqube-7.9.1\lib\jdbc\mssql\mssql-jdbc-7.2.2.jre11.jar org.sonar.server.app.WebServer e:\SonarQube\temp\sq-process11080886684872660870pro
perties
jvm 1 | 2019.08.28 17:50:54 WARN app[startup]
jvm 1 | ################################################################################
jvm 1 | The database must be manually upgraded. Please backup the database and browse /setup. For more information: https://docs.sonarqube.org/latest/setup/upgrading
jvm 1 | ################################################################################

Upon receiving this message, I checked my SonarQube web.log and found the following:

2019.08.28 17:48:12 INFO web[o.s.p.StopWatcher] Stopping process
2019.08.28 17:50:46 INFO web[o.s.p.ProcessEntryPoint] Starting web
2019.08.28 17:50:47 INFO web[o.a.t.u.n.NioSelectorPool] Using a shared selector for servlet write/read
2019.08.28 17:50:49 INFO web[o.e.p.PluginsService] no modules loaded
2019.08.28 17:50:49 INFO web[o.e.p.PluginsService] loaded plugin [org.elasticsearch.join.ParentJoinPlugin]
2019.08.28 17:50:49 INFO web[o.e.p.PluginsService] loaded plugin [org.elasticsearch.percolator.PercolatorPlugin]
2019.08.28 17:50:49 INFO web[o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2019.08.28 17:50:50 INFO web[o.s.s.e.EsClientProvider] Connected to local Elasticsearch: [127.0.0.1:9001]
2019.08.28 17:50:50 INFO web[o.s.s.p.LogServerVersion] SonarQube Server / 7.9.1.27448 / e0c45c97bb2e45d52629f3422ac91718020f6db9
2019.08.28 17:50:50 INFO web[o.sonar.db.Database] Create JDBC data source for jdbc:sqlserver://dtw01etsdb01c\dt01ets01;databaseName=Sonar;integratedSecurity=true
2019.08.28 17:50:53 INFO web[o.s.s.p.ServerFileSystemImpl] SonarQube home: C:\Program Files\SonarQube\sonarqube-7.9.1
2019.08.28 17:50:53 INFO web[o.s.s.u.SystemPasscodeImpl] System authentication by passcode is disabled
2019.08.28 17:50:54 WARN web[o.s.s.p.DatabaseServerCompatibility] The database must be manually upgraded. Please backup the database and browse /setup. For more information: https://docs.sonarqube.org/latest/setup/upgrading
2019.08.28 17:50:56 INFO web[o.s.s.p.ServerPluginRepository] Deploy plugin Git / 1.8.0.1574 / aec3dc8f5228aabd218e1cd31ac6e6515a43715d
2019.08.28 17:50:56 INFO web[o.s.s.p.ServerPluginRepository] Deploy plugin GitHub Authentication for SonarQube / 1.5.0.870 / 153f7c7af7a264adb0fcbe5fee87bdd140a6a3a1
2019.08.28 17:50:56 INFO web[o.s.s.p.ServerPluginRepository] Deploy plugin JaCoCo / 1.0.2.475 / b79a4724f3a9af1051266b4f8ca0460977295ead
2019.08.28 17:50:56 INFO web[o.s.s.p.ServerPluginRepository] Deploy plugin LDAP / 2.2.0.608 / 79dc3fa4393a29667673c70182f3016288b548b7
2019.08.28 17:50:56 INFO web[o.s.s.p.ServerPluginRepository] Deploy plugin SAML 2.0 Authentication for SonarQube / 1.1.0.181 / 16fcb5be2d3bcfee8920b29cd758d8b957a18acb
2019.08.28 17:50:56 INFO web[o.s.s.p.ServerPluginRepository] Deploy plugin SonarC# / 7.15.0.8572 / e0ad49e38a28a8fc333ba746fc998e48678f6a8b
2019.08.28 17:50:56 INFO web[o.s.s.p.ServerPluginRepository] Deploy plugin SonarCSS / 1.1.1.1010 / 365e21fd0cb9035669fc59f6fec7c8fd28a7303b
2019.08.28 17:50:56 INFO web[o.s.s.p.ServerPluginRepository] Deploy plugin SonarFlex / 2.5.1.1831 / a0c44437f6abb0feec76edd073f91fec64db2a6c
2019.08.28 17:50:56 INFO web[o.s.s.p.ServerPluginRepository] Deploy plugin SonarGo / 1.1.1.2000 / 40d55921c7a63b67386a053490d17b6723a46cd5
2019.08.28 17:50:56 INFO web[o.s.s.p.ServerPluginRepository] Deploy plugin SonarHTML / 3.1.0.1615 / 4181edb5eff5605bec82dc0aa15ecd70eaa5857f
2019.08.28 17:50:56 INFO web[o.s.s.p.ServerPluginRepository] Deploy plugin SonarJS / 5.2.1.7778 / 49f34eaeaad59868d4353d89b1fc5c02bbe51976
2019.08.28 17:50:56 INFO web[o.s.s.p.ServerPluginRepository] Deploy plugin SonarJava / 5.13.1.18282 / 568f8ed2349f48e250a9329895b9a870100dfbeb
2019.08.28 17:50:56 INFO web[o.s.s.p.ServerPluginRepository] Deploy plugin SonarKotlin / 1.5.0.315 / 4ff3a145a58f3f84f1b39846a205a129d742e993
2019.08.28 17:50:56 INFO web[o.s.s.p.ServerPluginRepository] Deploy plugin SonarPHP / 3.2.0.4868 / ec66bd5f8490677eb0ebae82aa17c2a5d9c0e5e7
2019.08.28 17:50:56 INFO web[o.s.s.p.ServerPluginRepository] Deploy plugin SonarPython / 1.14.1.3143 / eed7b315b6116fe462a19c771013bf3891c92a97
2019.08.28 17:50:56 INFO web[o.s.s.p.ServerPluginRepository] Deploy plugin SonarRuby / 1.5.0.315 / 4ff3a145a58f3f84f1b39846a205a129d742e993
2019.08.28 17:50:56 INFO web[o.s.s.p.ServerPluginRepository] Deploy plugin SonarScala / 1.5.0.315 / 4ff3a145a58f3f84f1b39846a205a129d742e993
2019.08.28 17:50:56 INFO web[o.s.s.p.ServerPluginRepository] Deploy plugin SonarTS / 1.9.0.3766 / 4a4080b78001a78d758d1d0fa0190fb9496b6f57
2019.08.28 17:50:56 INFO web[o.s.s.p.ServerPluginRepository] Deploy plugin SonarVB / 7.15.0.8572 / e0ad49e38a28a8fc333ba746fc998e48678f6a8b
2019.08.28 17:50:56 INFO web[o.s.s.p.ServerPluginRepository] Deploy plugin SonarXML / 2.0.1.2020 / c5b84004face582d56f110e24c29bf9c6a679e69
2019.08.28 17:50:56 INFO web[o.s.s.p.ServerPluginRepository] Deploy plugin Svn / 1.9.0.1295 / 942e075773975354e32691a60bfd968065703e04
2019.08.28 17:50:59 INFO web[o.s.s.p.d.m.c.MssqlCharsetHandler] Verify that database collation is case-sensitive and accent-sensitive
2019.08.28 17:51:00 INFO web[o.s.s.p.Platform] Database needs to be migrated. Please refer to https://docs.sonarqube.org/latest/setup/upgrading
2019.08.28 17:51:00 INFO web[o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.ws.WebServiceFilter@7cec7ef7 [pattern=UrlPattern{inclusions=[/api/system/migrate_db., …], exclusions=[/api/properties, …]}]
2019.08.28 17:51:00 INFO web[o.s.s.a.EmbeddedTomcat] HTTP connector enabled on port 9000

As can be seen (I have highlighted the error messages that are relevant), my message is recreated in the logs along with another message:

Database needs to be migrated. Please refer to: Latest Upgrade Document.

Now this was the page I was originally working from and I did follow the suggestion of even rebuilding indexes and refreshing my statistics. So after searching high and low, I can find nothing referring to what or how I need to migrate my database, let alone even the mention beforehand that I would need to do this. Am I missing some documentation somewhere on something that I need to do to the database?

  1. The final problem I am having, is that I could not get this up and running, so I had to restart my old v6.7.6 instance. So I did the following steps:
  • Executed startsonar.bat. This worked as expected and started up my JVM for SonarQube v6.7.6
  • I then killed StartSonar.bat.
  • I then went to go back and continue running my Windows Service that I used to have running for v6.7.6. So I executed InstallNTService.bat. This completed successfully.
  • I then executed StartNTService.bat and this failed with the following message:

C:\Program Files\SonarQube\sonarqube-6.7.6\bin\windows-x86-64>StartNTService.bat
wrapper | Starting the SonarQube service…
wrapper | The SonarQube service was launched, but failed to start.
Press any key to continue . . .

One thing to note here is that I ran my command line window as Administrator when I was performing these actions. There are no events or logs to go by in terms of what is the reason this Windows Service is not starting.

Any thoughts on the two issues I am having, I would really appreciate it. I have spent the past few days trying to resolve these errors. I even had another person do a clean install on Windows and Oracle DB for v7.9.1 and while he was able to get the install of the application completed, which I could not due to DB issues, his was a clean install, whereas mine was a upgrade and he also could not start the Windows Service which failed in exactly the same way as mine did.

Thanks for any help you can provide.

Anthony

p.s. We have scoured the forums for potential solutions, but we did not come across any that seemed to fit our problems.

Hi!

It’s everything already in your post :wink:

Following that link, you can see the upgrade steps:

(…)
4. Stop your old SonarQube Server
5. Start your new SonarQube Server
6. Browse to http://yourSonarQubeServerURL/setup and follow the setup instructions
7. Reanalyze your projects to get fresh data

You need to open http://yourSonarQubeServerURL/setup (e.g., http://localhost:9000/setup) and click on the Upgrade/Migrate/whatever button on the page.

Hi Felipe,

Thank you so much for highlighting that for me. I guess three of us pouring over these logs, we missed the “/setup” part of the URL and never even noticed it because we are so used to just typing in the Home URL for SonarQube. Thank you so much. Seems so dumb now that I look at it.

Secondly, any thoughts on why the Windows Service would not start?

Thanks again Felipe.

Anthony

About the other issue, I’ve just installed SonarQube as a service and "it works on my machine"™ :frowning:

I suppose the logs show why it’s failing to start as a service… Anything on web.log?

Hi Felipe,

Unfortunately it fails so quickly, I do not think it is even getting to the logs as there is nothing in them. I will try do the actual upgrade first and see if this resolve the Service issue, once it is completed. If not, at least I would have solved the main issue. … :grinning:

As I mentioned, another person did a clean install and that worked fine for him. However he also had the same issue with starting the Windows Service. So I am not sure if it is an internal issue.

If you have any debugging ideas, around the Windows Service, that would be great.

Thanks Felipe.

Anthony