SonarQube Installation Error

I get following error when I’m trying to run StartSonar.bat. Can someone please help me to figure out what this is
What I already Tried:
Changing sonar.search.port and sonar.web.port properties.

wrapper  | --> Wrapper Started as Console
wrapper  | Launching a JVM...
jvm 1    | Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
jvm 1    |   Copyright 1999-2006 Tanuki Software, Inc.  All Rights Reserved.
jvm 1    |
jvm 1    | 2022.04.02 06:57:19 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory C:\sonarqube-9.3.0.51899\temp
jvm 1    | 2022.04.02 06:57:19 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on [HTTP: 127.0.0.1:9001, TCP: 127.0.0.1:1667]
jvm 1    | 2022.04.02 06:57:19 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [C:\sonarqube-9.3.0.51899\elasticsearch]: C:\jdk-11.0.13\bin\java -XX:+UseG1GC -Djava.io.tmpdir=C:\sonarqube-9.3.0.51899\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:\sonarqube-9.3.0.51899\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 -Xmx512m -Xms512m -XX:MaxDirectMemorySize=256m -XX:+HeapDumpOnOutOfMemoryError -Delasticsearch -Des.path.home=C:\sonarqube-9.3.0.51899\elasticsearch -Des.path.conf=C:\sonarqube-9.3.0.51899\temp\conf\es -cp lib/* org.elasticsearch.bootstrap.Elasticsearch
jvm 1    | 2022.04.02 06:57:19 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
jvm 1    | 2022.04.02 06:57:19 ERROR app[][o.s.a.p.EsManagedProcess] Failed to check status
jvm 1    | org.elasticsearch.ElasticsearchException: java.util.concurrent.ExecutionException: org.elasticsearch.client.ResponseException: method [GET], host [http://127.0.0.1:9001], URI [/], status line [HTTP/1.1 404 Not Found]
jvm 1    | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
jvm 1    | <HTML><HEAD><TITLE>Not Found</TITLE>
jvm 1    | <META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
jvm 1    | <BODY><h2>Not Found</h2>
jvm 1    | <hr><p>HTTP Error 404. The requested resource is not found.</p>
jvm 1    | </BODY></HTML>
jvm 1    |
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: org.elasticsearch.client.ResponseException: method [GET], host [http://127.0.0.1:9001], URI [/], status line [HTTP/1.1 404 Not Found]
jvm 1    | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
jvm 1    | <HTML><HEAD><TITLE>Not Found</TITLE>
jvm 1    | <META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
jvm 1    | <BODY><h2>Not Found</h2>
jvm 1    | <hr><p>HTTP Error 404. The requested resource is not found.</p>
jvm 1    | </BODY></HTML>
jvm 1    |
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
jvm 1    | Caused by: org.elasticsearch.client.ResponseException: method [GET], host [http://127.0.0.1:9001], URI [/], status line [HTTP/1.1 404 Not Found]
jvm 1    | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
jvm 1    | <HTML><HEAD><TITLE>Not Found</TITLE>
jvm 1    | <META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
jvm 1    | <BODY><h2>Not Found</h2>
jvm 1    | <hr><p>HTTP Error 404. The requested resource is not found.</p>
jvm 1    | </BODY></HTML>
jvm 1    |
jvm 1    |      at org.elasticsearch.client.RestClient.convertResponse(RestClient.java:331)
jvm 1    |      at org.elasticsearch.client.RestClient.access$1800(RestClient.java:106)
jvm 1    |      at org.elasticsearch.client.RestClient$1.completed(RestClient.java:381)
jvm 1    |      at org.elasticsearch.client.RestClient$1.completed(RestClient.java:377)
jvm 1    |      at org.apache.http.concurrent.BasicFuture.completed(BasicFuture.java:122)
jvm 1    |      at org.apache.http.impl.nio.client.DefaultClientExchangeHandlerImpl.responseCompleted(DefaultClientExchangeHandlerImpl.java:181)
jvm 1    |      at org.apache.http.nio.protocol.HttpAsyncRequestExecutor.processResponse(HttpAsyncRequestExecutor.java:448)
jvm 1    |      at org.apache.http.nio.protocol.HttpAsyncRequestExecutor.inputReady(HttpAsyncRequestExecutor.java:338)
jvm 1    |      at org.apache.http.impl.nio.DefaultNHttpClientConnection.consumeInput(DefaultNHttpClientConnection.java:265)

Error Continues but cannot enter due to character limit

Hi,

Welcome to the community!

You’ve gotten a 404 for an internal check between processes within SonarQube. That’s odd, & I suspect you have something else on this box that’s intercepting the call. I’d start by checking your server logs to see what they say. And then, of course, take a look around to see what’s serving that 404.

 
HTH,
Ann

Following the installation guide for both Community & Enterprise editions, I keep running into this same issue. I’ve tried v9.5, v9.6, v8.6, but still same issue. Has anyone determined the cause/solution for this error? Please reply with the solution if you have figured this out. Thank you.

Hi “@sqneedsbetterguides”,

Welcome to the community!

Have you checked your server logs, as I suggested in my previous response? And if so, what did you find? Have you looked to see what on the machine could be serving that 404?

 
Ann

I did see this in the logs, so I changed the sonar.search.port=9001 to port 9005 and it got past that error. I also changed the Global Logging level (sonar.log.level) to DEBUG, to help with troubleshooting. Now I get a different error about connecting to the database, which deserves a new thread:

BindHttpException[**Failed to bind to 127.0.0.1:9001**]; nested: BindException[Address already in use: bind];
Likely root cause: java.net.BindException: **Address already in use**: bind
	at java.base/sun.nio.ch.Net.bind0(Native Method)
	at java.base/sun.nio.ch.Net.bind(Net.java:459)
	at java.base/sun.nio.ch.Net.bind(Net.java:448)
	at java.base/sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:227)
	at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:134)
	at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:562)
	at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1334)
	at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:506)
	at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:491)
	at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:973)
	at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:260)
	at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:356)
	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:469)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500)
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at java.base/java.lang.Thread.run(Thread.java:834)

Hi,

It’s not clear to me whether you understand the error you’ve posted…

I guess this is the error you got past by changing the port number?

And BTW, typically an error about 9001 already being in use is caused by zombie processes hanging around from previous attempts to start SonarQube…

 
HTH,
Ann

yes, this was the error I got past by changing the port number. To your point, it probably was a zombie process from a previous attempt, but why that previous attempt failed is a mystery, probably from when I ran StartSonar.bat before setting the Java path in the wrapper.conf. I’m still looking into the database connection issue, looks to be a port blocked by firewall. I’ll re-post in a new thread if I can’t figure it out, which is highly likely.

1 Like

Looks like allowing all the SonarQube ports in the firewall fixed my issue.

jvm 1    | 2022.09.20 14:34:34 INFO  app[][o.s.a.SchedulerImpl] SonarQube is operational
1 Like

Hi,

I’m glad you worked through this. Since you chose a user name of “SQ needs better guides”, I’d like to ask what - docs-wise - you think would have helped you here.

 
Ann

Although, there was an issue with the sonar.properties file that was preventing my MS SQL DB connection (using integrated security) causing the connection to close, and that was this line, the uncommented line works, the commented out line doesn’t work:

#sonar.jdbc.url=jdbc:sqlserver://localhost;databaseName=sonar;integratedSecurity=true
SONAR_JDBC_URL=jdbc:sqlserver://localhost;databaseName=sonar;integratedSecurity=true

Well, there are just too many important bits and pieces scattered throughout the different docs, missing in some docs, but important information that is required for most, if not all versions.

The fix I found for my MS SQL DB connection came from this link:
https://docs.sonarqube.org/9.5/setup/environment-variables/

I just happened to notice the underscores instead of dots in the variable, which differs from the sonar.properties template. I guess I figured the template should have the correct variables, we shouldn’t have to fix the template that comes in the zip file.

It would be nice to have a comprehensive installation guide per OS installation (I know that’s a lot to ask for), or an installation script that contains all of the prerequisites and installs them if they’re missing, etc…, as much automation as possible to limit the possibility of user error. Could be a script that ask questions and takes the user input to formulate the conf files.

The downloaded v9.6.1 Zip didn’t have a Wrapper.exe in the bin, but the Windows Service “SonarQube” tries to point to the wrapper.exe file that is missing, so things like this need to be fixed before the release is published.

Could use much more examples, screenshots, etc…

I could dig up a lot of areas that could be improved, but I’m not on the payroll.

~James

Hi James,

Thanks for this!

Are you saying that using a zip (not Docker) installation you had to configure the sonar.properties file with SONAR_JDBC_URL to get your instance spun up? Because that’s not how it’s supposed to work.

 
Ann

Yes, that is what I’m saying. The server wouldn’t spin up until I fixed the variable in the sonar.properties in the zip file (not docker) to use underscores instead of dots/decimals.

1 Like

Hi James,

Changing the sonar.properties file with SONAR_JDBC_URL will make SonarQube ignore the property and use the embedded h2 database. You can verify that by seeing a warning at the bottom after you login SonarQube.

1 Like

Thanks for that info. Then there’s still an issue with using the MS SQL DB that I will have to troubleshoot.

I see the warning:

This is what I’m talking about with the SQ Documentation. This is the only information regarding the database, and it’s not working. There must be some other settings, configurations, or requirements to get the MS SQL DB to work with the JDBC driver that I’ll have to find elsewhere, but should be included in the Install documentation:

image

image

All of the above has been done, but still not able to get the server to spin up using MS SQL DB with Integrated Security nor with SQL Auth username & password.

Disabled firewall and still doesn’t want to connect to the MS SQL DB.

I found a related thread to my current issue here, but still not working for me:

this topic is solved in this thread

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