Unable to reach Azure virtual machine on port 9000 for Sonarqube installation

I’m trying to install sonarqube@7.3 with postgresql on a Debian 9 Stretch virtual machine hosted with Microsoft Azure. Everything works properly except that I can’t browse with my real physical machine at mydns.myregion.cloudapp.azure.com:9000.

Any clues to work on this ?


What you’ll need to know :

  • Sonarqube is working (logs tell that Sonarqube is up and running properly)
  • nmap localhost shows :
    • 22/tcp open ssh
    • 80/tcp open http
    • 5432/tcp open postgresql
    • 9000/tcp open cslistener
    • 9001/tcp open tor-orport
  • Many tries on sonar.properties but at the moment, the file is very close from the default one except for the DB credentials section and sonar.web.host entry with the ip address of my VM.
  • No lines in the access.log file

NB :
I don’t have administrator rights on the VM so my options are limited on the azure portal…

Log of web.log :

2018.10.11 09:29:28 ERROR web[][o.a.c.h.Http11NioProtocol] Failed to initialize end point associated with ProtocolHandler ["http-nio-13.69.61.190-9000"]
java.net.BindException: Cannot assign requested address
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:433)
at sun.nio.ch.Net.bind(Net.java:425)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:210)
at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:982)
at org.apache.tomcat.util.net.AbstractJsseEndpoint.init(AbstractJsseEndpoint.java:245)
at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:620)
at org.apache.coyote.http11.AbstractHttp11Protocol.init(AbstractHttp11Protocol.java:66)
at org.apache.catalina.connector.Connector.initInternal(Connector.java:997)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107)
at org.apache.catalina.core.StandardService.initInternal(StandardService.java:549)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107)
at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:875)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
at org.apache.catalina.startup.Tomcat.start(Tomcat.java:367)
at org.sonar.server.app.EmbeddedTomcat.start(EmbeddedTomcat.java:61)
at org.sonar.server.app.WebServer.start(WebServer.java:51)
at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:113)
at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:100)
at org.sonar.server.app.WebServer.main(WebServer.java:91)
2018.10.11 09:29:28 ERROR web[][o.s.s.a.EmbeddedTomcat] Fail to start web server

Edit : While moving sonar.properties to localhost, curl http://localhost:9000 executed from the VM works and gave me the web page in shell, this is definitely some Azure and ip configuration…

Answer

2018.10.11 09:29:28 ERROR web[][o.a.c.h.Http11NioProtocol] Failed to initialize end point associated with ProtocolHandler [“http-nio-13.69.61.190-9000”]
java.net.BindException: Cannot assign requested address

There’s your problem – That typically means that the port’s in use for some reason. Java’s syntax is a bit odd there I guess. Looking at your ports in use with this in mind and the line 9000/tcp open cslistener pops out – the ports in use. While I’m not familiar with sonarqube, using a different port would probably sort it out.

The docs suggests that 9000 is your default port (which ties in nicely with my diagnosis) and to fix that you need to edit sonar.properties – I believe there should be a line reading sonar.web.port=9000 which can be altered to any open port.

Attribution
Source : Link , Question Author : JeuneApprenti , Answer Author : Journeyman Geek

Leave a Comment