Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Upgrade SonarQube issues

I'm having issues installing my instance of SonarQube 4.4 to 5.1.

The instructions say to stop the SonarQube server, match up a couple files (back up DB, copy plugins, etc.), and then restart the sonar server for the updated version.

My problem is I'm not sure how to start/stop the server. The commands:

bin/<SYSTEM>/sonar stop

and

NEW_SONARQUBE_HOME/bin/<SYSTEM>/sonar start

aren't recognized. Here is what the file location looks like and this is the error I get when I StartSonar on the new instance.

enter image description here When I start from the 5.1 enter image description here When I start from the 4.4 enter image description here

Error in sonar log. I'm using port 9000 so I'm not sure why it's trying to get 9001

    2015.06.12 09:59:47 ERROR web[o.a.c.h.Http11NioProtocol] Failed to initialize end point associated with ProtocolHandler ["http-nio-0.0.0.0-9000"]
java.net.BindException: Address already in use: bind
    at sun.nio.ch.Net.bind0(Native Method) ~[na:1.7.0_55]
    at sun.nio.ch.Net.bind(Net.java:444) ~[na:1.7.0_55]
    at sun.nio.ch.Net.bind(Net.java:436) ~[na:1.7.0_55]
    at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:214) ~[na:1.7.0_55]
    at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74) ~[na:1.7.0_55]
    at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:343) ~[tomcat-embed-core-8.0.18.jar:8.0.18]
    at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:730) ~[tomcat-embed-core-8.0.18.jar:8.0.18]
    at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:457) ~[tomcat-embed-core-8.0.18.jar:8.0.18]
    at org.apache.coyote.http11.AbstractHttp11JsseProtocol.init(AbstractHttp11JsseProtocol.java:120) [tomcat-embed-core-8.0.18.jar:8.0.18]
    at org.apache.catalina.connector.Connector.initInternal(Connector.java:960) [tomcat-embed-core-8.0.18.jar:8.0.18]
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102) [tomcat-embed-core-8.0.18.jar:8.0.18]
    at org.apache.catalina.core.StandardService.initInternal(StandardService.java:567) [tomcat-embed-core-8.0.18.jar:8.0.18]
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102) [tomcat-embed-core-8.0.18.jar:8.0.18]
    at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:851) [tomcat-embed-core-8.0.18.jar:8.0.18]
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102) [tomcat-embed-core-8.0.18.jar:8.0.18]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:139) [tomcat-embed-core-8.0.18.jar:8.0.18]
    at org.apache.catalina.startup.Tomcat.start(Tomcat.java:340) [tomcat-embed-core-8.0.18.jar:8.0.18]
    at org.sonar.server.app.EmbeddedTomcat.start(EmbeddedTomcat.java:62) [sonar-server-5.1.1.jar:na]
    at org.sonar.server.app.WebServer.start(WebServer.java:40) [sonar-server-5.1.1.jar:na]
    at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:77) [sonar-process-5.1.1.jar:na]
    at org.sonar.server.app.WebServer.main(WebServer.java:66) [sonar-server-5.1.1.jar:na]
2015.06.12 09:59:47 ERROR web[o.a.c.c.StandardService] Failed to initialize connector [Connector[HTTP/1.1-9000]]
org.apache.catalina.LifecycleException: Failed to initialize component [Connector[HTTP/1.1-9000]]
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:106) [tomcat-embed-core-8.0.18.jar:8.0.18]
    at org.apache.catalina.core.StandardService.initInternal(StandardService.java:567) ~[tomcat-embed-core-8.0.18.jar:8.0.18]
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102) [tomcat-embed-core-8.0.18.jar:8.0.18]
    at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:851) [tomcat-embed-core-8.0.18.jar:8.0.18]
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102) [tomcat-embed-core-8.0.18.jar:8.0.18]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:139) [tomcat-embed-core-8.0.18.jar:8.0.18]
    at org.apache.catalina.startup.Tomcat.start(Tomcat.java:340) [tomcat-embed-core-8.0.18.jar:8.0.18]
    at org.sonar.server.app.EmbeddedTomcat.start(EmbeddedTomcat.java:62) [sonar-server-5.1.1.jar:na]
    at org.sonar.server.app.WebServer.start(WebServer.java:40) [sonar-server-5.1.1.jar:na]
    at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:77) [sonar-process-5.1.1.jar:na]
    at org.sonar.server.app.WebServer.main(WebServer.java:66) [sonar-server-5.1.1.jar:na]
Caused by: org.apache.catalina.LifecycleException: Protocol handler initialization failed
    at org.apache.catalina.connector.Connector.initInternal(Connector.java:962) ~[tomcat-embed-core-8.0.18.jar:8.0.18]
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102) [tomcat-embed-core-8.0.18.jar:8.0.18]
    ... 10 common frames omitted
