6

Good afternoon everyone, the problem is this I have a server with SonarQube, that when I try to start the windows service, it gets up but then it stops.

The following error appears in the sonarqube log:

2017.11.14 11:04:52 WARN  sea[o.e.transport.netty]  [sonar-1510653879773] exception caught on transport layer [[id: 0x346b46fb, /127.0.0.1:59330 => /127.0.0.1:9001]], closing connection
java.io.IOException: An existing connection was forcibly closed by the remote host
                at sun.nio.ch.SocketDispatcher.read0(Native Method) ~[na:1.8.0_152]
                at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:43) ~[na:1.8.0_152]
                at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223) ~[na:1.8.0_152]
                at sun.nio.ch.IOUtil.read(IOUtil.java:192) ~[na:1.8.0_152]
                at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380) ~[na:1.8.0_152]
                at org.elasticsearch.common.netty.channel.socket.nio.NioWorker.read(NioWorker.java:64) [elasticsearch-1.1.2.jar:na]
                at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:108) [elasticsearch-1.1.2.jar:na]
                at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:318) [elasticsearch-1.1.2.jar:na]
                at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89) [elasticsearch-1.1.2.jar:na]
                at org.elasticsearch.common.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178) [elasticsearch-1.1.2.jar:na]
                at org.elasticsearch.common.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108) [elasticsearch-1.1.2.jar:na]
                at org.elasticsearch.common.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42) [elasticsearch-1.1.2.jar:na]
                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_152]
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_152]
                at java.lang.Thread.run(Thread.java:748) [na:1.8.0_152]
2017.11.14 11:04:52 INFO  app[o.s.p.m.TerminatorThread] Process[search] is stopping
2017.11.14 11:04:52 INFO  sea[o.s.p.StopWatcher]  Stopping process

Do you know why this error? I have set the sonar.properties correctly, including set the value of the sonar.search.port property to 0 as this link suggests: Sonar launch error, but the problem persists.

I hope you can give me a hand...

Regards!!!

  • What kind of hardware/software do you use? – Jeroen Heier Nov 14 '17 at 20:50
  • How are you @JeroenHeier! It is a local computer, it is not a server to use, although it is used only and exclusively to run a series of applications (Jenkins, SonarQube, etc.). It has a Windows 10 OS, and it is a machine that has recently been mounted since the it had had become obsolete. The Sonar version is sonarqube-4.5.4, it is being used with a postgresql database. – Carlos Cervantes Nov 15 '17 at 14:20
  • That is an old SonarQube version. If you use a "new" plugin this might not work. You should starting to make a migiration plan to migrate to SonarQube 5.6 or 6.7. – Jeroen Heier Nov 16 '17 at 04:53
  • Additionally to Grahams reply in my case i realized, i've simply forgotten, to install sonarqube-ldap-plugin when i was upgrading from 5.3.6 to 7.6.3 LTS. Same result. Also have a look here: https://stackoverflow.com/questions/38601224/sonarqube-5-6-ldap-2-0-failing-to-authenticate?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa – Sebastian Meyer May 02 '18 at 08:56

5 Answers5

9

UnComment below line in sonar property file and change port 9001 to 0

#sonar.search.port=9001
sonar.search.port=0
Sameer
  • 113
  • 1
  • 4
7

I had the same problem and i could fix it like this:

  1. Go to this folder: sonarqube-x.x\conf
  2. Open this file: sonar.properties
  3. Find the word: #sonar.web.port
  4. Change the value from 9000 to another port, like 9002
  5. Save your changes
  6. Start again your sonarqube
  7. Access to the server with port 9000: http://localhost:9000
  • It worked, but I had to use 9002 in the 7th step. Are you sure you wanted to write 9000? It is not consistent with the 4th step! – Luis Gouveia Apr 14 '20 at 11:01
4

The reason could be the port number of sonarQube OR the one of elasticSearch instance used by sonarQube (I had a similar problem before), so the step to change both/one of those ports are :

  1. Go to this folder: sonarqube-x.x\conf
  2. Open this file: sonar.properties
  3. For sonarQube port:
  • Find: #sonar.web.port
  • Change the value from 9000 to another port, like 9123; and un-comment the line (remove # in the beginning) sonar.web.port=9123
  1. For sonarQube's elasticSearch instace port:
  • Find: #sonar.search.port
  • change this line To sonar.search.port=0 (this means that he will search for any available port and bind it)
  1. Save your changes
  2. Start again your sonarqube

Access to the server with the new specified sonarQube-port: http://localhost:9123

Tarek B
  • 483
  • 7
  • 20
1

I experienced this error when upgrading SonarQube from version 5.6.7 to 6.7.1.

Originally I thought this was due to the port number but upon checking the web.log I noticed that there was an error relating to the LDAP plugin (2.2.0.608).

    ERROR web[][o.s.s.p.Platform] Background initialization failed. Stopping SonarQube org.sonar.plugins.ldap.LdapException: The property 'ldap.url' is empty and no realm configured to try auto-discovery.

Updating the sonar.properties file with the correct configuration allowed SonarQube to start.

Gruss
  • 121
  • 14
  • The configuration (in my case) was a typo. The LDAP configuration for sonar is specific to your environment, look here for an example: https://docs.sonarqube.org/display/SONAR/LDAP+Integration – Gruss Jun 19 '18 at 12:13
0

I just occurred an exactly same question as you did. I started SonarQube with MariaDB 5.5, but I found some error messages in sonarqube-x.x/logs/web.log:

2021.01.21 14:36:17 INFO  web[][o.s.p.ProcessEntryPoint] Starting web
......
2021.01.21 14:36:19 ERROR web[][o.s.s.p.Platform] Web server startup failed: Unsupported mysql version: 5.5. Minimal supported version is 5.6.

So I changed my database to MySQL 5.7 and it started successfully.

Not quite sure you had the same problem, but just check these log files and see what actually happened during starting.