Unable to upgrade sonarqube from version 5 to version 8

I see the below error in logs when I try to start sonarqube version 8.

[xyz@x11059pzz linux-x86-64]$ ./sonar.sh status
SonarQube is running (54203).

It started once and again went down.

Caused by: org.elasticsearch.transport.TransportException: handshake failed because connection reset
        ... 65 common frames omitted
2021.04.10 23:23:24 DEBUG app[][o.s.a.e.EsConnectorImpl] Connected to Elasticsearch node: [127.0.0.1:9001]
2021.04.10 23:23:29 WARN  app[][o.e.t.TcpTransport] exception caught on transport layer [Netty4TcpChannel{localAddress=/127.0.0.1:58066, remoteAddress=/127.0.0.1:9001}], closing connection
java.io.IOException: Invalid string; unexpected character: 253 hex: fd
        at org.elasticsearch.common.io.stream.StreamInput.readString(StreamInput.java:402)
        at org.elasticsearch.common.util.concurrent.ThreadContext$ThreadContextStruct.<init>(ThreadContext.java:419)
        at org.elasticsearch.common.util.concurrent.ThreadContext$ThreadContextStruct.<init>(ThreadContext.java:409)
        at org.elasticsearch.common.util.concurrent.ThreadContext.readHeaders(ThreadContext.java:236)
        at org.elasticsearch.transport.InboundMessage$Reader.deserialize(InboundMessage.java:98)
        at org.elasticsearch.transport.TcpTransport.messageReceived(TcpTransport.java:927)
        at org.elasticsearch.transport.TcpTransport.inboundMessage(TcpTransport.java:763)
        at org.elasticsearch.transport.netty4.Netty4MessageChannelHandler.channelRead(Netty4MessageChannelHandler.java:53)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
        at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:323)
        at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:297)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
        at io.netty.handler.logging.LoggingHandler.channelRead(LoggingHandler.java:241)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
        at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1434)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
        at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:965)
        at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)
        at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:656)
        at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:591)
        at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:508)
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:470)
        at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:909)
        at java.base/java.lang.Thread.run(Thread.java:834)
2021.04.10 23:23:29 DEBUG app[][o.e.c.t.TransportClientNodesService] failed to connect to node [{#transport#-1}{up3fTd6KSECE13q2U3lnkQ}{127.0.0.1}{127.0.0.1:9001}], ignoring...
org.elasticsearch.transport.ConnectTransportException: [][127.0.0.1:9001] general node connection failure
        at org.elasticsearch.transport.TcpTransport$ChannelsConnectedListener$1.onFailure(TcpTransport.java:1294)
        at org.elasticsearch.transport.TransportHandshaker$HandshakeResponseHandler.handleLocalException(TransportHandshaker.java:155)
        at org.elasticsearch.transport.TransportHandshaker.lambda$sendHandshake$0(TransportHandshaker.java:67)
        at org.elasticsearch.action.ActionListener.lambda$wrap$0(ActionListener.java:83)
        at org.elasticsearch.action.ActionListener$1.onResponse(ActionListener.java:61)
        at org.elasticsearch.action.ActionListener.lambda$toBiConsumer$2(ActionListener.java:97)
        at org.elasticsearch.common.concurrent.CompletableContext.lambda$addListener$0(CompletableContext.java:39)
        at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:859)
        at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:837)
        at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
        at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2073)
        at org.elasticsearch.common.concurrent.CompletableContext.complete(CompletableContext.java:61)
        at org.elasticsearch.transport.netty4.Netty4TcpChannel.lambda$new$0(Netty4TcpChannel.java:51)
        at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:511)
        at io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:504)
        at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:483)
        at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:424)
        at io.netty.util.concurrent.DefaultPromise.trySuccess(DefaultPromise.java:103)
        at io.netty.channel.DefaultChannelPromise.trySuccess(DefaultChannelPromise.java:84)
        at io.netty.channel.AbstractChannel$CloseFuture.setClosed(AbstractChannel.java:1152)
        at io.netty.channel.AbstractChannel$AbstractUnsafe.doClose0(AbstractChannel.java:768)
        at io.netty.channel.AbstractChannel$AbstractUnsafe.close(AbstractChannel.java:744)
        at io.netty.channel.AbstractChannel$AbstractUnsafe.close(AbstractChannel.java:615)
        at io.netty.channel.DefaultChannelPipeline$HeadContext.close(DefaultChannelPipeline.java:1376)
        at io.netty.channel.AbstractChannelHandlerContext.invokeClose(AbstractChannelHandlerContext.java:624)
        at io.netty.channel.AbstractChannelHandlerContext.close(AbstractChannelHandlerContext.java:608)
        at io.netty.handler.logging.LoggingHandler.close(LoggingHandler.java:217)
        at io.netty.channel.AbstractChannelHandlerContext.invokeClose(AbstractChannelHandlerContext.java:624)
        at io.netty.channel.AbstractChannelHandlerContext.close(AbstractChannelHandlerContext.java:608)
        at io.netty.channel.ChannelDuplexHandler.close(ChannelDuplexHandler.java:73)
        at io.netty.channel.AbstractChannelHandlerContext.invokeClose(AbstractChannelHandlerContext.java:624)
        at io.netty.channel.AbstractChannelHandlerContext.close(AbstractChannelHandlerContext.java:608)
        at io.netty.channel.AbstractChannelHandlerContext.close(AbstractChannelHandlerContext.java:465)
        at io.netty.channel.DefaultChannelPipeline.close(DefaultChannelPipeline.java:1003)
        at io.netty.channel.AbstractChannel.close(AbstractChannel.java:242)
        at org.elasticsearch.transport.netty4.Netty4TcpChannel.close(Netty4TcpChannel.java:80)
        at org.elasticsearch.core.internal.io.IOUtils.close(IOUtils.java:103)
        at org.elasticsearch.core.internal.io.IOUtils.close(IOUtils.java:85)
        at org.elasticsearch.common.network.CloseableChannel.closeChannels(CloseableChannel.java:89)
        at org.elasticsearch.common.network.CloseableChannel.closeChannel(CloseableChannel.java:78)
        at org.elasticsearch.common.network.CloseableChannel.closeChannel(CloseableChannel.java:68)
        at org.elasticsearch.transport.TcpTransport.onException(TcpTransport.java:627)
        at org.elasticsearch.transport.TcpTransport.inboundMessage(TcpTransport.java:768)
        at org.elasticsearch.transport.netty4.Netty4MessageChannelHandler.channelRead(Netty4MessageChannelHandler.java:53)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
        at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:323)
        at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:297)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
        at io.netty.handler.logging.LoggingHandler.channelRead(LoggingHandler.java:241)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
        at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1434)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
        at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:965)
        at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)
        at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:656)
        at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:591)
        at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:508)
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:470)
        at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:909)
        at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: org.elasticsearch.transport.TransportException: handshake failed because connection reset
        ... 65 common frames omitted

