Ian Rowlands
Ian Rowlands

Reputation: 173

Unable to start Sonarqube 6.7 on Windows 7

I am unable to run Sonarqube 6.7 on Windows 7.

I have just downloaded it from the site. I'm using JDK 1.8.0_144 as the Java runtime. When I run the "StartSonar.bat" I get the following exception:

wrapper  | --> Wrapper Started as Console
wrapper  | Launching a JVM...
jvm 1    | Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
jvm 1    |   Copyright 1999-2006 Tanuki Software, Inc.  All Rights Reserved.
jvm 1    |
jvm 1    | 2017.12.11 14:17:21 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory C:\Tools\sonarqube-6.7\temp
jvm 1    | 2017.12.11 14:17:21 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
jvm 1    | 2017.12.11 14:17:21 INFO  app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [C:\Tools\sonarqube-6.
7\elasticsearch]: C:\Java\jdk1.8.0_144\jre\bin\java -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+Always
PreTouch -server -Xss1m -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djna.nosys=true -Djdk.io.permissionsUseCanonicalPath=true -Dio.netty.noUnsafe=true -Dio.
netty.noKeySetOptimization=true -Dio.netty.recycler.maxCapacityPerThread=0 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -Dlog4j.skipJansi=true -X
ms512m -Xmx512m -XX:+HeapDumpOnOutOfMemoryError -Delasticsearch -Des.path.home=C:\Tools\sonarqube-6.7\elasticsearch -cp lib/* org.elasticsearch.bootstrap.Elasti
csearch -Epath.conf=C:\Tools\sonarqube-6.7\temp\conf\es
jvm 1    | 2017.12.11 14:17:21 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
jvm 1    | 2017.12.11 14:17:21 INFO  app[][o.e.p.PluginsService] no modules loaded
jvm 1    | 2017.12.11 14:17:21 INFO  app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
jvm 1    | 2017.12.11 14:17:22 WARN  app[][o.e.t.n.Netty4Transport] exception caught on transport layer [[id: 0xcd8d6c6a, L:/127.0.0.1:63293 - R:/127.0.0.1:9001
]], closing connection
jvm 1    | io.netty.handler.codec.DecoderException: java.io.StreamCorruptedException: invalid internal transport message format, got (48,54,54,50)
jvm 1    |      at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:459)
jvm 1    |      at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:265)
jvm 1    |      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
jvm 1    |      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
jvm 1    |      at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
jvm 1    |      at io.netty.handler.logging.LoggingHandler.channelRead(LoggingHandler.java:241)
jvm 1    |      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
jvm 1    |      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
jvm 1    |      at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
jvm 1    |      at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1334)
jvm 1    |      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
jvm 1    |      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
jvm 1    |      at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:926)
jvm 1    |      at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:134)
jvm 1    |      at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:644)
jvm 1    |      at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:579)
jvm 1    |      at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:496)
jvm 1    |      at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:458)
jvm 1    |      at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
jvm 1    |      at java.lang.Thread.run(Thread.java:748)
jvm 1    | Caused by: java.io.StreamCorruptedException: invalid internal transport message format, got (48,54,54,50)
jvm 1    |      at org.elasticsearch.transport.TcpTransport.validateMessageHeader(TcpTransport.java:1276)
jvm 1    |      at org.elasticsearch.transport.netty4.Netty4SizeHeaderFrameDecoder.decode(Netty4SizeHeaderFrameDecoder.java:36)
jvm 1    |      at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:489)
jvm 1    |      at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:428)
jvm 1    |      ... 19 common frames omitted

Any ideas as to what is happening? Thanks.

Upvotes: 3

Views: 3215

Answers (3)

Anthony Piñero
Anthony Piñero

Reputation: 666

On Windows, you can try killing the process:

netstat -ano | findstr :PORT_NUMBER

then with the PID do next:

taskkill /PID PID /F

in some cases like gitbash double slash is necessary

taskkill //PID PID //F

Upvotes: 0

Indika R
Indika R

Reputation: 61

I also encountered the same issue. After some troubleshooting, realized that default Elasticsearch port use by SonarQube is already in use in my windows environment

Output of netstat -ao in COMMAND prompt

Proto  Local Address          Foreign Address      State           PID
TCP    0.0.0.0:9001           UserX:0              LISTENING       4

Here is the default Elasticsearch configuration section in sonar.properties

# Elasticsearch port. Default is 9001. Use 0 to get a free port.
# As a security precaution, should be blocked by a firewall and not exposed to the Internet.
# sonar.search.port=9001

So , I changed the Elasticsearch port in sonar.properties to 9005 and it worked like a charm. Also you can use the port 0 as instructed here to use a free port.

# Elasticsearch port. Default is 9001. Use 0 to get a free port.
# As a security precaution, should be blocked by a firewall and not exposed to the Internet.
sonar.search.port=9005

Upvotes: 4

Ian Rowlands
Ian Rowlands

Reputation: 173

The error was due to the ElasicSearch port conflicting with another port. I reconfigured it to use a free port (seeing it to 0) and everything worked fine.

Upvotes: 8

Related Questions