Upgrade to 9.2.3 failing for existing DB

Must-share information (formatted with Markdown):

  • which versions are you using - SonarQube
  • what are you trying to achieve - Upgrade to 9.2.3
  • what have you tried so far to achieve this - Went through the logs and spot checked the custom DB

We recently upgraded from 9.x.x to 9.2.3 after the Log4j and since then the server won’t start. We see a couple of errors in the logs constantly and that’s preventing the server from starting.

sonar.log

jvm 1    | 2021.12.16 19:42:42 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [C:\home\site\wwwroot\sonarqube-9.2.3.50713\elasticsearch]: C:\Program Files\Java\zulu11.48.21-jre11.0.11-win_x64\bin\java -XX:+UseG1GC -Djava.io.tmpdir=C:\home\site\wwwroot\sonarqube-9.2.3.50713\temp -XX:ErrorFile=../logs/es_hs_err_pid%p.log -Des.networkaddress.cache.ttl=60 -Des.networkaddress.cache.negative.ttl=10 -XX:+AlwaysPreTouch -Xss1m -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djna.nosys=true -Djna.tmpdir=C:\home\site\wwwroot\sonarqube-9.2.3.50713\temp -XX:-OmitStackTraceInFastThrow -Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true -Dio.netty.recycler.maxCapacityPerThread=0 -Dio.netty.allocator.numDirectArenas=0 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -Dlog4j2.formatMsgNoLookups=true -Djava.locale.providers=COMPAT -Dcom.redhat.fips=false -Des.enforce.bootstrap.checks=true -Xmx512m -Xms512m -XX:MaxDirectMemorySize=256m -XX:+HeapDumpOnOutOfMemoryError -Delasticsearch -Des.path.home=C:\home\site\wwwroot\sonarqube-9.2.3.50713\elasticsearch -Des.path.conf=C:\home\site\wwwroot\sonarqube-9.2.3.50713\temp\conf\es -cp lib/* org.elasticsearch.bootstrap.Elasticsearch
jvm 1    | 2021.12.16 19:42:42 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
jvm 1    | 2021.12.16 19:42:57 ERROR app[][o.s.a.p.EsManagedProcess] Failed to check status
jvm 1    | org.elasticsearch.ElasticsearchException: java.util.concurrent.ExecutionException: java.net.SocketException: Permission denied: no further information
jvm 1    | 	at org.elasticsearch.client.RestHighLevelClient.performClientRequest(RestHighLevelClient.java:2695)
jvm 1    | 	at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:2171)
jvm 1    | 	at org.elasticsearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:2137)
jvm 1    | 	at org.elasticsearch.client.RestHighLevelClient.performRequestAndParseEntity(RestHighLevelClient.java:2105)
jvm 1    | 	at org.elasticsearch.client.ClusterClient.health(ClusterClient.java:151)
jvm 1    | 	at org.sonar.application.es.EsConnectorImpl.getClusterHealthStatus(EsConnectorImpl.java:64)
jvm 1    | 	at org.sonar.application.process.EsManagedProcess.checkStatus(EsManagedProcess.java:97)
jvm 1    | 	at org.sonar.application.process.EsManagedProcess.checkOperational(EsManagedProcess.java:82)
jvm 1    | 	at org.sonar.application.process.EsManagedProcess.isOperational(EsManagedProcess.java:67)
jvm 1    | 	at org.sonar.application.process.ManagedProcessHandler.refreshState(ManagedProcessHandler.java:220)
jvm 1    | 	at org.sonar.application.process.ManagedProcessHandler$EventWatcher.run(ManagedProcessHandler.java:285)
jvm 1    | Caused by: java.util.concurrent.ExecutionException: java.net.SocketException: Permission denied: no further information
jvm 1    | 	at org.elasticsearch.common.util.concurrent.BaseFuture$Sync.getValue(BaseFuture.java:257)
jvm 1    | 	at org.elasticsearch.common.util.concurrent.BaseFuture$Sync.get(BaseFuture.java:244)
jvm 1    | 	at org.elasticsearch.common.util.concurrent.BaseFuture.get(BaseFuture.java:75)
jvm 1    | 	at org.elasticsearch.client.RestHighLevelClient.performClientRequest(RestHighLevelClient.java:2692)
jvm 1    | 	... 10 common frames omitted

web.log

2021.12.16 19:44:40 INFO  web[][o.s.p.ProcessEntryPoint] Starting web
2021.12.16 19:44:45 INFO  web[][o.a.t.u.n.NioSelectorPool] Using a shared selector for servlet write/read
2021.12.16 19:44:50 INFO  web[][o.s.s.e.EsClientProvider] Connected to local Elasticsearch: [http://127.0.0.1:9001]
2021.12.16 19:44:55 INFO  web[][o.s.s.p.LogServerVersion] SonarQube Server / 9.2.3.50713 / 1b1f8b8c104707c779f31658dccf9736f8a266c4
2021.12.16 19:44:55 INFO  web[][o.sonar.db.Database] Create JDBC data source for jdbc:sqlserver://eigdb.database.windows.net:1433;database=SonarQube;encrypt=true;
2021.12.16 19:45:08 INFO  web[][o.s.s.p.ServerFileSystemImpl] SonarQube home: C:\home\site\wwwroot\sonarqube-9.2.3.50713
2021.12.16 19:45:08 INFO  web[][o.s.s.u.SystemPasscodeImpl] System authentication by passcode is disabled
2021.12.16 19:45:11 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin C# Code Quality and Security / 8.32.0.39516 / 339a4abca54577c2331eb89f3ccecd43279fbd11
2021.12.16 19:45:11 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin Configuration detection fot Code Quality and Security / 1.1.0.185 / f880796141c97fa59ac04f8ac0db56c62d862005
2021.12.16 19:45:11 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin Flex Code Quality and Security / 2.6.2.2641 / 11f07506915923b3a0e39e4e34280644c035b925
2021.12.16 19:45:11 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin Go Code Quality and Security / 1.8.3.2219 / d6ad7a5a47fc4785d2e80918fb7424be46e38a7f
2021.12.16 19:45:11 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin HTML Code Quality and Security / 3.4.0.2754 / 38f7ff864ae15152c9f1efc3014594f7e7ca7b6e
2021.12.16 19:45:11 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin IaC Code Quality and Security / 1.4.0.1294 / d5088c9df33e24593acd39bac9306136176da598
2021.12.16 19:45:11 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin JaCoCo / 1.1.1.1157 / 83478572b9f23efac29de15e30c7758bbb0c0e47
2021.12.16 19:45:11 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin Java Code Quality and Security / 7.5.0.28054 / 54b377cfbc4b5d4f2780855818c6850c298ea395
2021.12.16 19:45:11 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin JavaScript/TypeScript Code Quality and Security / 8.6.0.16913 / 701a9ce4770cfe89eb0ac54c75eeafb2c8c514ac
2021.12.16 19:45:11 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin Kotlin Code Quality and Security / 2.7.0.948 / 9ab38bae2f6f59bd5ba6d3bed5a159d858b87daf
2021.12.16 19:45:11 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin PHP Code Quality and Security / 3.21.2.8292 / 86bd9dd559ac9a3a8dbabdf44d171395e7334590
2021.12.16 19:45:11 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin Python Code Quality and Security / 3.8.0.8883 / 30629fbf3e871f83899ec32d3e4a05988b3d4727
2021.12.16 19:45:11 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin Ruby Code Quality and Security / 1.8.3.2219 / d6ad7a5a47fc4785d2e80918fb7424be46e38a7f
2021.12.16 19:45:11 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin Scala Code Quality and Security / 1.8.3.2219 / d6ad7a5a47fc4785d2e80918fb7424be46e38a7f
2021.12.16 19:45:11 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin VB.NET Code Quality and Security / 8.32.0.39516 / 339a4abca54577c2331eb89f3ccecd43279fbd11
2021.12.16 19:45:11 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin XML Code Quality and Security / 2.4.0.3273 / 3e6d286309dbc9af364fc3c843ee8e71ed1801f7
2021.12.16 19:45:23 INFO  web[][o.s.s.p.d.m.c.MssqlCharsetHandler] Verify that database collation is case-sensitive and accent-sensitive
2021.12.16 19:45:24 WARN  web[][o.s.a.s.w.WebService$Action] The response example is not set on action api/system/liveness
2021.12.16 19:45:25 INFO  web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.platform.web.WebServiceFilter@2a0f8411 [pattern=UrlPattern{inclusions=[/api/system/migrate_db.*, ...], exclusions=[/api/components/update_key, ...]}]
2021.12.16 19:45:26 INFO  web[][o.s.s.p.DetectPluginChange] Detect plugin changes
2021.12.16 19:45:26 INFO  web[][o.s.s.a.EmbeddedTomcat] HTTP connector enabled on port 12569
2021.12.16 19:45:41 INFO  web[][o.s.s.p.UpdateCenterClient] Update center: https://update.sonarsource.org/update-center.properties (no proxy)
2021.12.16 19:45:51 INFO  web[][o.s.s.s.LogServerId] Server ID: 3F6FB356-AXqLSsZocvgxGkHsB_HW
2021.12.16 19:45:51 WARN  web[][o.s.s.a.LogOAuthWarning] For security reasons, OAuth authentication should use HTTPS. You should set the property 'Administration > Configuration > Server base URL' to a HTTPS URL.
2021.12.16 19:45:53 WARN  web[][o.s.a.s.w.WebService$Action] The response example is not set on action api/plugins/download
2021.12.16 19:45:53 WARN  web[][o.s.a.s.w.WebService$Action] The response example is not set on action api/system/liveness
2021.12.16 19:45:53 WARN  web[][o.s.a.s.w.WebService$Action] The response example is not set on action api/alm_integrations/list_bitbucketserver_projects
2021.12.16 19:45:53 WARN  web[][o.s.a.s.w.WebService$Action] The response example is not set on action api/alm_integrations/search_bitbucketcloud_repos
2021.12.16 19:45:53 WARN  web[][o.s.a.s.w.WebService$Action] The response example is not set on action api/alm_integrations/check_pat
2021.12.16 19:45:53 WARN  web[][o.s.a.s.w.WebService$Action] The response example is not set on action api/alm_integrations/list_azure_projects
2021.12.16 19:45:53 WARN  web[][o.s.a.s.w.WebService$Action] The response example is not set on action api/alm_integrations/search_bitbucketserver_repos
2021.12.16 19:45:53 WARN  web[][o.s.a.s.w.WebService$Action] The response example is not set on action api/alm_integrations/search_azure_repos
2021.12.16 19:45:53 WARN  web[][o.s.a.s.w.WebService$Action] The response example is not set on action api/project_dump/status
2021.12.16 19:45:54 INFO  web[][o.s.s.t.TelemetryDaemon] Sharing of SonarQube statistics is enabled.
2021.12.16 19:45:54 INFO  web[][o.s.s.n.NotificationDaemon] Notification service started (delay 60 sec.)
2021.12.16 19:45:54 INFO  web[][o.s.s.a.p.ExpiredSessionsCleaner] Purge of expired session tokens has removed 0 elements
2021.12.16 19:45:54 INFO  web[][o.s.s.a.p.ExpiredSessionsCleaner] Purge of expired SAML message ids has removed 0 elements
2021.12.16 19:45:54 INFO  web[][o.s.s.s.GeneratePluginIndex] Generate scanner plugin index
2021.12.16 19:45:55 INFO  web[][o.s.s.s.RegisterMetrics] Register metrics
2021.12.16 19:45:55 INFO  web[][o.s.s.r.RegisterRules] Register rules
2021.12.16 19:46:25 INFO  web[][o.s.s.q.BuiltInQProfileRepositoryImpl] Load quality profiles
2021.12.16 19:46:27 INFO  web[][o.s.s.q.RegisterQualityProfiles] Register quality profiles
2021.12.16 19:46:27 INFO  web[][o.s.s.q.RegisterQualityProfiles] Update profile css/Sonar way
2021.12.16 19:46:27 INFO  web[][o.s.s.q.RegisterQualityProfiles] Update profile scala/Sonar way
2021.12.16 19:46:27 INFO  web[][o.s.s.q.RegisterQualityProfiles] Update profile jsp/Sonar way
2021.12.16 19:46:27 INFO  web[][o.s.s.q.RegisterQualityProfiles] Update profile kotlin/Sonar way
2021.12.16 19:46:27 INFO  web[][o.s.s.q.RegisterQualityProfiles] Update profile go/Sonar way
2021.12.16 19:46:27 INFO  web[][o.s.s.q.RegisterQualityProfiles] Update profile js/Sonar way
2021.12.16 19:46:28 INFO  web[][o.s.s.q.RegisterQualityProfiles] Update profile py/Sonar way
2021.12.16 19:46:28 INFO  web[][o.s.s.q.RegisterQualityProfiles] Update profile ruby/Sonar way
2021.12.16 19:46:28 INFO  web[][o.s.s.q.RegisterQualityProfiles] Update profile cs/Sonar way
2021.12.16 19:46:29 INFO  web[][o.s.s.q.RegisterQualityProfiles] Update profile java/Sonar way
2021.12.16 19:46:29 INFO  web[][o.s.s.q.RegisterQualityProfiles] Update profile web/Sonar way
2021.12.16 19:46:29 INFO  web[][o.s.s.q.RegisterQualityProfiles] Update profile xml/Sonar way
2021.12.16 19:46:29 INFO  web[][o.s.s.q.RegisterQualityProfiles] Update profile flex/Sonar way
2021.12.16 19:46:29 INFO  web[][o.s.s.q.RegisterQualityProfiles] Update profile json/Sonar way
2021.12.16 19:46:29 INFO  web[][o.s.s.q.RegisterQualityProfiles] Update profile php/Sonar way
2021.12.16 19:46:30 INFO  web[][o.s.s.q.RegisterQualityProfiles] Update profile php/PSR-2
2021.12.16 19:46:30 INFO  web[][o.s.s.q.RegisterQualityProfiles] Update profile php/Drupal
2021.12.16 19:46:30 INFO  web[][o.s.s.q.RegisterQualityProfiles] Update profile terraform/Sonar way
2021.12.16 19:46:30 INFO  web[][o.s.s.q.RegisterQualityProfiles] Update profile vbnet/Sonar way
2021.12.16 19:46:30 INFO  web[][o.s.s.q.RegisterQualityProfiles] Update profile cloudformation/Sonar way
2021.12.16 19:46:30 INFO  web[][o.s.s.q.RegisterQualityProfiles] Update profile yaml/Sonar way
2021.12.16 19:46:30 INFO  web[][o.s.s.q.RegisterQualityProfiles] Update profile ts/Sonar way
2021.12.16 19:46:30 INFO  web[][o.s.s.s.RegisterPermissionTemplates] Register permission templates
2021.12.16 19:46:30 INFO  web[][o.s.s.s.RenameDeprecatedPropertyKeys] Rename deprecated property keys
2021.12.16 19:46:31 ERROR web[][o.s.s.p.Platform] Background initialization failed. Stopping SonarQube
org.apache.ibatis.exceptions.TooManyResultsException: Expected one result (or null) to be returned by selectOne(), but found: 2
	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:80)
	at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:87)
	at org.apache.ibatis.binding.MapperProxy$PlainMethodInvoker.invoke(MapperProxy.java:152)
	at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:85)
	at com.sun.proxy.$Proxy16.selectByKey(Unknown Source)
	at org.sonar.db.property.PropertiesDao.selectGlobalProperty(PropertiesDao.java:144)
	at org.sonar.server.plugins.PluginConsentVerifier.start(PluginConsentVerifier.java:52)
	at org.sonar.core.platform.StartableCloseableSafeLifecyleStrategy.start(StartableCloseableSafeLifecyleStrategy.java:40)
	at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84)
	at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:169)
	at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:132)
	at org.picocontainer.behaviors.Stored.start(Stored.java:110)
	at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(DefaultPicoContainer.java:1016)
	at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1009)
	at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:767)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
	at org.sonar.server.platform.platformlevel.PlatformLevel.start(PlatformLevel.java:90)
	at org.sonar.server.platform.platformlevel.PlatformLevelStartup.access$001(PlatformLevelStartup.java:51)
	at org.sonar.server.platform.platformlevel.PlatformLevelStartup$1.doPrivileged(PlatformLevelStartup.java:119)
	at org.sonar.server.user.DoPrivileged.execute(DoPrivileged.java:45)
	at org.sonar.server.platform.platformlevel.PlatformLevelStartup.start(PlatformLevelStartup.java:116)
	at org.sonar.server.platform.PlatformImpl.executeStartupTasks(PlatformImpl.java:198)
	at org.sonar.server.platform.PlatformImpl$1.lambda$doRun$1(PlatformImpl.java:122)
	at org.sonar.server.platform.PlatformImpl$AutoStarterRunnable.runIfNotAborted(PlatformImpl.java:370)
	at org.sonar.server.platform.PlatformImpl$1.doRun(PlatformImpl.java:122)
	at org.sonar.server.platform.PlatformImpl$AutoStarterRunnable.run(PlatformImpl.java:354)
	at java.base/java.lang.Thread.run(Thread.java:829)
2021.12.16 19:46:31 INFO  web[][o.s.p.ProcessEntryPoint] Hard stopping process
2021.12.16 19:46:31 INFO  web[][o.s.s.n.NotificationDaemon] Notification service stopped

I ran the DB upgrade from the /setup endpoint. Any help would be appreciated.

Found the issue. Set sonar.log.level.web to trace and it showed the query which was returning 2 records. Removed the extra record and it started working.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.