SonarQube 8.9.7.52159 is not working as a Service in Windows 2019 server

Hi - I have installed SonarQube 8.9.7 on Windows 2019 server, after setting it up as a service and it is showing it as running but actually, it is not working.

I tried to access it on localhost:9000 from the server’s local browser too. Not working there also.

I followed the steps mentioned here: Operating the server

Below is the logs:

*> Starting the SonarQube service...*
*> --> Wrapper Started as Service*
*> Launching a JVM...*
*> Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org*
*>   Copyright 1999-2006 Tanuki Software, Inc.  All Rights Reserved.*
*> *
*> 2023.05.20 17:45:16 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory D:\Sonarqube\sonarqube-8.9.7.52159\temp*
*> 2023.05.20 17:45:16 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on [HTTP: 127.0.0.1:9001, TCP: 127.0.0.1:65291]*
*> 2023.05.20 17:45:16 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [D:\Sonarqube\sonarqube-8.9.7.52159\elasticsearch]: C:\Program Files\Eclipse Adoptium\jdk-11.0.18.10-hotspot\bin\java -XX:+UseG1GC -Djava.io.tmpdir=D:\Sonarqube\sonarqube-8.9.7.52159\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=D:\Sonarqube\sonarqube-8.9.7.52159\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 -Des.enforce.bootstrap.checks=true -Xmx512m -Xms512m -XX:MaxDirectMemorySize=256m -XX:+HeapDumpOnOutOfMemoryError -Delasticsearch -Des.path.home=D:\Sonarqube\sonarqube-8.9.7.52159\elasticsearch -Des.path.conf=D:\Sonarqube\sonarqube-8.9.7.52159\temp\conf\es -cp lib/* org.elasticsearch.bootstrap.Elasticsearch*
*> 2023.05.20 17:45:16 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running*
*> SonarQube started.*
*> 2023.05.20 17:45:25 INFO  app[][o.s.a.SchedulerImpl] Process[es] is up*
*> 2023.05.20 17:45:25 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[[key='web', ipcIndex=2, logFilenamePrefix=web]] from [D:\Sonarqube\sonarqube-8.9.7.52159]: C:\Program Files\Eclipse Adoptium\jdk-11.0.18.10-hotspot\bin\java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=D:\Sonarqube\sonarqube-8.9.7.52159\temp -XX:-OmitStackTraceInFastThrow --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:+HeapDumpOnOutOfMemoryError -javaagent:./extensions/plugins/sonarqube-community-branch-plugin-1.8.1.jar=web -Dhttp.nonProxyHosts=localhost|127.*|[::1] -cp ./lib/sonar-application-8.9.7.52159.jar;D:\Sonarqube\sonarqube-8.9.7.52159\lib\jdbc\mssql\mssql-jdbc-9.2.0.jre11.jar org.sonar.server.app.WebServer D:\Sonarqube\sonarqube-8.9.7.52159\temp\sq-process11212994805520576595properties*
*> 17:45:25.479 [main] INFO com.github.mc1arke.sonarqube.plugin.CommunityBranchAgent - Loading agent*
*> 17:45:25.486 [main] DEBUG com.github.mc1arke.sonarqube.plugin.CommunityBranchAgent - Transforming class org.sonar.server.almsettings.MultipleAlmFeatureProvider*
*> 17:45:25.582 [main] DEBUG com.github.mc1arke.sonarqube.plugin.CommunityBranchAgent - Transforming class org.sonar.server.newcodeperiod.ws.SetAction*
*> 17:45:25.600 [main] DEBUG com.github.mc1arke.sonarqube.plugin.CommunityBranchAgent - Transforming class org.sonar.server.newcodeperiod.ws.UnsetAction*

Hey there.

If you’re setting up a new SonarQUbe server, you should not start with SonarQube v8.9.7, at a minimum, you should use SonarQube v9.9.1, the current LTS.

And, it looks like you’re getting trouble with a community-supported plugin that adds some illicit functionality. If you’re facing issues with it, better go talk with the maintainer.

Hi @Colin - Thanks for the response.

But we recently configured the same SQ 8.9.7 LTS on one of the server and it is working fine without causing any issues.
Could you please help us identify which plugin is causing this as you mentioned? So, we will address it first and then do the degradation in another change window.

TIA…
Amol K

My recommendation would be to check the individual log files for any specific error messages / stacktraces that can point you to the issue.

Hi @Colin - Now, I have installed SonarQube 9.9 lts version with Java 17.

But running StartSonar.bat file from cmd as a admin gives below error.

Starting SonarQube...
2023.05.23 07:24:10 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory D:\sonarqube-9.9.1.69595\temp
2023.05.23 07:24:10 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on [HTTP: 127.0.0.1:9001, TCP: 127.0.0.1:49239]
2023.05.23 07:24:11 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[ELASTICSEARCH] from [D:\sonarqube-9.9.1.69595\elasticsearch]: C:\Program Files\Eclipse Adoptium\jdk-17.0.7.7-hotspot\bin\java -XX:+UseG1GC -Djava.io.tmpdir=D:\sonarqube-9.9.1.69595\temp -XX:ErrorFile=D:\sonarqube-9.9.1.69595\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=D:\sonarqube-9.9.1.69595\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=D:\sonarqube-9.9.1.69595\elasticsearch -Des.path.conf=D:\sonarqube-9.9.1.69595\temp\conf\es -cp lib/* org.elasticsearch.bootstrap.Elasticsearch
2023.05.23 07:24:11 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2023.05.23 07:24:22 INFO  app[][o.s.a.SchedulerImpl] Process[es] is up
2023.05.23 07:24:23 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[WEB_SERVER] from [D:\sonarqube-9.9.1.69595]: C:\Program Files\Eclipse Adoptium\jdk-17.0.7.7-hotspot\bin\java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=D:\sonarqube-9.9.1.69595\temp -XX:-OmitStackTraceInFastThrow --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 --add-exports=java.base/jdk.internal.ref=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.management/sun.management=ALL-UNNAMED --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED -Dcom.redhat.fips=false -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -Dhttp.nonProxyHosts=localhost|127.*|[::1] -cp ./lib/sonar-application-9.9.1.69595.jar;D:\sonarqube-9.9.1.69595\lib\jdbc\mssql\mssql-jdbc-11.2.2.jre17.jar org.sonar.server.app.WebServer D:\sonarqube-9.9.1.69595\temp\sq-process997320674111055444properties
WARNING: A terminally deprecated method in java.lang.System has been called
WARNING: System::setSecurityManager has been called by org.sonar.process.PluginSecurityManager (file:/D:/sonarqube-9.9.1.69595/lib/sonar-application-9.9.1.69595.jar)
WARNING: Please consider reporting this to the maintainers of org.sonar.process.PluginSecurityManager
WARNING: System::setSecurityManager will be removed in a future release
2023.05.23 07:24:39 INFO  app[][o.s.a.SchedulerImpl] Process[Web Server] is stopped
2023.05.23 07:24:39 INFO  app[][o.s.a.SchedulerImpl] Process[ElasticSearch] is stopped
2023.05.23 07:24:39 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped

Also, after installing StartService.bat file. I am seeing below behavior. It keeps stopping after few seconds.

D:\sonarqube-9.9.1.69595\bin\windows-x86-64>SonarService.bat start
2023-05-23 07:26:44,252 INFO  - Starting service 'SonarQube (SonarQube)'...
2023-05-23 07:26:44,377 INFO  - Service 'SonarQube (SonarQube)' started successfully.

D:\sonarqube-9.9.1.69595\bin\windows-x86-64>SonarService.bat status
Started

D:\sonarqube-9.9.1.69595\bin\windows-x86-64>SonarService.bat status
Started

D:\sonarqube-9.9.1.69595\bin\windows-x86-64>SonarService.bat status
Stopped

What do the other log files say?

Web log

2023.05.23 08:20:05 WARN web[][o.s.c.a.AnnotationConfigApplicationContext] Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader@659e0bfd-org.sonar.db.DefaultDatabase': Initialization of bean failed; nested exception is java.lang.IllegalStateException: Fail to connect to database

2023.05.23 08:20:05 ERROR web[][o.s.s.p.PlatformImpl] Web server startup failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader@659e0bfd-org.sonar.db.DefaultDatabase': Initialization of bean failed; nested exception is java.lang.IllegalStateException: Fail to connect to database

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:628)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)

at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)

at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955)

at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:920)

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)

at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:187)

at org.sonar.server.platform.platformlevel.PlatformLevel.start(PlatformLevel.java:80)

at org.sonar.server.platform.platformlevel.PlatformLevel1.start(PlatformLevel1.java:164)

at org.sonar.server.platform.PlatformImpl.start(PlatformImpl.java:196)

at org.sonar.server.platform.PlatformImpl.startLevel1Container(PlatformImpl.java:162)

at org.sonar.server.platform.PlatformImpl.init(PlatformImpl.java:76)

at org.sonar.server.platform.web.PlatformServletContextListener.contextInitialized(PlatformServletContextListener.java:43)

at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4494)

at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4946)

at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)

at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1332)

at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1322)

at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)

at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)

at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:145)

at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:871)

at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:795)

at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)

at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1332)

at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1322)

at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)

at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)

at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:145)

at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:871)

at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:249)

at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)

at org.apache.catalina.core.StandardService.startInternal(StandardService.java:428)

at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)

at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:917)

at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)

at org.apache.catalina.startup.Tomcat.start(Tomcat.java:486)

at org.sonar.server.app.EmbeddedTomcat.start(EmbeddedTomcat.java:72)

at org.sonar.server.app.WebServer.start(WebServer.java:55)

at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:97)

at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:81)

at org.sonar.server.app.WebServer.main(WebServer.java:104)

Caused by: java.lang.IllegalStateException: Fail to connect to database

at org.sonar.db.DefaultDatabase.start(DefaultDatabase.java:130)

at org.sonar.core.platform.StartableBeanPostProcessor.postProcessBeforeInitialization(StartableBeanPostProcessor.java:33)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:440)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1796)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620)

... 44 common frames omitted

Caused by: com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target". ClientConnectionId:

at com.zaxxer.hikari.pool.HikariPool.throwPoolInitializationException(HikariPool.java:596)

at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:582)

at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:100)

at com.zaxxer.hikari.HikariDataSource.<init>(HikariDataSource.java:81)

at org.sonar.db.DefaultDatabase.createHikariDataSource(DefaultDatabase.java:159)

at org.sonar.db.DefaultDatabase.initDataSource(DefaultDatabase.java:148)

at org.sonar.db.DefaultDatabase.start(DefaultDatabase.java:126)

... 48 common frames omitted

Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target". ClientConnectionId:

at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:3806)

at com.microsoft.sqlserver.jdbc.TDSChannel.enableSSL(IOBuffer.java:1906)

at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:3329)

at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:2950)

at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectInternal(SQLServerConnection.java:2790)

at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:1663)

at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:1064)

at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:121)

at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:359)

at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:201)

at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:470)

at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:561)

... 53 common frames omitted

Caused by: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:131)

at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:378)

at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:321)

at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:316)

at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.checkServerCerts(CertificateMessage.java:654)

at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.onCertificate(CertificateMessage.java:473)

at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.consume(CertificateMessage.java:369)

at java.base/sun.security.ssl.SSLHandshake.consume(SSLHandshake.java:396)

at java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:480)

at java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:458)

at java.base/sun.security.ssl.TransportContext.dispatch(TransportContext.java:201)

at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:172)

at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1510)

at java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1425)

at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:455)

at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:426)

at com.microsoft.sqlserver.jdbc.TDSChannel.enableSSL(IOBuffer.java:1795)

... 63 common frames omitted

Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

at java.base/sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:439)

at java.base/sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:306)

at java.base/sun.security.validator.Validator.validate(Validator.java:264)

at java.base/sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:242)

at java.base/sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:113)

at com.microsoft.sqlserver.jdbc.HostNameOverrideX509TrustManager.checkServerTrusted(SQLServerTrustManager.java:86)

at java.base/sun.security.ssl.AbstractTrustManagerWrapper.checkServerTrusted(SSLContextImpl.java:1441)

at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.checkServerCerts(CertificateMessage.java:638)

... 75 common frames omitted

Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

at java.base/sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:146)

at java.base/sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:127)

at java.base/java.security.cert.CertPathBuilder.build(CertPathBuilder.java:297)

at java.base/sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:434)

... 82 common frames omitted

2023.05.23 08:20:06 INFO web[][o.s.s.a.EmbeddedTomcat] HTTP connector enabled on port 9000

2023.05.23 08:20:06 INFO web[][o.s.p.ProcessEntryPoint] Hard stopping process

@Colin - Sonar log

2023.05.23 08:19:53 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory D:\sonarqube-9.9.1.69595\temp
2023.05.23 08:19:53 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on [HTTP: 127.0.0.1:9001, TCP: 127.0.0.1:50337]
2023.05.23 08:19:53 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[ELASTICSEARCH] from [D:\sonarqube-9.9.1.69595\elasticsearch]: C:\Program Files\Eclipse Adoptium\jdk-17.0.7.7-hotspot\bin\java -XX:+UseG1GC -Djava.io.tmpdir=D:\sonarqube-9.9.1.69595\temp -XX:ErrorFile=D:\sonarqube-9.9.1.69595\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=D:\sonarqube-9.9.1.69595\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=D:\sonarqube-9.9.1.69595\elasticsearch -Des.path.conf=D:\sonarqube-9.9.1.69595\temp\conf\es -cp lib/* org.elasticsearch.bootstrap.Elasticsearch
2023.05.23 08:19:53 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2023.05.23 08:20:02 INFO  app[][o.s.a.SchedulerImpl] Process[es] is up
2023.05.23 08:20:02 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[WEB_SERVER] from [D:\sonarqube-9.9.1.69595]: C:\Program Files\Eclipse Adoptium\jdk-17.0.7.7-hotspot\bin\java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=D:\sonarqube-9.9.1.69595\temp -XX:-OmitStackTraceInFastThrow --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 --add-exports=java.base/jdk.internal.ref=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.management/sun.management=ALL-UNNAMED --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED -Dcom.redhat.fips=false -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -Dhttp.nonProxyHosts=localhost|127.*|[::1] -cp ./lib/sonar-application-9.9.1.69595.jar;D:\sonarqube-9.9.1.69595\lib\jdbc\mssql\mssql-jdbc-11.2.2.jre17.jar org.sonar.server.app.WebServer D:\sonarqube-9.9.1.69595\temp\sq-process606390033783743677properties
2023.05.23 08:20:06 INFO  app[][o.s.a.SchedulerImpl] Process[Web Server] is stopped
2023.05.23 08:20:06 INFO  app[][o.s.a.SchedulerImpl] Process[ElasticSearch] is stopped
2023.05.23 08:20:06 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped

@colin - Sonarservicewrapper.wrapper log

2023-05-23 08:19:52,295 DEBUG - Starting WinSW in service mode
2023-05-23 08:19:52,310 INFO  - Starting java.exe  -Xms8m -Xmx32m -Djava.awt.headless=true --add-exports=java.base/jdk.internal.ref=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.management/sun.management=ALL-UNNAMED --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED -cp "..\..\..\lib\sonar-application-9.9.1.69595.jar" "org.sonar.application.App" 
2023-05-23 08:19:52,341 INFO  - Started process 6880
2023-05-23 08:19:52,341 DEBUG - Forwarding logs of the process System.Diagnostics.Process (java) to WinSW.IgnoreLogAppender

Hi @Colin - Could you please let me know what we need to do here to fix this issue?

Take a look at this upgrade note :

Microsoft SQL Server changes in configuration and Integrated Authentication

  • If your Microsoft SQL Server doesn’t support encryption, you will need to add encrypt=false to the JDBC URL connection string. (SONAR-16249).
  • If your Microsoft SQL Server requires encryption but you don’t want SonarQube to validate the certificate, you will need to add trustServerCertificate=true to the JDBC URL connection string.

Hi @Colin - Now, I can run the sonarqube using StartSonar.bat file but when I am running it as a service it keeps stopping.
I followed the steps mentioned here, Operating the server

Also, below are the logs…
SonarServiceWrapper.wrapper log

2023-05-24 05:48:53,601 DEBUG - Starting WinSW in console mode
2023-05-24 05:48:53,623 INFO  - Starting service 'SonarQube (SonarQube)'...
2023-05-24 05:48:53,790 DEBUG - Starting WinSW in service mode
2023-05-24 05:48:53,809 INFO  - Service 'SonarQube (SonarQube)' started successfully.
2023-05-24 05:48:53,823 INFO  - Starting java.exe  -Xms8m -Xmx32m -Djava.awt.headless=true --add-exports=java.base/jdk.internal.ref=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.management/sun.management=ALL-UNNAMED --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED -cp "..\..\..\lib\sonar-application-9.9.1.69595.jar" "org.sonar.application.App" 
2023-05-24 05:48:53,857 INFO  - Started process 1088
2023-05-24 05:48:53,862 DEBUG - Forwarding logs of the process System.Diagnostics.Process (java) to WinSW.IgnoreLogAppender

Web log

Caused by: java.lang.IllegalStateException: Fail to connect to database
	at org.sonar.db.DefaultDatabase.start(DefaultDatabase.java:130)
	at org.sonar.core.platform.StartableBeanPostProcessor.postProcessBeforeInitialization(StartableBeanPostProcessor.java:33)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:440)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1796)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620)
	... 44 common frames omitted
Caused by: com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: Login failed for user 'xxxx'. ClientConnectionId:xxxx
	at com.zaxxer.hikari.pool.HikariPool.throwPoolInitializationException(HikariPool.java:596)
	at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:582)
	at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:100)
	at com.zaxxer.hikari.HikariDataSource.<init>(HikariDataSource.java:81)
	at org.sonar.db.DefaultDatabase.createHikariDataSource(DefaultDatabase.java:159)
	at org.sonar.db.DefaultDatabase.initDataSource(DefaultDatabase.java:148)
	at org.sonar.db.DefaultDatabase.start(DefaultDatabase.java:126)
	... 48 common frames omitted
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user 'xxxxx'. ClientConnectionId:xxxxxx
	at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:265)
	at com.microsoft.sqlserver.jdbc.TDSTokenHandler.onEOF(tdsparser.java:300)
	at com.microsoft.sqlserver.jdbc.TDSParser.parse(tdsparser.java:133)
	at com.microsoft.sqlserver.jdbc.TDSParser.parse(tdsparser.java:37)
	at com.microsoft.sqlserver.jdbc.SQLServerConnection$1LogonProcessor.complete(SQLServerConnection.java:5996)
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.sendLogon(SQLServerConnection.java:6300)
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(SQLServerConnection.java:4911)
	at com.microsoft.sqlserver.jdbc.SQLServerConnection$LogonCommand.doExecute(SQLServerConnection.java:4849)
	at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7627)
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:3916)
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:3358)
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:2950)
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectInternal(SQLServerConnection.java:2790)
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:1663)
	at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:1064)
	at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:121)
	at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:359)
	at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:201)
	at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:470)
	at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:561)
	... 53 common frames omitted
2023.05.24 05:49:12 INFO  web[][o.s.s.a.EmbeddedTomcat] HTTP connector enabled on port 9000
2023.05.24 05:49:12 INFO  web[][o.s.p.ProcessEntryPoint] Hard stopping process

Sonar log

2023.05.24 05:48:54 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2023.05.24 05:49:09 INFO  app[][o.s.a.SchedulerImpl] Process[es] is up
2023.05.24 05:49:09 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[WEB_SERVER] from [D:\sonarqube-9.9.1.69595]: C:\Program Files\Eclipse Adoptium\jdk-17.0.7.7-hotspot\bin\java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=D:\sonarqube-9.9.1.69595\temp -XX:-OmitStackTraceInFastThrow --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 --add-exports=java.base/jdk.internal.ref=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.management/sun.management=ALL-UNNAMED --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED -Dcom.redhat.fips=false -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -Dhttp.nonProxyHosts=localhost|127.*|[::1] -cp ./lib/sonar-application-9.9.1.69595.jar;D:\sonarqube-9.9.1.69595\lib\jdbc\mssql\mssql-jdbc-11.2.2.jre17.jar org.sonar.server.app.WebServer D:\sonarqube-9.9.1.69595\temp\sq-process16675586323680526507properties
2023.05.24 05:49:12 INFO  app[][o.s.a.SchedulerImpl] Process[Web Server] is stopped
2023.05.24 05:49:12 INFO  app[][o.s.a.SchedulerImpl] Process[ElasticSearch] is stopped
2023.05.24 05:49:12 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped

Please help me here…

Also, please confirm, for 9.9 lts wrapper config is not required manually, right?

Thanks,
Amol K

It looks like your user can’t login. Have you tested these credentials? Are you providing a username/password via sonar.jdbc.username and sonar.jdbc.password, or using Integrated Security?

Hi @Colin - Issue got resolved by adding encrypt=false in jdbc connector string in sonar.properties file.

Thanks,
Amol K

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