SonarQube 404 error with org.elasticsearch.ElasticsearchException

Must-share information (formatted with Markdown):

  • SonarQube version - 10.5.1.90531
  • SonarQube deployed: zip
  • I am trying to start the sonarqube by StartSonar.bat cmd
  • I have changed the #sonar.web.port=9031 and #sonar.search.port = 9032 and again restarted the process but still not working, I am getting the below errors
Starting SonarQube...
2024.05.30 13:14:15 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory C:\SonarQube\sonarqube-10.5.1.90531\temp
2024.05.30 13:14:15 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on [HTTP: 127.0.0.1:9001, TCP: 127.0.0.1:52981]
2024.05.30 13:14:15 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[ELASTICSEARCH] from [C:\SonarQube\sonarqube-10.5.1.90531\elasticsearch]: C:\Program Files\Java\jdk-19\bin\java -Xms4m -Xmx64m -XX:+UseSerialGC -Dcli.name=server -Dcli.script=./bin/elasticsearch -Dcli.libs=lib/tools/server-cli -Des.path.home=C:\SonarQube\sonarqube-10.5.1.90531\elasticsearch -Des.path.conf=C:\SonarQube\sonarqube-10.5.1.90531\temp\conf\es -Des.distribution.type=tar -cp C:\SonarQube\sonarqube-10.5.1.90531\elasticsearch\lib\*;C:\SonarQube\sonarqube-10.5.1.90531\elasticsearch\lib\cli-launcher\* org.elasticsearch.launcher.CliToolLauncher
2024.05.30 13:14:15 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2024.05.30 13:14:16 ERROR app[][o.s.a.p.EsManagedProcess] Failed to check status
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]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>Not Found</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
<BODY><h2>Not Found</h2>
<hr><p>HTTP Error 404. The requested resource is not found.</p>
</BODY></HTML>

        at org.elasticsearch.client.RestHighLevelClient.performClientRequest(RestHighLevelClient.java:2695)
        at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:2171)
        at org.elasticsearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:2137)
        at org.elasticsearch.client.RestHighLevelClient.performRequestAndParseEntity(RestHighLevelClient.java:2105)
        at org.elasticsearch.client.ClusterClient.health(ClusterClient.java:151)
        at org.sonar.application.es.EsConnectorImpl.getClusterHealthStatus(EsConnectorImpl.java:79)
        at org.sonar.application.process.EsManagedProcess.checkStatus(EsManagedProcess.java:92)
        at org.sonar.application.process.EsManagedProcess.checkOperational(EsManagedProcess.java:77)
        at org.sonar.application.process.EsManagedProcess.isOperational(EsManagedProcess.java:62)
        at org.sonar.application.process.ManagedProcessHandler.refreshState(ManagedProcessHandler.java:223)
        at org.sonar.application.process.ManagedProcessHandler$EventWatcher.run(ManagedProcessHandler.java:288)
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]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>Not Found</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
<BODY><h2>Not Found</h2>
<hr><p>HTTP Error 404. The requested resource is not found.</p>
</BODY></HTML>

can you help me, how to solve this error

Hey there.

Have you made sure to actually uncomment the settings? So

sonar.search.port=9032

as opposed to

#sonar.search.port=9032