Having problems upgrading SonarQube 6.5 to 6.7.1 on RHEL 7

384 views
Skip to first unread message

blin...@gmail.com

unread,
Jan 16, 2018, 12:24:34 AM1/16/18
to SonarQube
Hi All,

First time poster here - Middleware admin tasked with upgrading SonarQube 6.5 to 6.7.1. I originally installed 6.5 so I know basically how things are setup. 

I have followed the upgrade procedure detailed on the SonarQube site and have come across the following issue when I try to start the new version. The sonar.log file shows that SonarQube tries to start but is unable to as it cannot find or load the main class -XX:+UseConcMarkSweepGC.

the log file is shown below:

--> 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.

2018.01.16 15:14:58 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /apps/sonarqube-6.7.1/temp
2018.01.16 15:14:58 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
2018.01.16 15:14:58 INFO  app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/apps/sonarqube-6.7.1/elasticsearch]: /apps/sonarqube-6.7.1/elasticsearch/bin/elasticsearch -Epath.conf=/apps/sonarqube-6.7.1/temp/conf/es
2018.01.16 15:14:58 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
Error: Could not find or load main class ^[[01;31m^[[K-^[[m^[[KXX:+UseConcMarkSweepGC
2018.01.16 15:14:58 WARN  app[][o.s.a.p.AbstractProcessMonitor] Process exited with exit value [es]: 1
2018.01.16 15:14:58 INFO  app[][o.s.a.SchedulerImpl] Process [es] is stopped
2018.01.16 15:14:58 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped
FATAL StatusLogger Interrupted before Log4j Providers could be loaded.
 java.lang.InterruptedException
    at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireInterruptibly(AbstractQueuedSynchronizer.java:1220)
    at java.util.concurrent.locks.ReentrantLock.lockInterruptibly(ReentrantLock.java:335)
    at org.apache.logging.log4j.util.ProviderUtil.lazyInit(ProviderUtil.java:121)
    at org.apache.logging.log4j.util.ProviderUtil.hasProviders(ProviderUtil.java:108)
    at org.apache.logging.log4j.LogManager.<clinit>(LogManager.java:89)
    at org.elasticsearch.common.logging.ESLoggerFactory.getLogger(ESLoggerFactory.java:54)
    at org.elasticsearch.common.logging.Loggers.getLogger(Loggers.java:105)
    at org.elasticsearch.common.logging.Loggers.getLogger(Loggers.java:72)
    at org.elasticsearch.common.component.AbstractComponent.<init>(AbstractComponent.java:37)
    at org.elasticsearch.plugins.PluginsService.<init>(PluginsService.java:97)
    at org.elasticsearch.client.transport.TransportClient.newPluginService(TransportClient.java:101)
    at org.elasticsearch.client.transport.TransportClient.buildTemplate(TransportClient.java:126)
    at org.elasticsearch.client.transport.TransportClient.<init>(TransportClient.java:254)
    at org.sonar.application.process.EsProcessMonitor$MinimalTransportClient.<init>(EsProcessMonitor.java:109)
    at org.sonar.application.process.EsProcessMonitor.buildTransportClient(EsProcessMonitor.java:175)
    at org.sonar.application.process.EsProcessMonitor.getTransportClient(EsProcessMonitor.java:160)
    at org.sonar.application.process.EsProcessMonitor.checkStatus(EsProcessMonitor.java:134)
    at org.sonar.application.process.EsProcessMonitor.checkOperational(EsProcessMonitor.java:93)
    at org.sonar.application.process.EsProcessMonitor.isOperational(EsProcessMonitor.java:78)
    at org.sonar.application.process.SQProcess.refreshState(SQProcess.java:162)
    at org.sonar.application.process.SQProcess$EventWatcher.run(SQProcess.java:221)
ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console...
2018.01.16 15:14:59 DEBUG app[][o.s.a.p.EsProcessMonitor] Connected to Elasticsearch node: [127.0.0.1:9001]
<-- Wrapper Stopped

If I try to start version 6.5 up it comes up with no problems, also this upgrade is in a production environment and our only instance of SonarQube running on RHEL 7, the other instance I have upgraded from 6.5 to 6.7.1 is on RHEL6.
The applications does not get far enough into the start up to write to the ce.log. web.log or es.log files.

I have tried pre-setting the classpath in the startup script as well in the environment profile.

Any help would be appreciated

Thanks

Dale


Sebastien Lesaint

unread,
Jan 16, 2018, 10:52:01 AM1/16/18
to blin...@gmail.com, SonarQube
Hello,

Given the following log which appears the extract you posted:

Error: Could not find or load main class ^[[01;31m^[[K-^[[m^[[KXX:+UseConcMarkSweepGC

My guess is that you specified some values for properties "sonar.search.javaOpts" and/or "sonar.search.javaAdditionalOpts" in "sonar.properties" and this is causing an incorrect command line to be generated to try and start Elastic.
More specifically, one of them or both have those funny chars "^[[01;31m^[[K-^[[m^[[K".

Have a look and clean your sonar.properties.

Cheers,

Sébastien LESAINT | SonarSource
Platform Developer

--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/0fed0cb0-510e-48bf-ab05-d2021379de27%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dale Stewart

unread,
Jan 16, 2018, 7:20:19 PM1/16/18
to Sebastien Lesaint, SonarQube
Thanks Sébastien,

I had another set of eyes have a look at the problem.

It appears that in the new version of sonarqube that the jvm configuration file that sonarqube builds for elastic search is not being parsed correctly on RHEL 7:

We put this into the elasticsearch executable shell

ES_JAVA_OPTS="$(parse_jvm_options "$ES_JVM_OPTIONS") $ES_JAVA_OPTS"

echo
echo "Post ES_JAVA_OPTS"
echo "$ES_JAVA_OPTS"
echo

and got:

ES_JAVA_OPTS
^[[01;31m^[[K-^[[m^[[KXX:+UseConcMarkSweepGC ^[[01;31m^[[K-^[[m^[[KXX:CMSInitiatingOccupancyFraction=75 ^[[01;31m^[[K-^[[m^[[KXX:+UseCMSInitiatingOccupancyOnly ^[[01;31m^[[K-^[[m^[[KXX:+AlwaysPreTouch ^[[01;31m^[[K-^[[m^[[Kserver ^[[01;31m^[[K-^[[m^[[KXss1m ^[[01;31m^[[K-^[[m^[[KDjava.awt.headless=true ^[[01;31m^[[K-^[[m^[[KDfile.encoding=UTF-8 ^[[01;31m^[[K-^[[m^[[KDjna.nosys=true ^[[01;31m^[[K-^[[m^[[KDjdk.io.permissionsUseCanonicalPath=true ^[[01;31m^[[K-^[[m^[[KDio.netty.noUnsafe=true ^[[01;31m^[[K-^[[m^[[KDio.netty.noKeySetOptimization=true ^[[01;31m^[[K-^[[m^[[KDio.netty.recycler.maxCapacityPerThread=0 ^[[01;31m^[[K-^[[m^[[KDlog4j.shutdownHookEnabled=false ^[[01;31m^[[K-^[[m^[[KDlog4j2.disable.jmx=true ^[[01;31m^[[K-^[[m^[[KDlog4j.skipJansi=true ^[[01;31m^[[K-^[[m^[[KXms512m ^[[01;31m^[[K-^[[m^[[KXmx512m ^[[01;31m^[[K-^[[m^[[KXX:+HeapDumpOnOutOfMemoryError


We had to add 

ES_JAVA_OPTS="-XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+AlwaysPreTouch -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 -Xms512m -Xmx512m -XX:+HeapDumpOnOutOfMemoryError"

Which then let us bring up SonarQube.

Just thought I would let you know in case someone else has this problem

Thanks for your help

Regards

Dale

Sebastien Lesaint

unread,
Jan 17, 2018, 4:17:43 AM1/17/18
to SonarQube
Hello,

I'm glad you found the cause of your error and SQ is now running for you.

Please be aware that using "ES_JVM_OPTIONS" is not supported by SonarQube to command line arguments for the ES JVM. Only sonar.search.javaOpts and sonar.search.javaAdditionalOpts in sonar.properties should be used.

Usage of ES_JVM_OPTIONS will be prevented in futur versions (see SONAR-10294).

Cheers,

Sébastien LESAINT | SonarSource
Platform Developer

On 17 January 2018 at 01:19, Dale Stewart <blin...@gmail.com> wrote:
Thanks Sébastien,

I had another set of eyes have a look at the problem.

It appears that in the new version of sonarqube that the jvm configuration file that sonarqube builds for elastic search is not being parsed correctly on RHEL 7:

We put this into the elasticsearch executable shell

ES_JAVA_OPTS="$(parse_jvm_options "$ES_JVM_OPTIONS") $ES_JAVA_OPTS"

echo
echo "Post ES_JAVA_OPTS"
echo "$ES_JAVA_OPTS"
echo

and got:

ES_JAVA_OPTS
^[[01;31m^[[K-^[[m^[[KXX:+UseConcMarkSweepGC ^[[01;31m^[[K-^[[m^[[KXX:CMSInitiatingOccupancyFraction=75 ^[[01;31m^[[K-^[[m^[[KXX:+UseCMSInitiatingOccupancyOnly ^[[01;31m^[[K-^[[m^[[KXX:+AlwaysPreTouch ^[[01;31m^[[K-^[[m^[[Kserver ^[[01;31m^[[K-^[[m^[[KXss1m ^[[01;31m^[[K-^[[m^[[KDjava.awt.headless=true ^[[01;31m^[[K-^[[m^[[KDfile.encoding=UTF-8 ^[[01;31m^[[K-^[[m^[[KDjna.nosys=true ^[[01;31m^[[K-^[[m^[[KDjdk.io.permissionsUseCanonicalPath=true ^[[01;31m^[[K-^[[m^[[KDio.netty.noUnsafe=true ^[[01;31m^[[K-^[[m^[[KDio.netty.noKeySetOptimization=true ^[[01;31m^[[K-^[[m^[[KDio.netty.recycler.maxCapacityPerThread=0 ^[[01;31m^[[K-^[[m^[[KDlog4j.shutdownHookEnabled=false ^[[01;31m^[[K-^[[m^[[KDlog4j2.disable.jmx=true ^[[01;31m^[[K-^[[m^[[KDlog4j.skipJansi=true ^[[01;31m^[[K-^[[m^[[KXms512m ^[[01;31m^[[K-^[[m^[[KXmx512m ^[[01;31m^[[K-^[[m^[[KXX:+HeapDumpOnOutOfMemoryError


We had to add 

ES_JAVA_OPTS="-XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+AlwaysPreTouch -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 -Xms512m -Xmx512m -XX:+HeapDumpOnOutOfMemoryError"

Which then let us bring up SonarQube.

Just thought I would let you know in case someone else has this problem

Thanks for your help

Regards

Dale
Reply all
Reply to author
Forward
0 new messages