Rakesh V
Rakesh V

Reputation: 146

Unable to access SonarQube server page

I have installed SonarQube 5.6.6 on a CentOS machine. On running the command sudo /etc/init.d/sonar start, I get a message on the console saying that the server has started. But, I am unable to access the server by hitting the URL. It says "Webpage not available". Here's the log file after starting the server:

--> Wrapper Started as Daemon
Launching a JVM...
Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
  Copyright 1999-2006 Tanuki Software, Inc.  All Rights Reserved.

2017.03.08 03:46:10 INFO  app[o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonar/sonarqube-5.6.6/temp
2017.03.08 03:46:10 INFO  app[o.s.p.m.JavaProcessLauncher] Launch process[es]: /opt/java/jdk1.8.0_45/jre/bin/java -Djava.awt.headless=true -Xmx1G -Xms256m -Xss256k -Djava.net.preferIPv4Stack=true -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -Djava.io.tmpdir=/opt/sonar/sonarqube-5.6.6/temp -javaagent:/opt/java/jdk1.8.0_45/jre/lib/management-agent.jar -cp ./lib/common/*:./lib/search/* org.sonar.search.SearchServer /opt/sonar/sonarqube-5.6.6/temp/sq-process7136923572720376635properties
2017.03.08 03:46:11 INFO   es[o.s.p.ProcessEntryPoint]  Starting es
2017.03.08 03:46:11 INFO   es[o.s.s.EsSettings]  Elasticsearch listening on 127.0.0.1:9001
2017.03.08 03:46:11 INFO   es[o.elasticsearch.node]  [sonar-1488962770197] version[1.7.5], pid[27750], build[00f95f4/2016-02-02T09:55:30Z]
2017.03.08 03:46:11 INFO   es[o.elasticsearch.node]  [sonar-1488962770197] initializing ...
2017.03.08 03:46:11 INFO   es[o.e.plugins]  [sonar-1488962770197] loaded [], sites []
2017.03.08 03:46:11 INFO   es[o.elasticsearch.env]  [sonar-1488962770197] using [1] data paths, mounts [[/ (/dev/mapper/vg_gendc-lv_root)]], net usable_space [33.7gb], net total_space [49gb], types [ext4]
2017.03.08 03:46:12 WARN   es[o.e.bootstrap]  JNA not found. native methods will be disabled.
2017.03.08 03:46:13 INFO   es[o.elasticsearch.node]  [sonar-1488962770197] initialized
2017.03.08 03:46:13 INFO   es[o.elasticsearch.node]  [sonar-1488962770197] starting ...
2017.03.08 03:46:13 WARN   es[o.e.common.network]  failed to resolve local host, fallback to loopback
java.net.UnknownHostException: GENDC: GENDC: unknown error
        at java.net.InetAddress.getLocalHost(InetAddress.java:1484) ~[na:1.8.0_45]
        at org.elasticsearch.common.network.NetworkUtils.<clinit>(NetworkUtils.java:55) ~[elasticsearch-1.7.5.jar:na]
        at org.elasticsearch.transport.netty.NettyTransport.createClientBootstrap(NettyTransport.java:350) [elasticsearch-1.7.5.jar:na]
        at org.elasticsearch.transport.netty.NettyTransport.doStart(NettyTransport.java:242) [elasticsearch-1.7.5.jar:na]
        at org.elasticsearch.common.component.AbstractLifecycleComponent.start(AbstractLifecycleComponent.java:85) [elasticsearch-1.7.5.jar:na]
        at org.elasticsearch.transport.TransportService.doStart(TransportService.java:153) [elasticsearch-1.7.5.jar:na]
        at org.elasticsearch.common.component.AbstractLifecycleComponent.start(AbstractLifecycleComponent.java:85) [elasticsearch-1.7.5.jar:na]
        at org.elasticsearch.node.internal.InternalNode.start(InternalNode.java:257) [elasticsearch-1.7.5.jar:na]
        at org.sonar.search.SearchServer.start(SearchServer.java:46) [sonar-search-5.6.6.jar:na]
        at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:102) [sonar-process-5.6.6.jar:na]
        at org.sonar.search.SearchServer.main(SearchServer.java:81) [sonar-search-5.6.6.jar:na]
Caused by: java.net.UnknownHostException: GENDC: unknown error
        at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method) ~[na:1.8.0_45]
        at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:907) ~[na:1.8.0_45]
        at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1302) ~[na:1.8.0_45]
        at java.net.InetAddress.getLocalHost(InetAddress.java:1479) ~[na:1.8.0_45]
        ... 10 common frames omitted
2017.03.08 03:46:13 INFO   es[o.e.transport]  [sonar-1488962770197] bound_address {inet[/127.0.0.1:9001]}, publish_address {inet[/127.0.0.1:9001]}
2017.03.08 03:46:13 INFO   es[o.e.discovery]  [sonar-1488962770197] sonarqube/uDS8_ZL_Q_yEh-Rl-cxzrA
2017.03.08 03:46:16 INFO   es[o.e.cluster.service]  [sonar-1488962770197] new_master [sonar-1488962770197][uDS8_ZL_Q_yEh-Rl-cxzrA][localhost][inet[/127.0.0.1:9001]]{rack_id=sonar-1488962770197}, reason: zen-disco-join (elected_as_master)
2017.03.08 03:46:16 INFO   es[o.elasticsearch.node]  [sonar-1488962770197] started
2017.03.08 03:46:16 INFO   es[o.e.gateway]  [sonar-1488962770197] recovered [0] indices into cluster_state
2017.03.08 03:46:16 INFO  app[o.s.p.m.Monitor] Process[es] is up
2017.03.08 03:46:16 INFO  app[o.s.p.m.JavaProcessLauncher] Launch process[web]: /opt/java/jdk1.8.0_45/jre/bin/java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djruby.management.enabled=false -Djruby.compile.invokedynamic=false -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -Djava.net.preferIPv4Stack=true -Djava.io.tmpdir=/opt/sonar/sonarqube-5.6.6/temp -javaagent:/opt/java/jdk1.8.0_45/jre/lib/management-agent.jar -cp ./lib/common/*:./lib/server/*:/opt/sonar/sonarqube-5.6.6/lib/jdbc/mysql/mysql-connector-java-5.1.35.jar org.sonar.server.app.WebServer /opt/sonar/sonarqube-5.6.6/temp/sq-process159399378215612918properties
2017.03.08 03:46:16 INFO  web[o.s.p.ProcessEntryPoint] Starting web

If i try to access the server page via this link : http://localhost:9000/sonar, the webpage is unavailable and on trying to stop it, I get a console message saying: "SonarQube was not running". However, if i try to stop it before hitting the URL, the console message is: "stopped SonarQube". This seems to be weird.

The remainder of the log file after stopping the server is as follows:

2017.03.08 03:46:16 INFO  web[o.s.s.a.TomcatContexts] Webapp directory: /opt/sonar/sonarqube-5.6.6/web
2017.03.08 03:46:17 INFO  web[o.a.c.h.Http11NioProtocol] Initializing ProtocolHandler ["http-nio-172.31.254.181-80"]
2017.03.08 03:46:17 INFO  web[o.a.t.u.n.NioSelectorPool] Using a shared selector for servlet write/read
2017.03.08 03:46:26 INFO  web[o.a.c.u.SessionIdGeneratorBase] Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [9,101] milliseconds.
2017.03.08 03:46:26 INFO  web[o.s.s.p.ServerImpl] SonarQube Server / 5.6.6 / e8e13145497bb920921ae4fe11b09f0903f1d298
2017.03.08 03:46:26 INFO  web[o.sonar.db.Database] Create JDBC data source for jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance
2017.03.08 03:46:26 ERROR web[o.a.c.c.C.[.[.[/sonar]] Exception sending context initialized event to listener instance of class org.sonar.server.platform.PlatformServletContextListener
org.sonar.api.utils.MessageException: Unsupported mysql version: 5.1. Minimal supported version is 5.6.
2017.03.08 03:46:26 ERROR web[o.a.c.c.StandardContext] One or more listeners failed to start. Full details will be found in the appropriate container log file
2017.03.08 03:46:26 ERROR web[o.a.c.c.StandardContext] Context [/sonar] startup failed due to previous errors
2017.03.08 03:46:26 WARN  web[o.a.c.l.WebappClassLoaderBase] The web application [sonar] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 java.lang.Object.wait(Native Method)
 java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:143)
 com.mysql.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:43)
2017.03.08 03:46:26 WARN  web[o.a.c.l.WebappClassLoaderBase] The web application [sonar] appears to have started a thread named [Timer-0] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 java.lang.Object.wait(Native Method)
 java.util.TimerThread.mainLoop(Timer.java:552)
 java.util.TimerThread.run(Timer.java:505)
2017.03.08 03:46:26 INFO  web[o.a.c.h.Http11NioProtocol] Starting ProtocolHandler ["http-nio-172.31.254.181-80"]
2017.03.08 03:46:26 INFO  web[o.s.s.a.TomcatAccessLog] Web server is started
2017.03.08 03:46:26 INFO  web[o.s.s.a.EmbeddedTomcat] HTTP connector enabled on port 80
2017.03.08 03:46:26 WARN  web[o.s.p.ProcessEntryPoint] Fail to start web
java.lang.IllegalStateException: Webapp did not start
        at org.sonar.server.app.EmbeddedTomcat.isUp(EmbeddedTomcat.java:84) ~[sonar-server-5.6.6.jar:na]
        at org.sonar.server.app.WebServer.isUp(WebServer.java:47) [sonar-server-5.6.6.jar:na]
        at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:105) ~[sonar-process-5.6.6.jar:na]
        at org.sonar.server.app.WebServer.main(WebServer.java:68) [sonar-server-5.6.6.jar:na]
2017.03.08 03:46:26 INFO  web[o.a.c.h.Http11NioProtocol] Pausing ProtocolHandler ["http-nio-172.31.254.181-80"]
2017.03.08 03:46:27 INFO  web[o.a.c.h.Http11NioProtocol] Stopping ProtocolHandler ["http-nio-172.31.254.181-80"]
2017.03.08 03:46:28 INFO  web[o.a.c.h.Http11NioProtocol] Destroying ProtocolHandler ["http-nio-172.31.254.181-80"]
2017.03.08 03:46:28 INFO  web[o.s.s.a.TomcatAccessLog] Web server is stopped
2017.03.08 03:46:28 INFO  app[o.s.p.m.Monitor] Process[es] is stopping
2017.03.08 03:46:28 INFO   es[o.s.p.StopWatcher]  Stopping process
2017.03.08 03:46:28 INFO   es[o.elasticsearch.node]  [sonar-1488962770197] stopping ...
2017.03.08 03:46:28 INFO   es[o.elasticsearch.node]  [sonar-1488962770197] stopped
2017.03.08 03:46:28 INFO   es[o.elasticsearch.node]  [sonar-1488962770197] closing ...
2017.03.08 03:46:28 INFO   es[o.elasticsearch.node]  [sonar-1488962770197] closed
2017.03.08 03:46:29 INFO  app[o.s.p.m.Monitor] Process[es] is stopped
<-- Wrapper Stopped  

Here's some of the properties I have written in the sonar.properties file:

sonar.web.host=172.31.254.181 sonar.web.context=/sonar sonar.web.port=9000 sonar.jdbc.username=sonar sonar.jdbc.password=sonar sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance

Any help in sorting this issue would be appreciated.

Upvotes: 0

Views: 1158

Answers (1)

Nicolas B.
Nicolas B.

Reputation: 7321

Your SonarQube server is actually failing to start. And the error is right there in the logs you've shared:

2017.03.08 03:46:26 ERROR web[o.a.c.c.C.[.[.[/sonar]] Exception sending context initialized event to listener instance of class org.sonar.server.platform.PlatformServletContextListener org.sonar.api.utils.MessageException: Unsupported mysql version: 5.1. Minimal supported version is 5.6.

SonarQube v5.6.x requirements are here, and for MySQL only versions 5.6 or 5.7 are supported (just like the log says).

Upvotes: 4

Related Questions