Hey there.

Just to confirm – what version of SonarQube are you starting at (down to the minor version)?

Are you first upgrading to SonarQube v6.7 LTS (or v5.6 LTS if your current version is not v5.6). You must upgrade from LTS to LTS until you hit a non-LTS version – you cannot upgrade directly from v5 to v8.8 :slight_smile:

And for good measure, have you stopped your original SonarQube instance before starting the new one?

Hi Colin!

Thanks for your feedback. I will try to follow your points and get back to you again :slight_smile:

And I am trying to upgrade from version 5.1.2 to latest version 8. So for that how would I need to go, will it be like from v5.2–> v5.6–> v6–> v7–> v8?

Please suggest. And I am not finding v5.6 or older version anywhere?

1 Like

Get your downloads here Download | SonarQube you need to hit
‘Historical Downloads’ / Show all versions

You need to go =

SQ 5.1.2 > SQ 5.6.7 > SQ 6.7.7 > SQ 7.9.6 (the download page has 7.9.5 as LTS but Sonarsource
Jira has already 7.9.6 with status released) > SQ 8.8
Historical downloads has the LTS versions marked with (former LTS)

1 Like

Thankyou so much… I will try this now and let you know :slight_smile:

Now it is giving me this error now -

[appadm@xpzz linux-x86-64] ./sonar.sh console Running SonarQube... 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 | jvm 1 | WARNING - Unable to load the Wrapper's native library 'libwrapper.so'. jvm 1 | The file is located on the path at the following location but jvm 1 | could not be loaded: jvm 1 | /opt/sonarqube-5.6.7/bin/linux-x86-64/./lib/libwrapper.so jvm 1 | Please verify that the file is readable by the current user jvm 1 | and that the file has not been corrupted in any way. jvm 1 | One common cause of this problem is running a 32-bit version jvm 1 | of the Wrapper with a 64-bit version of Java, or vica versa. jvm 1 | This is a 32-bit JVM. jvm 1 | Reported cause: jvm 1 | /opt/sonarqube-5.6.7/bin/linux-x86-64/lib/libwrapper.so: /opt/sonarqube-5.6.7/bin/linux-x86-64/lib/libwrapper.so: wrong ELF class: ELFCLASS64 (Possible cause: architecture word width mismatch) jvm 1 | System signals will not be handled correctly. jvm 1 | jvm 1 | WrapperSimpleApp: Unable to locate the class org.sonar.application.App: java.lang.UnsupportedClassVersionError: org/sonar/application/App : Unsupported major.minor version 52.0 jvm 1 | jvm 1 | WrapperSimpleApp Usage: jvm 1 | java org.tanukisoftware.wrapper.WrapperSimpleApp {app_class} [app_arguments] jvm 1 | jvm 1 | Where: jvm 1 | app_class: The fully qualified class name of the application to run. jvm 1 | app_arguments: The arguments that would normally be passed to the jvm 1 | application. wrapper | <-- Wrapper Stopped [appadm@xpzz linux-x86-64] ./sonar.sh status
SonarQube is not running.

Sonarqube is compiled with Java 8 but it seems you’re using a 32bit Java version < 8 instead
of a 64bit Java 8.
You need to check your Java installation.