SQ randomly started failing. Error message isn't helpful

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
  • how is SonarQube deployed: zip, Docker, Helm
  • what are you trying to achieve
  • what have you tried so far to achieve this

Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!

  1. Version sonarqube-enterprise-10.3.0.82913
  2. Deployment: Zip
  3. What I need: SQ randomly started failing on startup
  4. I’ve tried the following
    1. turning it off and on again
    1. turning the server off and on again
    1. changing the ElastiSearch port
    1. setting the ES port to 0 (which finds any available port)
    1. the following error just repeats over and over
2024.06.24 07:12:47 DEBUG app[][o.a.h.i.n.c.MainClientExec] [exchange: 225] start execution
2024.06.24 07:12:47 DEBUG app[][o.a.h.c.p.RequestAddCookies] CookieSpec selected: default
2024.06.24 07:12:47 DEBUG app[][o.a.h.c.p.RequestAuthCache] Re-using cached 'basic' auth scheme for http://127.0.0.1:9001
2024.06.24 07:12:47 DEBUG app[][o.a.h.c.p.RequestAuthCache] No credentials for preemptive authentication
2024.06.24 07:12:47 DEBUG app[][o.a.h.i.n.c.InternalHttpAsyncClient] [exchange: 225] Request connection for {}->http://127.0.0.1:9001
2024.06.24 07:12:47 DEBUG app[][o.a.h.i.n.c.PoolingNHttpClientConnectionManager] Connection request: [route: {}->http://127.0.0.1:9001][total kept alive: 0; route allocated: 0 of 10; total allocated: 0 of 30]
2024.06.24 07:12:47 DEBUG app[][o.a.h.i.n.c.PoolingNHttpClientConnectionManager] Connection request failed
java.net.ConnectException: Connection refused: no further information
        at java.base/sun.nio.ch.Net.pollConnect(Native Method)
        at java.base/sun.nio.ch.Net.pollConnectNow(Net.java:672)
        at java.base/sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:946)
        at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvent(DefaultConnectingIOReactor.java:174)
        at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvents(DefaultConnectingIOReactor.java:148)
        at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor.execute(AbstractMultiworkerIOReactor.java:351)
        at org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager.execute(PoolingNHttpClientConnectionManager.java:221)
        at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase$1.run(CloseableHttpAsyncClientBase.java:64)
        at java.base/java.lang.Thread.run(Thread.java:842)
2024.06.24 07:12:47 DEBUG app[][o.a.h.i.n.c.InternalHttpAsyncClient] [exchange: 225] connection request failed
2024.06.24 07:12:47 DEBUG app[][o.e.c.RestClient] request [GET http://127.0.0.1:9001/] failed
java.net.ConnectException: Connection refused: no further information
        at java.base/sun.nio.ch.Net.pollConnect(Native Method)
        at java.base/sun.nio.ch.Net.pollConnectNow(Net.java:672)
        at java.base/sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:946)
        at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvent(DefaultConnectingIOReactor.java:174)
        at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvents(DefaultConnectingIOReactor.java:148)
        at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor.execute(AbstractMultiworkerIOReactor.java:351)
        at org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager.execute(PoolingNHttpClientConnectionManager.java:221)
        at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase$1.run(CloseableHttpAsyncClientBase.java:64)
        at java.base/java.lang.Thread.run(Thread.java:842)
2024.06.24 07:12:47 DEBUG app[][o.e.c.RestClient] updated [[host=http://127.0.0.1:9001]] already in blacklist
2024.06.24 07:12:47 DEBUG app[][o.a.h.i.n.c.MainClientExec] [exchange: 226] start execution
2024.06.24 07:12:47 DEBUG app[][o.a.h.c.p.RequestAddCookies] CookieSpec selected: default
2024.06.24 07:12:47 DEBUG app[][o.a.h.c.p.RequestAuthCache] Re-using cached 'basic' auth scheme for http://127.0.0.1:9001
2024.06.24 07:12:47 DEBUG app[][o.a.h.c.p.RequestAuthCache] No credentials for preemptive authentication
2024.06.24 07:12:47 DEBUG app[][o.a.h.i.n.c.InternalHttpAsyncClient] [exchange: 226] Request connection for {}->http://127.0.0.1:9001
2024.06.24 07:12:47 DEBUG app[][o.a.h.i.n.c.PoolingNHttpClientConnectionManager] Connection request: [route: {}->http://127.0.0.1:9001][total kept alive: 0; route allocated: 0 of 10; total allocated: 0 of 30]
2024.06.24 07:12:47 DEBUG app[][o.a.h.i.n.c.PoolingNHttpClientConnectionManager] Connection request failed
java.net.ConnectException: Connection refused: no further information
        at java.base/sun.nio.ch.Net.pollConnect(Native Method)
        at java.base/sun.nio.ch.Net.pollConnectNow(Net.java:672)
        at java.base/sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:946)
        at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvent(DefaultConnectingIOReactor.java:174)
        at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvents(DefaultConnectingIOReactor.java:148)
        at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor.execute(AbstractMultiworkerIOReactor.java:351)
        at org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager.execute(PoolingNHttpClientConnectionManager.java:221)
        at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase$1.run(CloseableHttpAsyncClientBase.java:64)
        at java.base/java.lang.Thread.run(Thread.java:842)
2024.06.24 07:12:47 DEBUG app[][o.a.h.i.n.c.InternalHttpAsyncClient] [exchange: 226] connection request failed
2024.06.24 07:12:47 DEBUG app[][o.e.c.RestClient] request [GET http://127.0.0.1:9001/] failed
java.net.ConnectException: Connection refused: no further information
        at java.base/sun.nio.ch.Net.pollConnect(Native Method)
        at java.base/sun.nio.ch.Net.pollConnectNow(Net.java:672)
        at java.base/sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:946)
        at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvent(DefaultConnectingIOReactor.java:174)
        at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvents(DefaultConnectingIOReactor.java:148)
        at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor.execute(AbstractMultiworkerIOReactor.java:351)
        at org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager.execute(PoolingNHttpClientConnectionManager.java:221)
        at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase$1.run(CloseableHttpAsyncClientBase.java:64)
        at java.base/java.lang.Thread.run(Thread.java:842)
2024.06.24 07:12:47 DEBUG app[][o.e.c.RestClient] updated [[host=http://127.0.0.1:9001]] already in blacklist

Hi,

Is there anything interesting in your other server logs?

I suspect something’s interfering with ES’s ability to grab port 9001. Next time this happens, you should probably check to see what process is holding that port.

 
HTH,
Ann

thank you for the reply. nothing is using port 9001.
In addition to trying other ports I also set the app to find any open port.

Still no dice.

Hi,

Ehm… I’m skeptical that will work well. It’s not just Elasticsearch that needs to be on that port, but the SonarQube thread that needs to find it there.

Then perhaps you have a server policy that disallows its use. Or perhaps something between the two processes blocking the communication.

You need to figure out why Elasticsearch isn’t responding on port 9001. And unfortunately, since there’s nothing in your logs, the problem appears to exist entirely outside of SonarQube.

 
Ann

@Douglas_Jones, have you checked the <Sonarqube_dir>/logs/es.log logs? If ES is failing to start, a more detailed error should be displayed there.

If it is not there, you might want to check the other log files to see if there is more information on the error.

1 Like