Unable to run Sonarqube-8.6 due to compatibility issue with JDK

  • I am using Sonarqube-8.6 and jdk-11.0.9
  • error observed (java.net.BindException: Address already in use: bind and org.elasticsearch.http.BindHttpException: Failed to bind to 127.0.0.1:9001)

Hi @Darshan_HN,

Welcome to SonarSource community :wave:

I think looks like port 9001 is already taken. Maybe by another SonarQube instance? If you don’t mind killing all Java services on your Unix computer, you can run this command:

kill -9 $(ps -ef | pgrep -f "java")

If you need to find a specific port, you can try using lsof -i :9001 or netstat -an | grep :9001 then kill that specific PID. Then try restarting SonarQube.

Joe

Hi @Joe

I have had the same error on SQ 8.6, and there isn’t a process on port 9001.

Since I updated to LDAP in conf/sonar.properties, the server will not start. Any thoughts on what I should check?

Hi @Joe, @meenalkb

From the Stack Trace it looks like there is something already running on port 9001 which is the default port for elasticsearch that comes with sonarqube.

you can try to clean this port so elastic is able to use it, or configure a different port for elastic using the property sonar.search.port in your sonar.properties file.

It helps me to resolve.

2 Likes

I have just fixed the same issue and I ended up finding the answer in the {sonarqube_install}/conf/sonar.properties file.

It says in there the following:

# Elasticsearch port for incoming HTTP connections. Default is 9001. Use 0 to get a free port.
# As a security precaution, should be blocked by a firewall and not exposed to the Internet.
sonar.search.port=0

You can see where I uncommented the search port and set it to zero, which resolved my issue.

3 Likes

Hi @Jeremy_Brooks and @Darshan_HN :sonarsource:
Thank you for explaining your solutions, I missed this detail earlier. Indeed, modifying sonar.search.port would be the best option in your use case.

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