Caused by: java.net.BindException: Address already in use: bind
    at sun.nio.ch.Net.bind0(Native Method) ~[na:1.7.0_55]
    at sun.nio.ch.Net.bind(Net.java:444) ~[na:1.7.0_55]
    at sun.nio.ch.Net.bind(Net.java:436) ~[na:1.7.0_55]
    at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:214) ~[na:1.7.0_55]
    at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74) ~[na:1.7.0_55]
    at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:343) ~[tomcat-embed-core-8.0.18.jar:8.0.18]
    at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:730) ~[tomcat-embed-core-8.0.18.jar:8.0.18]
    at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:457) ~[tomcat-embed-core-8.0.18.jar:8.0.18]
    at org.apache.coyote.http11.AbstractHttp11JsseProtocol.init(AbstractHttp11JsseProtocol.java:120) ~[tomcat-embed-core-8.0.18.jar:8.0.18]
    at org.apache.catalina.connector.Connector.initInternal(Connector.java:960) ~[tomcat-embed-core-8.0.18.jar:8.0.18]
    ... 11 common frames omitted
2015.06.12 09:59:47 WARN  web[o.s.p.ProcessEntryPoint] Fail to start web
java.lang.RuntimeException: org.apache.catalina.LifecycleException: Failed to initialize component [StandardServer[-1]]
    at com.google.common.base.Throwables.propagate(Throwables.java:156) ~[guava-10.0.1.jar:na]
    at org.sonar.server.app.EmbeddedTomcat.start(EmbeddedTomcat.java:65) ~[sonar-server-5.1.1.jar:na]
    at org.sonar.server.app.WebServer.start(WebServer.java:40) [sonar-server-5.1.1.jar:na]
    at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:77) ~[sonar-process-5.1.1.jar:na]
    at org.sonar.server.app.WebServer.main(WebServer.java:66) [sonar-server-5.1.1.jar:na]
Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [StandardServer[-1]]
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:106) ~[tomcat-embed-core-8.0.18.jar:8.0.18]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:139) ~[tomcat-embed-core-8.0.18.jar:8.0.18]
    at org.apache.catalina.startup.Tomcat.start(Tomcat.java:340) ~[tomcat-embed-core-8.0.18.jar:8.0.18]
    at org.sonar.server.app.EmbeddedTomcat.start(EmbeddedTomcat.java:62) ~[sonar-server-5.1.1.jar:na]
    ... 3 common frames omitted
Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [StandardService[Tomcat]]
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:106) ~[tomcat-embed-core-8.0.18.jar:8.0.18]
    at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:851) ~[tomcat-embed-core-8.0.18.jar:8.0.18]
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102) ~[tomcat-embed-core-8.0.18.jar:8.0.18]
    ... 6 common frames omitted
Caused by: org.apache.catalina.LifecycleException: Failed to initialize connector [Connector[HTTP/1.1-9000]]
    at org.apache.catalina.core.StandardService.initInternal(StandardService.java:574) ~[tomcat-embed-core-8.0.18.jar:8.0.18]
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102) ~[tomcat-embed-core-8.0.18.jar:8.0.18]
    ... 8 common frames omitted
2015.06.12 09:59:47 INFO  app[o.s.p.m.TerminatorThread] Process[search] is stopping
2015.06.12 09:59:47 INFO   es[o.s.p.StopWatcher]  Stopping process
2015.06.12 09:59:47 INFO   es[o.elasticsearch.node]  [sonar-1434117578819] stopping ...
2015.06.12 09:59:47 INFO   es[o.elasticsearch.node]  [sonar-1434117578819] stopped
2015.06.12 09:59:47 INFO   es[o.elasticsearch.node]  [sonar-1434117578819] closing ...
2015.06.12 09:59:47 INFO   es[o.elasticsearch.node]  [sonar-1434117578819] closed
2015.06.12 09:59:47 INFO  app[o.s.p.m.TerminatorThread] Process[search] is stopped
<-- Wrapper Stopped

How do I stop/start the SonarQube web server and proceed with the upgrade?

like image 477
PT_C Avatar asked Jun 11 '15 13:06

PT_C


People also ask

How do I update SonarQube to developer?

Download and InstallationDownload the Edition corresponding to your version of SonarQube. Extract the zip file and drop the results in $SONARQUBE_HOME/extensions/plugins. Stop/start the server. Set the license in Administration > License Manager page.

What is SonarQube latest version?

SonarQube 8.9.10 LTS October 2022 - Long Term Support version, wrapping-up all the great features of 8.x series. (Developer-led Code Security, integrations for everyone & So.


2 Answers

On Windows, the scripts are indeed different:

  • if you haven't installed SonarQube as a service, you should read "Running SonarQube as a Service on Windows" to know how to start and stop

  • if not, then:

    • to start SonarQube, you have to execute the "StartSonar.bat" script: this will open a Command window

    • to stop SonarQube, just close the window that was opened

The difference between SQ 4.4 and SQ 5.1 is that in most recent versions, when you start SonarQube, it creates 3 different processes:

  • 1 for the Web server (port 9000)
  • 1 for Elasticsearch (port 9001)
  • and 1 to monitor the previous 2 ones

So what happens in your log (Address already in use: bind) is clear: you have a running process of Elasticsearch. So to fix your problem:

  • Open Windows task manager
  • Kill all the Java processes
  • Restart SQ
like image 171
Fabrice - SonarSource Team Avatar answered Oct 07 '22 12:10

Fabrice - SonarSource Team


The new sonar needs two ports, 9000 for the web server and 9001 for search something. However, in most of the tutorials 9001 is not mentioned.

There is a clash for Universal Media Server which by default starts a web server at port 9001.

You should change one of the ports, however the port used for sonar search should not be public!

like image 20
kap Avatar answered Oct 07 '22 11:10

kap