SonarQube fails to stop then fails to start

  • versions used: SonarQube 5.6.6
  • error observed: I planned a STOP / START of Sonar every friday evening. I’m using Windows services to run Sonar.
    When trying to stop, one process fails to stop “in a timely fashion” then it is killed.
    But java process are still running (I guess it is the cause of the following issue).
    Below extract of the log when stopping

Stopping the SonarQube service…
2018.08.17 23:50:01 INFO app[o.s.p.m.Monitor] Process[ce] is stopping
2018.08.17 23:50:01 INFO ce[o.s.p.StopWatcher] Stopping process
2018.08.17 23:50:01 INFO ce[o.s.ce.app.CeServer] Compute Engine shutting down…
Waiting to stop…
2018.08.17 23:50:05 INFO app[o.s.p.m.Monitor] Process[ce] is stopped
2018.08.17 23:50:05 INFO app[o.s.p.m.Monitor] Process[web] is stopping
2018.08.17 23:50:05 INFO web[o.s.p.StopWatcher] Stopping process
2018.08.17 23:50:05 INFO web[o.a.c.h.Http11NioProtocol] Pausing ProtocolHandler [“http-nio-0.0.0.0-9000”]
2018.08.17 23:50:06 INFO web[o.s.s.n.NotificationService] Notification service stopped
2018.08.17 23:50:07 INFO web[o.a.c.h.Http11NioProtocol] Stopping ProtocolHandler [“http-nio-0.0.0.0-9000”]
2018.08.17 23:50:08 INFO web[o.a.c.h.Http11NioProtocol] Destroying ProtocolHandler [“http-nio-0.0.0.0-9000”]
Waiting to stop…
Waiting to stop…
Waiting to stop…
Waiting to stop…
Waiting to stop…
Waiting to stop…
Waiting to stop…
Waiting to stop…
Waiting to stop…
Waiting to stop…
Waiting to stop…
2018.08.17 23:51:05 INFO app[o.s.p.m.Monitor] Process[web] failed to stop in a timely fashion. Killing it.
Waiting to stop…
Waiting to stop…
Waiting to stop…
Waiting to stop…
Waiting to stop…
Waiting to stop…
Waiting to stop…
Waiting to stop…
Waiting to stop…
Waiting to stop…
Waiting to stop…
Waiting to stop…
Waiting to stop…
Waiting to stop…
Waiting to stop…
Waiting to stop…
Waiting to stop…
Waiting to stop…
Waiting to stop…
Waiting to stop…
Waiting to stop…
Waiting to stop…
Waiting to stop…
Waiting to stop…
Waiting to stop…
Waiting to stop…
Waiting to stop…
Waiting to stop…
Waiting to stop…
Waiting to stop…
Waiting to stop…
Waiting to stop…
Waiting to stop…
Waiting to stop…
Waiting to stop…
Waiting to stop…
Waiting to stop…
Waiting to stop…
Waiting to stop…
Waiting to stop…
Waiting to stop…
Waiting to stop…
Waiting to stop…
Waiting to stop…
Waiting to stop…
Waiting to stop…
Waiting to stop…
Waiting to stop…
2018.08.17 23:55:09 INFO app[o.s.p.m.Monitor] Process[web] is stopped
2018.08.17 23:55:09 INFO app[o.s.p.m.Monitor] Process[es] is stopping
Waiting to stop…
2018.08.17 23:55:10 INFO es[o.s.p.StopWatcher] Stopping process
2018.08.17 23:55:10 INFO es[o.elasticsearch.node] [sonar-1533937813008] stopping …
2018.08.17 23:55:12 INFO es[o.elasticsearch.node] [sonar-1533937813008] stopped
2018.08.17 23:55:12 INFO es[o.elasticsearch.node] [sonar-1533937813008] closing …
2018.08.17 23:55:12 INFO es[o.elasticsearch.node] [sonar-1533937813008] closed
2018.08.17 23:55:13 INFO app[o.s.p.m.Monitor] Process[es] is stopped
← Wrapper Stopped
Waiting to stop…
SonarQube stopped.

When SonarQube tries to restart it can’t due to this error:

2018.08.17 23:55:33 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

  • potential workaround: Restart server to reset all processes before to start Sonar.

Previously it was working well.
Do you have any clue to investigate ?
Thanks in advance.

Hi,

First, 7.3 is the current version of SonarQube and 6.7.5 is the current LTS. You’re going to have trouble finding support for versions prior to that.

Second, why are you restarting SonarQube? Theoretically, it shouldn’t need it.

It looks like when you do restart it, the force-kill of the web process isn’t allowing the resources (socket on port 9000) to be cleaned up properly. You could do some detective work on your server to see what’s holding on to the port and kill it manually, or you could effect your SonarQube restart with a server restart.

We won’t be spending time to figure out why your server isn’t shutting down properly; we no longer support anything prior to the current LTS.

Ann

Hi,
Yes I know for the SonarQube Release, we are working on upgrade to 6.7 (will done before mid of September).

I stop SonarQube because if we have technical stuff to do on server during the week end I don’t want to have infra team that calls me to know what to do with running apps.

Regards,

$ ps aux | grep sonar # Check that sonarqube is running
$ kill -9 allsonarpid