how to launch sonarqube? - elasticsearch

for my studies I need to install sonarqube on an ubuntu server.
I installed it following this tutorial : http://www.naturalborncoder.com/methodology/2015/05/27/sonarqube-on-ubuntu-14-04/ (I stopped before the proxying part) but I can't access to 127.0.0.1:9000. From the logs it look like there is a problem with elasticsearch when i launch sonarcube.
/opt/sonar/log/sonar.log :
--> 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.11.14 18:21:11 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonar/temp
2017.11.14 18:21:11 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
2017.11.14 18:21:11 INFO app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonar/elasticsearch]: /opt/sonar/elasticsearch/bin/elasticsearch -Epath.conf=/opt/sonar/temp/conf/es
2017.11.14 18:21:11 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2017.11.14 18:21:13 INFO app[][o.e.p.PluginsService] no modules loaded
2017.11.14 18:21:13 INFO app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
java.security.policy: error adding Entry:
java.net.MalformedURLException: no protocol: ${codebase.elasticsearch-rest-client}
java.security.policy: error adding Entry:
java.net.MalformedURLException: no protocol: ${codebase.httpasyncclient-4.1.2.jar}
java.security.policy: error adding Entry:
java.net.MalformedURLException: no protocol: ${codebase.netty-common-4.1.13.Final.jar}
java.security.policy: error adding Entry:
java.net.MalformedURLException: no protocol: ${codebase.netty-transport-4.1.13.Final.jar}
java.security.policy: error adding Entry:
java.net.MalformedURLException: no protocol: ${codebase.securesm-1.1.jar}
java.security.policy: error adding Entry:
java.net.MalformedURLException: no protocol: ${codebase.lucene-core-6.6.1.jar}
java.security.policy: error adding Entry:
java.net.MalformedURLException: no protocol: ${codebase.lucene-misc-6.6.1.jar}
2017.11.14 18:21:27 WARN app[][o.s.a.p.AbstractProcessMonitor] Process exited with exit value [es]: 1
2017.11.14 18:21:27 INFO app[][o.s.a.SchedulerImpl] Process [es] is stopped
2017.11.14 18:21:27 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped
<-- Wrapper Stopped
/opt/sonar/logs/es.log :
2017.11.14 18:21:24 INFO es[][o.e.n.Node] initializing ...
2017.11.14 18:21:24 INFO es[][o.e.e.NodeEnvironment] using [1] data paths, mounts [[/ (/dev/vda1)]], net usable_space [5.7gb], net total_space [9.6gb], spins? [possibly], types [ext4]
2017.11.14 18:21:24 INFO es[][o.e.e.NodeEnvironment] heap size [503.6mb], compressed ordinary object pointers [true]
2017.11.14 18:21:24 INFO es[][o.e.n.Node] node name [sonarqube], node ID [3PxDbRbDQ4-M_YDsv25FHg]
2017.11.14 18:21:24 INFO es[][o.e.n.Node] version[5.6.3], pid[8661], build[1a2f265/2017-10-06T20:33:39.012Z], OS[Linux/4.4.0-22-generic/amd64], JVM[Oracle Corporation/OpenJDK 64-Bit Server VM/9-internal/9-internal+0-2016-04-14-195246.b$
2017.11.14 18:21:24 INFO es[][o.e.n.Node] JVM arguments [-XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, $
2017.11.14 18:21:26 INFO es[][o.e.p.PluginsService] loaded module [aggs-matrix-stats]
2017.11.14 18:21:26 INFO es[][o.e.p.PluginsService] loaded module [ingest-common]
2017.11.14 18:21:26 INFO es[][o.e.p.PluginsService] loaded module [parent-join]
2017.11.14 18:21:26 INFO es[][o.e.p.PluginsService] loaded module [percolator]
2017.11.14 18:21:26 INFO es[][o.e.p.PluginsService] loaded module [reindex]
2017.11.14 18:21:26 INFO es[][o.e.p.PluginsService] loaded module [transport-netty4]
2017.11.14 18:21:26 INFO es[][o.e.p.PluginsService] no plugins loaded
2017.11.14 18:21:27 ERROR es[][o.e.b.ElasticsearchUncaughtExceptionHandler] fatal error in thread [main], exiting
java.lang.ExceptionInInitializerError: null
at org.apache.lucene.analysis.miscellaneous.StemmerOverrideFilter$Builder.build(StemmerOverrideFilter.java:205) ~[lucene-analyzers-common-6.6.1.jar:6.6.1 9aa465a89b64ff2dabe7b4d50c472de32c298683 - varunthacker - 2017-08-29 21:55$
at org.apache.lucene.analysis.nl.DutchAnalyzer.<init>(DutchAnalyzer.java:133) ~[lucene-analyzers-common-6.6.1.jar:6.6.1 9aa465a89b64ff2dabe7b4d50c472de32c298683 - varunthacker - 2017-08-29 21:55:17]
at org.apache.lucene.analysis.nl.DutchAnalyzer.<init>(DutchAnalyzer.java:106) ~[lucene-analyzers-common-6.6.1.jar:6.6.1 9aa465a89b64ff2dabe7b4d50c472de32c298683 - varunthacker - 2017-08-29 21:55:17]
at org.elasticsearch.indices.analysis.PreBuiltAnalyzers$20.create(PreBuiltAnalyzers.java:246) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.indices.analysis.PreBuiltAnalyzers.getAnalyzer(PreBuiltAnalyzers.java:487) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.index.analysis.AnalysisRegistry$PrebuiltAnalysis.<init>(AnalysisRegistry.java:407) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.index.analysis.AnalysisRegistry$PrebuiltAnalysis.<init>(AnalysisRegistry.java:392) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.index.analysis.AnalysisRegistry.<init>(AnalysisRegistry.java:62) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.indices.analysis.AnalysisModule.<init>(AnalysisModule.java:177) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.node.Node.<init>(Node.java:340) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.node.Node.<init>(Node.java:245) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:233) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:233) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:342) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:132) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:123) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:70) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:134) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:84) ~[elasticsearch-5.6.3.jar:5.6.3]
Caused by: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessDeclaredMembers")
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:468) ~[?:?]
at java.security.AccessController.checkPermission(AccessController.java:894) ~[?:?]
at java.lang.SecurityManager.checkPermission(SecurityManager.java:541) ~[?:?]
at java.lang.Class.checkMemberAccess(Class.java:2584) ~[?:?]
at java.lang.Class.getDeclaredFields(Class.java:2092) ~[?:?]
at org.apache.lucene.util.RamUsageEstimator$1.run(RamUsageEstimator.java:339) ~[lucene-core-6.6.1.jar:6.6.1 9aa465a89b64ff2dabe7b4d50c472de32c298683 - varunthacker - 2017-08-29 21:54:39]
at org.apache.lucene.util.RamUsageEstimator$1.run(RamUsageEstimator.java:336) ~[lucene-core-6.6.1.jar:6.6.1 9aa465a89b64ff2dabe7b4d50c472de32c298683 - varunthacker - 2017-08-29 21:54:39]
at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
at org.apache.lucene.util.RamUsageEstimator.shallowSizeOfInstance(RamUsageEstimator.java:336) ~[lucene-core-6.6.1.jar:6.6.1 9aa465a89b64ff2dabe7b4d50c472de32c298683 - varunthacker - 2017-08-29 21:54:39]
at org.apache.lucene.util.RamUsageEstimator.shallowSizeOf(RamUsageEstimator.java:313) ~[lucene-core-6.6.1.jar:6.6.1 9aa465a89b64ff2dabe7b4d50c472de32c298683 - varunthacker - 2017-08-29 21:54:39]
at org.apache.lucene.util.fst.ByteSequenceOutputs.<clinit>(ByteSequenceOutputs.java:154) ~[lucene-core-6.6.1.jar:6.6.1 9aa465a89b64ff2dabe7b4d50c472de32c298683 - varunthacker - 2017-08-29 21:54:39]
... 21 more
java -version :
OpenJDK Runtime Environment (build 1.8.0_151-8u151-b12-0ubuntu0.16.04.2-b12)
OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode)
sonarqube version : 6.7
I launch sonarqube as root so there should not have problem coming from access right.
All the post that i find about this error where related with openjdk9 but this is not my case.
Do you have an idea of what is happening ?

SonarQube 6.7 includes an upgraded version of Elasticsearch which cannot be run as root. Thus, SonarQube can no longer be run as root.
The blog post you followed seems to recommend / assume that you're running as root. To not start SonarQube as root, simply end your su session, or log back in as yourself to start the process. Note that you'll need to make sure the user you are starting SonarQube as has 7 (read, write, execute) on the SonarQube directory, recursively, and 6 (read, write) on the log files if they already exist.

In my case, the Java version was the problem.
I installed Oracle JDK 8 for for sonarcube 6.7.1, which resolved the problem:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
You can read more about the supported platforms here. For now, only Java 8 is supported.

I got the following error in cmd:
INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up
and running INFO app[][o.e.p.PluginsService] no modules loaded INFO
app[][o.e.p.PluginsService] loaded plugin
[org.elasticsearch.transport.Netty4Plugin] WARN
app[][o.s.a.p.AbstractProcessMonitor] Process exited with exit value
[es]: 1 INFO app[][o.s.a.SchedulerImpl] Process [es] is stopped INFO
app[][o.s.a.SchedulerImpl] SonarQube is stopped
It had problems setting up Elasticsearch on its default port number 9001. (You can check it in the logs folder: .\sonarqube-7.6\logs)
I just changed the port number from 9001 to 0 in the sonarqube properties file.
Go to- .\sonarqube-7.6\conf\sonar.properties and set sonar.search.port=0
Port 0 takes any port which is unused.
Good luck with the changes

Related

sonarqube keeps stopping the moment it starts running

I'm Using Windows 10, Java 11, sonarqube-9.8.0.63668, jdk-11.0.11. I'm quite new to sonarqube, so please tell me if there is any more information that you might need.
Starting the sonarservice used to work fine. I am not sure what is wrong (I haven't changed anything in the .properties file).
I start the service by using command prompt to run the startsonar.bat file
This is what happens when I start the service in command prompt:
C:\Users\mayhe\Documents\sonarqube-9.8.0.63668\sonarqube-9.8.0.63668\bin\windows-x86-64>startsonar.bat Starting SonarQube... 2023.02.19 04:48:52 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory C:\Users\mayhe\Documents\sonarqube-9.8.0.63668\sonarqube-9.8.0.63668\temp 2023.02.19 04:48:52 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on [HTTP: 127.0.0.1:9001, TCP: 127.0.0.1:63759] 2023.02.19 04:48:52 INFO app[][o.s.a.ProcessLauncherImpl] Launch process[ELASTICSEARCH] from [C:\Users\mayhe\Documents\sonarqube-9.8.0.63668\sonarqube-9.8.0.63668\elasticsearch]: C:\Program Files\Eclipse Adoptium\jdk-17.0.5.8-hotspot\bin\java -XX:+UseG1GC -Djava.io.tmpdir=C:\Users\mayhe\Documents\sonarqube-9.8.0.63668\sonarqube-9.8.0.63668\temp -XX:ErrorFile=../logs/es_hs_err_pid%p.log -Des.networkaddress.cache.ttl=60 -Des.networkaddress.cache.negative.ttl=10 -XX:+AlwaysPreTouch -Xss1m -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djna.nosys=true -Djna.tmpdir=C:\Users\mayhe\Documents\sonarqube-9.8.0.63668\sonarqube-9.8.0.63668\temp -XX:-OmitStackTraceInFastThrow -Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true -Dio.netty.recycler.maxCapacityPerThread=0 -Dio.netty.allocator.numDirectArenas=0 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -Dlog4j2.formatMsgNoLookups=true -Djava.locale.providers=COMPAT -Dcom.redhat.fips=false -Xmx512m -Xms512m -XX:MaxDirectMemorySize=256m -XX:+HeapDumpOnOutOfMemoryError -Delasticsearch -Des.path.home=C:\Users\mayhe\Documents\sonarqube-9.8.0.63668\sonarqube-9.8.0.63668\elasticsearch -Des.path.conf=C:\Users\mayhe\Documents\sonarqube-9.8.0.63668\sonarqube-9.8.0.63668\temp\conf\es -cp lib/* org.elasticsearch.bootstrap.Elasticsearch 2023.02.19 04:48:52 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running 2023.02.19 04:49:13 INFO app[][o.s.a.SchedulerImpl] Process[es] is up 2023.02.19 04:49:13 INFO app[][o.s.a.ProcessLauncherImpl] Launch process[WEB_SERVER] from [C:\Users\mayhe\Documents\sonarqube-9.8.0.63668\sonarqube-9.8.0.63668]: C:\Program Files\Eclipse Adoptium\jdk-17.0.5.8-hotspot\bin\java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=C:\Users\mayhe\Documents\sonarqube-9.8.0.63668\sonarqube-9.8.0.63668\temp -XX:-OmitStackTraceInFastThrow --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED --add-exports=java.base/jdk.internal.ref=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.management/sun.management=ALL-UNNAMED --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED -Dcom.redhat.fips=false -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -Dhttp.nonProxyHosts=localhost|127.*|[::1] -cp ./lib/sonar-application-9.8.0.63668.jar;C:\Users\mayhe\Documents\sonarqube-9.8.0.63668\sonarqube-9.8.0.63668\lib\jdbc\h2\h2-2.1.214.jar org.sonar.server.app.WebServer C:\Users\mayhe\Documents\sonarqube-9.8.0.63668\sonarqube-9.8.0.63668\temp\sq-process18020723362913653070properties WARNING: A terminally deprecated method in java.lang.System has been called WARNING: System::setSecurityManager has been called by org.sonar.process.PluginSecurityManager (file:/C:/Users/mayhe/Documents/sonarqube-9.8.0.63668/sonarqube-9.8.0.63668/lib/sonar-application-9.8.0.63668.jar) WARNING: Please consider reporting this to the maintainers of org.sonar.process.PluginSecurityManager WARNING: System::setSecurityManager will be removed in a future release 2023.02.19 04:49:14 INFO app[][o.s.a.SchedulerImpl] Process[Web Server] is stopped 2023.02.19 04:49:14 INFO app[][o.s.a.SchedulerImpl] Process[ElasticSearch] is stopped 2023.02.19 04:49:14 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped
ce.log:
2023.02.04 05:11:37 WARN ce[][c.z.h.p.HikariPool] HikariPool-1 - Thread starvation or clock leap detected (housekeeper delta=16h46m27s756ms572µs900ns).
web.log:
2023.02.19 03:52:43 INFO web[][o.s.p.ProcessEntryPoint] Starting Web Server 2023.02.19 03:52:45 INFO web[][o.s.s.p.LogServerVersion] SonarQube Server / 9.8.0.63668 / 6498415c5112d868f6206d8bcc043a1dac92d1c4 2023.02.19 03:52:45 WARN web[][o.s.c.a.AnnotationConfigApplicationContext] Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader#659e0bfd-org.sonar.server.platform.db.EmbeddedDatabaseFactory': Initialization of bean failed; nested exception is java.lang.IllegalStateException: Unable to start database 2023.02.19 03:52:45 ERROR web[][o.s.s.p.PlatformImpl] Web server startup failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader#659e0bfd-org.sonar.server.platform.db.EmbeddedDatabaseFactory': Initialization of bean failed; nested exception is java.lang.IllegalStateException: Unable to start database at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:628) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:187) at org.sonar.server.platform.platformlevel.PlatformLevel.start(PlatformLevel.java:80) at org.sonar.server.platform.platformlevel.PlatformLevel1.start(PlatformLevel1.java:164) at org.sonar.server.platform.PlatformImpl.start(PlatformImpl.java:196) at org.sonar.server.platform.PlatformImpl.startLevel1Container(PlatformImpl.java:162) at org.sonar.server.platform.PlatformImpl.init(PlatformImpl.java:76) at org.sonar.server.platform.web.PlatformServletContextListener.contextInitialized(PlatformServletContextListener.java:43) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4764) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5222) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1393) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1383) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:145) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:916) at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:835) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1393) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1383) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:145) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:916) at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:265) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.StandardService.startInternal(StandardService.java:430) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.startup.Tomcat.start(Tomcat.java:486) at org.sonar.server.app.EmbeddedTomcat.start(EmbeddedTomcat.java:72) at org.sonar.server.app.WebServer.start(WebServer.java:55) at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:97) at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:81) at org.sonar.server.app.WebServer.main(WebServer.java:104) Caused by: java.lang.IllegalStateException: Unable to start database at org.sonar.server.platform.db.EmbeddedDatabase.startServer(EmbeddedDatabase.java:88) at org.sonar.server.platform.db.EmbeddedDatabase.start(EmbeddedDatabase.java:63) at org.sonar.server.platform.db.EmbeddedDatabaseFactory.start(EmbeddedDatabaseFactory.java:49) at org.sonar.core.platform.StartableBeanPostProcessor.postProcessBeforeInitialization(StartableBeanPostProcessor.java:33) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:440) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1796) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620) ... 44 common frames omitted Caused by: org.h2.jdbc.JdbcSQLNonTransientException: General error: "org.h2.mvstore.MVStoreException: Chunk 545 not found [2.1.214/9]" [50000-214] at org.h2.message.DbException.getJdbcSQLException(DbException.java:554) at org.h2.message.DbException.getJdbcSQLException(DbException.java:477) at org.h2.message.DbException.get(DbException.java:212) at org.h2.message.DbException.convert(DbException.java:395) at org.h2.engine.Database.<init>(Database.java:403) at org.h2.engine.Engine.openSession(Engine.java:92) at org.h2.engine.Engine.openSession(Engine.java:222) at org.h2.engine.Engine.createSession(Engine.java:201) at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:338) at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:122) at org.h2.Driver.connect(Driver.java:59) at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:681) at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:252) at org.sonar.server.platform.db.EmbeddedDatabase.createDatabase(EmbeddedDatabase.java:115) at org.sonar.server.platform.db.EmbeddedDatabase.startServer(EmbeddedDatabase.java:79) ... 50 common frames omitted Caused by: org.h2.mvstore.MVStoreException: Chunk 545 not found [2.1.214/9] at org.h2.mvstore.DataUtils.newMVStoreException(DataUtils.java:1004) at org.h2.mvstore.MVStore.getChunk(MVStore.java:1384) at org.h2.mvstore.MVStore.readPage(MVStore.java:2566) at org.h2.mvstore.MVMap.readPage(MVMap.java:633) at org.h2.mvstore.MVMap.readOrCreateRootPage(MVMap.java:658) at org.h2.mvstore.MVMap.setRootPos(MVMap.java:643) at org.h2.mvstore.MVStore.openMap(MVStore.java:702) at org.h2.mvstore.MVStore.openMap(MVStore.java:648) at org.h2.mvstore.tx.TransactionStore.openMap(TransactionStore.java:564) at org.h2.mvstore.db.LobStorageMap.<init>(LobStorageMap.java:136) at org.h2.engine.Database.<init>(Database.java:374) ... 60 common frames omitted Suppressed: java.lang.NullPointerException: Cannot invoke "org.h2.store.LobStorageInterface.close()" because "this.lobStorage" is null at org.h2.engine.Database.closeOpenFilesAndUnlock(Database.java:1252) at org.h2.engine.Database.<init>(Database.java:399) ... 60 common frames omitted 2023.02.19 03:52:46 INFO web[][o.s.s.a.EmbeddedTomcat] HTTP connector enabled on port 9000 2023.02.19 03:52:46 INFO web[][o.s.p.ProcessEntryPoint] Hard stopping process
es.log:
2023.02.19 03:52:29 INFO es[][o.e.n.Node] version[7.17.6], pid[11896], build[unknown/unknown/f65e9d338dc1d07b642e14a27f338990148ee5b6/2022-08-23T11:08:48.893373482Z], OS[Windows 10/10.0/amd64], JVM[Eclipse Adoptium/OpenJDK 64-Bit Server VM/17.0.5/17.0.5+8] 2023.02.19 03:52:29 INFO es[][o.e.n.Node] JVM home [C:\Program Files\Eclipse Adoptium\jdk-17.0.5.8-hotspot] 2023.02.19 03:52:29 INFO es[][o.e.n.Node] JVM arguments [-XX:+UseG1GC, -Djava.io.tmpdir=C:\Users\mayhe\Documents\sonarqube-9.8.0.63668\sonarqube-9.8.0.63668\temp, -XX:ErrorFile=../logs/es_hs_err_pid%p.log, -Des.networkaddress.cache.ttl=60, -Des.networkaddress.cache.negative.ttl=10, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -Djna.tmpdir=C:\Users\mayhe\Documents\sonarqube-9.8.0.63668\sonarqube-9.8.0.63668\temp, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dio.netty.allocator.numDirectArenas=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Dlog4j2.formatMsgNoLookups=true, -Djava.locale.providers=COMPAT, -Dcom.redhat.fips=false, -Xmx512m, -Xms512m, -XX:MaxDirectMemorySize=256m, -XX:+HeapDumpOnOutOfMemoryError, -Delasticsearch, -Des.path.home=C:\Users\mayhe\Documents\sonarqube-9.8.0.63668\sonarqube-9.8.0.63668\elasticsearch, -Des.path.conf=C:\Users\mayhe\Documents\sonarqube-9.8.0.63668\sonarqube-9.8.0.63668\temp\conf\es] 2023.02.19 03:52:30 INFO es[][o.e.p.PluginsService] loaded module [analysis-common] 2023.02.19 03:52:30 INFO es[][o.e.p.PluginsService] loaded module [lang-painless] 2023.02.19 03:52:30 INFO es[][o.e.p.PluginsService] loaded module [parent-join] 2023.02.19 03:52:30 INFO es[][o.e.p.PluginsService] loaded module [reindex] 2023.02.19 03:52:30 INFO es[][o.e.p.PluginsService] loaded module [transport-netty4] 2023.02.19 03:52:30 INFO es[][o.e.p.PluginsService] no plugins loaded 2023.02.19 03:52:30 INFO es[][o.e.e.NodeEnvironment] using [1] data paths, mounts [[Windows (C:)]], net usable_space [211gb], net total_space [455.2gb], types [NTFS] 2023.02.19 03:52:30 INFO es[][o.e.e.NodeEnvironment] heap size [512mb], compressed ordinary object pointers [true] 2023.02.19 03:52:31 INFO es[][o.e.n.Node] node name [sonarqube], node ID [X8-rPowaSL63lggYpofZqg], cluster name [sonarqube], roles [data_frozen, master, remote_cluster_client, data, data_content, data_hot, data_warm, data_cold, ingest] 2023.02.19 03:52:36 INFO es[][o.e.t.NettyAllocator] creating NettyAllocator with the following configs: [name=unpooled, suggested_max_allocation_size=256kb, factors={es.unsafe.use_unpooled_allocator=null, g1gc_enabled=true, g1gc_region_size=1mb, heap_size=512mb}] 2023.02.19 03:52:36 INFO es[][o.e.i.r.RecoverySettings] using rate limit [40mb] with [default=40mb, read=0b, write=0b, max=0b] 2023.02.19 03:52:36 INFO es[][o.e.d.DiscoveryModule] using discovery type [zen] and seed hosts providers [settings] 2023.02.19 03:52:37 INFO es[][o.e.g.DanglingIndicesState] gateway.auto_import_dangling_indices is disabled, dangling indices will not be automatically detected or imported and must be managed manually 2023.02.19 03:52:37 INFO es[][o.e.n.Node] initialized 2023.02.19 03:52:37 INFO es[][o.e.n.Node] starting ... 2023.02.19 03:52:37 INFO es[][o.e.t.TransportService] publish_address {127.0.0.1:61229}, bound_addresses {127.0.0.1:61229} 2023.02.19 03:52:40 INFO es[][o.e.c.c.Coordinator] cluster UUID [IMag8vk6RwirV2vDDPYE4A] 2023.02.19 03:52:40 INFO es[][o.e.c.s.MasterService] elected-as-master ([1] nodes joined)[{sonarqube}{X8-rPowaSL63lggYpofZqg}{9YWVEDtPSsy0Vr28ywzEow}{127.0.0.1}{127.0.0.1:61229}{cdfhimrsw} elect leader, _BECOME_MASTER_TASK_, _FINISH_ELECTION_], term: 113, version: 2234, delta: master node changed {previous [], current [{sonarqube}{X8-rPowaSL63lggYpofZqg}{9YWVEDtPSsy0Vr28ywzEow}{127.0.0.1}{127.0.0.1:61229}{cdfhimrsw}]} 2023.02.19 03:52:40 INFO es[][o.e.c.s.ClusterApplierService] master node changed {previous [], current [{sonarqube}{X8-rPowaSL63lggYpofZqg}{9YWVEDtPSsy0Vr28ywzEow}{127.0.0.1}{127.0.0.1:61229}{cdfhimrsw}]}, term: 113, version: 2234, reason: Publication{term=113, version=2234} 2023.02.19 03:52:40 INFO es[][o.e.h.AbstractHttpServerTransport] publish_address {127.0.0.1:9001}, bound_addresses {127.0.0.1:9001} 2023.02.19 03:52:40 INFO es[][o.e.n.Node] started 2023.02.19 03:52:40 INFO es[][o.e.g.GatewayService] recovered [7] indices into cluster_state 2023.02.19 03:52:43 INFO es[][o.e.c.r.a.AllocationService] Cluster health status changed from [RED] to [GREEN] (reason: [shards started [[components][2], [components][0], [metadatas][0]]]).
When I open up the localhost I get a "This site can’t be reached localhost refused to connect" error.
I have tried deleting some of the projects that I've already tried analyzing and played around a bit with the .properties file in the conf folder, but couldn't get anywhere. I have tried asking on the sonar community forum, I didn't receive any answer.
I have also tried re-extracting the files from the original zip that I downloaded and tried running the service using the "other" startsonar.bat file.
I was expecting the service to run as usual. I have no idea why, only since a few weeks ago, it started stopping itself immediately after starting
I just had the same issue. I found a solution to my issue.
SonarSource

Sonarqube can't be started in Ubuntu

When I tried to start the sonarqube it gives me following errors.
--> 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.
2019.08.19 17:30:23 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube/temp
2019.08.19 17:30:23 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
2019.08.19 17:30:23 INFO app[][o.s.a.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonarqube/elasticsearch]: /opt/sonarqube/elasticsearch/bin/elasticsearch
2019.08.19 17:30:23 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
2019.08.19 17:30:24 INFO app[][o.e.p.PluginsService] no modules loaded
2019.08.19 17:30:24 INFO app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2019.08.19 17:30:41 WARN app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [es]: 1
2019.08.19 17:30:41 INFO app[][o.s.a.SchedulerImpl] Process[es] is stopped
2019.08.19 17:30:41 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped
<-- Wrapper Stopped
I can't find any solution for this problem and I really need some help to run sonarqube. I might have done something wrong, but I've followed sonarqube documentation for installation.
And this is the es.log file
Server VM/11.0.4/11.0.4+11-post-Ubuntu-1ubuntu218.04.3]
2019.08.20 20:38:29 INFO es[][o.e.n.Node] JVM arguments [-XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -Des.networkaddress.cache.ttl=60, -Des.networkaddress.cache.negative.ttl=10, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Djava.io.tmpdir=/opt/sonarqube/temp, -XX:ErrorFile=../logs/es_hs_err_pid%p.log, -Des.enforce.bootstrap.checks=true, -Xms512m, -Xmx512m, -Des.path.home=/opt/sonarqube/elasticsearch, -Des.path.conf=/opt/sonarqube/temp/conf/es, -Des.distribution.flavor=default, -Des.distribution.type=tar]
2019.08.20 20:38:30 INFO es[][o.e.p.PluginsService] loaded module [analysis-common]
2019.08.20 20:38:30 INFO es[][o.e.p.PluginsService] loaded module [lang-painless]
2019.08.20 20:38:30 INFO es[][o.e.p.PluginsService] loaded module [mapper-extras]
2019.08.20 20:38:30 INFO es[][o.e.p.PluginsService] loaded module [parent-join]
2019.08.20 20:38:30 INFO es[][o.e.p.PluginsService] loaded module [percolator]
2019.08.20 20:38:30 INFO es[][o.e.p.PluginsService] loaded module [reindex]
2019.08.20 20:38:30 INFO es[][o.e.p.PluginsService] loaded module [repository-url]
2019.08.20 20:38:30 INFO es[][o.e.p.PluginsService] loaded module [transport-netty4]
2019.08.20 20:38:30 INFO es[][o.e.p.PluginsService] no plugins loaded
2019.08.20 20:38:34 WARN es[][o.e.d.c.s.Settings] [http.enabled] setting was deprecated in Elasticsearch and will be removed in a future release! See the breaking changes documentation for the next major version.
2019.08.20 20:38:36 INFO es[][o.e.d.DiscoveryModule] using discovery type [zen] and host providers [settings]
2019.08.20 20:38:36 INFO es[][o.e.n.Node] initialized
2019.08.20 20:38:36 INFO es[][o.e.n.Node] starting ...
2019.08.20 20:38:37 INFO es[][o.e.t.TransportService] publish_address {127.0.0.1:9001}, bound_addresses {127.0.0.1:9001}
2019.08.20 20:38:37 INFO es[][o.e.b.BootstrapChecks] explicitly enforcing bootstrap checks
2019.08.20 20:38:37 ERROR es[][o.e.b.Bootstrap] node validation exception
[1] bootstrap checks failed
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
2019.08.20 20:38:37 INFO es[][o.e.n.Node] stopping ...
2019.08.20 20:38:37 INFO es[][o.e.n.Node] stopped
2019.08.20 20:38:37 INFO es[][o.e.n.Node] closing ...
2019.08.20 20:38:37 INFO es[][o.e.n.Node] closed
Elasticsearch is not starting, see the logs :
2019.08.20 20:38:37 ERROR es[][o.e.b.Bootstrap] node validation exception
[1] bootstrap checks failed
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
And here is what they say in their doc:
Elasticsearch uses a lot of file descriptors or file handles. Running
out of file descriptors can be disastrous and will most probably lead
to data loss. Make sure to increase the limit on the number of open
files descriptors for the user running Elasticsearch to 65,536 or
higher.
Therefore you need to increase the limit:
For the .zip and .tar.gz packages, set ulimit -n 65535 as root before
starting Elasticsearch, or set nofile to 65535 in
/etc/security/limits.conf.
Solution is withing the sonar.service file which should be stayed in /etc/systemd/system.sonar.service
[Unit]
Description=SonarQube service
After=syslog.target network.target
[Service]
Type=simple
User=sonarqube
Group=sonarqube
PermissionsStartOnly=true
ExecStart=/bin/nohup /opt/java/bin/java -Xms32m -Xmx32m -Djava.net.preferIPv4Stack=true -jar /opt/sonarqube/lib/sonar-application-7.4.jar
StandardOutput=syslog
LimitNOFILE=65536
LimitNPROC=8192
TimeoutStartSec=5
Restart=always
[Install]
WantedBy=multi-user.target
You have to define the file limit on the service
You need to set fs.file-max to increase max file descriptors.
sysctl -w fs.file-max=65535
You're likely to also need to set the vm.max-map-count
sysctl -w vm.max_map_count=262144

SonarQube Stopping Unexpectedly on Windows

I'm trying to run SonarQube community edition on my local Windows pc. I launch it via the StartSonar.bat command, but it stops prematurely:
C:\dev\sonarqube-7.5\bin\windows-x86-64>StartSonar.bat
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 | 2019.01.18 23:20:47 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory C:\dev\sonarqube-7.5\temp
jvm 1 | 2019.01.18 23:20:47 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
jvm 1 | 2019.01.18 23:20:47 INFO app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [C:\dev\sonarqube-7.5\elasticsearch]: C:\Program Files\Java\jdk1.8.0_112\jre\bin\java -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 -Delasticsearch -Des.path.home=C:\dev\sonarqube-7.5\elasticsearch -cp lib/* org.elasticsearch.bootstrap.Elasticsearch -Epath.conf=C:\dev\sonarqube-7.5\temp\conf\es
jvm 1 | 2019.01.18 23:20:47 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
jvm 1 | 2019.01.18 23:20:48 INFO app[][o.e.p.PluginsService] no modules loaded
jvm 1 | 2019.01.18 23:20:48 INFO app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
jvm 1 | 2019.01.18 23:20:49 WARN app[][o.s.a.p.AbstractProcessMonitor] Process exited with exit value [es]: 1
jvm 1 | 2019.01.18 23:20:49 INFO app[][o.s.a.SchedulerImpl] Process [es] is stopped
jvm 1 | 2019.01.18 23:20:49 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped
wrapper | <-- Wrapper Stopped
C:\dev\sonarqube-7.5\bin\windows-x86-64>
Then I check the es log and it shows the following messages regarding not being able to obtain node locks. What does that mean and how do I resolve it?
2019.01.19 00:17:01 WARN es[][o.e.b.ElasticsearchUncaughtExceptionHandler] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: failed to obtain node locks, tried [[C:\dev\sonarqube-7.5\data\es5\sonarqube]] with lock id [0]; maybe these locations are not writable or multiple nodes were started without increasing [node.max_local_storage_nodes] (was [1])?
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:136) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:123) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:70) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:134) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:84) ~[elasticsearch-5.6.3.jar:5.6.3]
Caused by: java.lang.IllegalStateException: failed to obtain node locks, tried [[C:\dev\sonarqube-7.5\data\es5\sonarqube]] with lock id [0]; maybe these locations are not writable or multiple nodes were started without increasing [node.max_local_storage_nodes] (was [1])?
at org.elasticsearch.env.NodeEnvironment.<init>(NodeEnvironment.java:261) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.node.Node.<init>(Node.java:265) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.node.Node.<init>(Node.java:245) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:233) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:233) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:342) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:132) ~[elasticsearch-5.6.3.jar:5.6.3]
... 6 more
One suggestion I found was to run as a non root user. So I tried the approach described in the answer to this question, running StartSonar.bat as "Run without privilege escalation". Unfortunately, that gave me the same result - as did running run as /trustlevel:0x20000 StartSonar.bat.
Update: When I ran StartSonar.bat again later it worked fine. The es log suggested "multiple nodes" were started. Not sure about that, since localhost:9000 wasn't showing anything. But maybe there was a "collision" of some kind. I had actually previously run sonar from maven (sonar-maven-plugin), which perhaps left a thread running (despite localhost:9000 not showing anything). After I stopped other processes on my machine, presumably including that one, it started working without errors.

SonarQube Process Start Issue

I am facing an issue while bringing up SonarQube 6.7.1 on Linux server as follows:
[tele521
Dcip2):/dvp/lib/sft/cip2/install/sonarqube-6.7.1/sonarqube-6.7.1/logs]
uname -a Linux tele521 2.6.32-642.6.2.el6.x86_64 #1 SMP Wed Oct 26
06:52:09 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux"}
Error in sonar.log :
2018.02.23 10:00:22 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp `directory /dvp_llb_cip2_00_00/dvp/lib/sft/cip2/install/sonarqube-6.7.1/sonarqube-6.7.1/temp
2018.02.23 10:00:22 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /dvp_llb_cip2_00_00/dvp/lib/sft/cip2/install/sonarqube-6.7.1/sonarqube-6.7.1/temp
2018.02.23 10:00:22 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on /0.0.0.0:9001
2018.02.23 10:00:22 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on /0.0.0.0:9001
2018.02.23 10:00:22 INFO app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/dvp_llb_cip2_00_00/dvp/lib/sft/cip2/install/sonarqube-6.7.1/sonarqube-6.7.1/elasticsearch]: /dvp_llb_cip2_00_00/dvp/lib/sft/cip2/install/sonarqube-6.7.1/sonarqube-6.7.1/elasticsearch/bin/elasticsearch -Epath.conf=/dvp_llb_cip2_00_00/dvp/lib/sft/cip2/install/sonarqube-6.7.1/sonarqube-6.7.1/temp/conf/es
2018.02.23 10:00:22 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2018.02.23 10:00:22 INFO app[][o.s.a.p.ProcessLauncherImpl] Launch process [[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/dvp_llb_cip2_00_00/dvp/lib/sft/cip2/install/sonarqube-6.7.1/sonarqube-6.7.1/elasticsearch]: /dvp_llb_cip2_00_00/dvp/lib/sft/cip2/install/sonarqube-6.7.1/sonarqube-6.7.1/elasticsearch/bin/elasticsearch -Epath
.conf=/dvp_llb_cip2_00_00/dvp/lib/sft/cip2/install/sonarqube-6.7.1/SonarQube -6.7.1/temp/conf/es
2018.02.23 10:00:22 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
Send a packet START_PENDING : 5000
read a packet START_PENDING : 5000
JVM signalled a start pending with waitHint of 5000 millis.
Send a packet START_PENDING : 5000
WrapperSimpleApp: start(args) end. Main Completed=false, exitCode=null
WrapperListener.start runner thread stopped.
returned from WrapperListener.start()
Send a packet STARTED :
Startup runner thread stopped.
read a packet START_PENDING : 5000
JVM signalled a start pending with waitHint of 5000 millis.
read a packet STARTED :
JVM signalled that it was started.
send a packet PING : ping
Received a packet PING : ping
Send a packet PING : ok
read a packet PING : ok
Got ping response from JVM
2018.02.23 10:00:26 INFO app[][o.e.p.PluginsService] no modules loaded
2018.02.23 10:00:26 INFO app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2018.02.23 10:00:26 INFO app[][o.e.p.PluginsService] no modules loaded
2018.02.23 10:00:26 INFO app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
ERROR: [1] bootstrap checks failed
[1]: system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk
2018.02.23 10:00:28 WARN app[][o.s.a.p.AbstractProcessMonitor] Process exited with exit value [es]: 78
2018.02.23 10:00:28 WARN app[][o.s.a.p.AbstractProcessMonitor] Process exited with exit value [es]: 78
2018.02.23 10:00:28 INFO app[][o.s.a.SchedulerImpl] Process [es] is stopped
2018.02.23 10:00:28 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped}
It is going for bootstrap checks however I have set the property as false in sonar.properties as
sonar.web.javaAdditionalOpts=-Dbootstrap.system_call_filter=false
Also, I faced issues when i tried bringing up only elasticsearch process cause of bootstrap checks and updated elasticsearch.yml with property set as false post which the process came up.
But Sonar process still fails with the above exception.
Can you suggest something on this?
It is being hosted on tele521 server for me on port 9233.
Let me know if you need any more information.
Hello there,
PFB the es.log :
2018.02.23 10:00:24 WARN es[][o.e.b.JNANatives] unable tinstall syscall filter:
java.lang.UnsupportedOperationException: seccomp unavailable: CONFIG_SECCOMP not compiled into kernel, CONFIG_SECCOMP and CONFIG_SECCOMP_FILTER are needed
at org.elasticsearch.bootstrap.SystemCallFilter.linuxImpl (SystemCallFilter.java:364) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.SystemCallFilter.init(SystemCallFilter.java:639) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.JNANatives.tryInstallSystemCallFilter(JNANatives.java:258) [elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Natives.tryInstallSystemCallFilter(Natives.java:113) [elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:111) [elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:195) [elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:342) [elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:132) [elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:123) [elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:70) [elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:134) [elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.cli.Command.main(Command.java:90) [elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91) [elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:84) [elasticsearch-5.6.3.jar:5.6.3]
2018.02.23 10:00:24 INFO es[][o.e.n.Node] initializing ...
2018.02.23 10:00:24 INFO es[][o.e.e.NodeEnvironment] using [1] data paths, mounts [[/dvp_llb_cip2_00_00 (/dev/mapper/dvp_cip2_00_dg- dvp_llb_cip2_00_00_fs)]], net usable_space [4.2gb], net total_space [33.3gb], spins? [possibly], types [ext4]
2018.02.23 10:00:24 INFO es[][o.e.e.NodeEnvironment] heap size [494.9mb], compressed ordinary object pointers [true]
2018.02.23 10:00:24 INFO es[][o.e.n.Node] node name [sonarqube], node ID [_su6ybLyRQmIJap_1joqWg]
2018.02.23 10:00:24 INFO es[][o.e.n.Node] version[5.6.3], pid[26129], build[1a2f265/2017-10-06T20:33:39.012Z], OS[Linux/2.6.32-642.6.2.el6.x86_64/amd64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/1.8.0_60/25.60-b23]
2018.02.23 10:00:24 INFO es[][o.e.n.Node] JVM arguments [-XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -XX:+AlwaysPreTouch, -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, -Dbootstrap.system_call_filter=false, -Des.path.home=/dvp_llb_cip2_00_00/dvp/lib/sft/cip2/install/sonarqube-6.7.1/sonarqube-6.7.1/elasticsearch]
2018.02.23 10:00:25 INFO es[][o.e.p.PluginsService] loaded module [aggs-matrix-stats]
2018.02.23 10:00:25 INFO es[][o.e.p.PluginsService] loaded module [ingest-common]
2018.02.23 10:00:25 INFO es[][o.e.p.PluginsService] loaded module [parent-join]
2018.02.23 10:00:25 INFO es[][o.e.p.PluginsService] loaded module [percolator]
2018.02.23 10:00:25 INFO es[][o.e.p.PluginsService] loaded module [reindex]
2018.02.23 10:00:25 INFO es[][o.e.p.PluginsService] loaded module [transport-netty4]
2018.02.23 10:00:25 INFO es[][o.e.p.PluginsService] no plugins loaded
2018.02.23 10:00:27 INFO es[][o.e.d.DiscoveryModule] using discovery type [zen]
2018.02.23 10:00:27 INFO es[][o.e.n.Node] initialized
2018.02.23 10:00:27 INFO es[][o.e.n.Node] starting ...
2018.02.23 10:00:28 INFO es[][o.e.t.TransportService] publish_address {10.0.16.52:9001}, bound_addresses {0.0.0.0:9001}
2018.02.23 10:00:28 INFO es[][o.e.b.BootstrapChecks] bound or publishing to a non-loopback or non-link-local address, enforcing bootstrap checks
2018.02.23 10:00:28 ERROR es[][o.e.b.Bootstrap] node validation exception
[1] bootstrap checks failed
[1]: system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk
2018.02.23 10:00:28 INFO es[][o.e.n.Node] stopping ...
2018.02.23 10:00:28 INFO es[][o.e.n.Node] stopped
2018.02.23 10:00:28 INFO es[][o.e.n.Node] closing ...
2018.02.23 10:00:28 INFO es[][o.e.n.Node] closed
Also, Sonar is being started with Dcip2 as user.
PFB the same :
[tele521(Dcip2):/dvp/lib/sft/cip2/install/sonarqube-6.7.1/sonarqube-6.7.1/logs] less es.log

SonarQube 6.7.1 ES issue with SECCOMP not resolved with recommended solution

I upgraded an installation of SonarQube from 5.6.6 to 6.7.1, hosted on RHEL without CONFIG_SECCOMP compiled in. After updating the DB, running the sonar.sh start command starts briefly, and then terminates.
Per SonarQube 6.7 failed to start because CONFIG_SECCOMP not compiled into kernel and https://docs.sonarqube.org/display/SONAR/Requirements#Requirements-seccompfilter , my settings in sonar.properties are the recommended value for dealing with the CONFIG_SECCOMP issue is set as:
sonar.search.javaAdditionalOpts=-Dbootstrap.system_call_filter=false
For sonar.search.javaOpts, sonar.search.port and sonar.search.host, values are all default.
Per logs (below) it appears that the bootstrap value is being pulled in, but it doesn't seem to be getting propagated into the generated elasticsearch.yml in the temp directory.
sonar.log consists of:
--> 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.08 22:44:43 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonar/sonarqube-6.7.1/temp
2018.01.08 22:44:43 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
2018.01.08 22:44:43 INFO app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonar/sonarqube-6.7.1/elasticsearch]: /opt/sonar/sonarqube-6.7.1/elasticsearch/bin/elasticsearch -Epath.conf=/opt/sonar/sonarqube-6.7.1/temp/conf/es
2018.01.08 22:44:43 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2018.01.08 22:44:43 INFO app[][o.e.p.PluginsService] no modules loaded
2018.01.08 22:44:43 INFO app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2018.01.08 22:44:51 INFO app[][o.s.a.SchedulerImpl] Process[es] is up
2018.01.08 22:44:51 INFO app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='web', ipcIndex=2, logFilenamePrefix=web]] from [/opt/sonar/sonarqube-6.7.1]: /usr/lib/jvm/jdk1.8.0_131/jre/bin/java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/opt/sonar/sonarqube-6.7.1/temp -server -Xms1G -Xmx1G -XX:MaxPermSize=256m -XX:+HeapDumpOnOutOfMemoryError -XX:+AggressiveOpts -XX:InlineSmallCode=3072 -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -Djava.net.preferIPv4Stack=true -cp ./lib/common/*:./lib/server/*:/opt/sonar/sonarqube-6.7.1/lib/jdbc/postgresql/postgresql-42.1.4.jar org.sonar.server.app.WebServer /opt/sonar/sonarqube-6.7.1/temp/sq-process6699142698739435554properties
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
2018.01.08 22:45:00 INFO app[][o.s.a.SchedulerImpl] Process [web] is stopped
2018.01.08 22:45:00 INFO app[][o.s.a.SchedulerImpl] Process [es] is stopped
2018.01.08 22:45:00 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped
2018.01.08 22:45:00 WARN app[][o.s.a.p.AbstractProcessMonitor] Process exited with exit value [es]: 143
<-- Wrapper Stopped
ES log consists of:
2018.01.08 22:44:45 WARN es[][o.e.b.JNANatives] unable to install syscall filter:
java.lang.UnsupportedOperationException: seccomp unavailable: CONFIG_SECCOMP not compiled into kernel, CONFIG_SECCOMP and CONFIG_SECCOMP_FILTER are needed
at org.elasticsearch.bootstrap.SystemCallFilter.linuxImpl(SystemCallFilter.java:364) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.SystemCallFilter.init(SystemCallFilter.java:639) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.JNANatives.tryInstallSystemCallFilter(JNANatives.java:258) [elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Natives.tryInstallSystemCallFilter(Natives.java:113) [elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:111) [elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:195) [elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:342) [elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:132) [elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:123) [elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:70) [elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:134) [elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.cli.Command.main(Command.java:90) [elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91) [elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:84) [elasticsearch-5.6.3.jar:5.6.3]
2018.01.08 22:44:45 INFO es[][o.e.n.Node] initializing ...
2018.01.08 22:44:45 INFO es[][o.e.e.NodeEnvironment] using [1] data paths, mounts [[/opt (/dev/mapper/vg_sys-lv_opt)]], net usable_space [2.3gb], net total_space [9.7gb], spins? [possibly], types [ext4]
2018.01.08 22:44:45 INFO es[][o.e.e.NodeEnvironment] heap size [495.3mb], compressed ordinary object pointers [true]
2018.01.08 22:44:45 INFO es[][o.e.n.Node] node name [sonarqube], node ID [S0XGTf7ATGC2HuVlIcIwYQ]
2018.01.08 22:44:45 INFO es[][o.e.n.Node] version[5.6.3], pid[3915], build[1a2f265/2017-10-06T20:33:39.012Z], OS[Linux/2.6.32-573.3.1.el6.x86_64/amd64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/1.8.0_131/25.131-b11]
2018.01.08 22:44:45 INFO es[][o.e.n.Node] JVM arguments [-XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -XX:+AlwaysPreTouch, -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, -Dbootstrap.system_call_filter=false, -Des.path.home=/opt/sonar/sonarqube-6.7.1/elasticsearch]
2018.01.08 22:44:46 INFO es[][o.e.p.PluginsService] loaded module [aggs-matrix-stats]
2018.01.08 22:44:46 INFO es[][o.e.p.PluginsService] loaded module [ingest-common]
2018.01.08 22:44:46 INFO es[][o.e.p.PluginsService] loaded module [parent-join]
2018.01.08 22:44:46 INFO es[][o.e.p.PluginsService] loaded module [percolator]
2018.01.08 22:44:46 INFO es[][o.e.p.PluginsService] loaded module [reindex]
2018.01.08 22:44:46 INFO es[][o.e.p.PluginsService] loaded module [transport-netty4]
2018.01.08 22:44:46 INFO es[][o.e.p.PluginsService] no plugins loaded
2018.01.08 22:44:47 INFO es[][o.e.d.DiscoveryModule] using discovery type [zen]
2018.01.08 22:44:48 INFO es[][o.e.n.Node] initialized
2018.01.08 22:44:48 INFO es[][o.e.n.Node] starting ...
2018.01.08 22:44:48 INFO es[][o.e.t.TransportService] publish_address {127.0.0.1:9001}, bound_addresses {127.0.0.1:9001}
2018.01.08 22:44:48 WARN es[][o.e.b.BootstrapChecks] system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk
2018.01.08 22:44:51 INFO es[][o.e.c.s.ClusterService] new_master {sonarqube}{S0XGTf7ATGC2HuVlIcIwYQ}{CSVhU1O1QF6rU3a9IolATA}{127.0.0.1}{127.0.0.1:9001}{rack_id=sonarqube}, reason: zen-disco-elected-as-master ([0] nodes joined)
2018.01.08 22:44:51 INFO es[][o.e.n.Node] started
2018.01.08 22:44:51 INFO es[][o.e.g.GatewayService] recovered [0] indices into cluster_state
2018.01.08 22:45:00 INFO es[][o.e.n.Node] stopping ...
2018.01.08 22:45:00 INFO es[][o.e.n.Node] stopped
2018.01.08 22:45:00 INFO es[][o.e.n.Node] closing ...
2018.01.08 22:45:00 INFO es[][o.e.n.Node] closed
Per logs (below) it appears that the bootstrap value is being pulled in, but it doesn't seem to be getting propagated into the generated elasticsearch.yml in the temp directory.
It's expected that elasticsearch.yml is not updated. The .yml is a static internal configuration file. When you pass -Dbootstrap.system_call_filter=false it is set at runtime, and not reflected in static config files.
As a matter of fact you'll notice that your es.log only contains warnings, and is not failing at all on the seccomp aspect. Per sonar.log, ElasticSearch JVM even successfully starts:
2018.01.08 22:44:51 INFO app[][o.s.a.SchedulerImpl] Process[es] is up
So the problem is elsewhere, and your sonar.log tells you it's with the Web Process:
2018.01.08 22:44:51 INFO app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='web', ipcIndex=2, logFilenamePrefix=web]] from [/opt/sonar/sonarqube-6.7.1]: /usr/lib/jvm/jdk1.8.0_131/jre/bin/java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/opt/sonar/sonarqube-6.7.1/temp -server -Xms1G -Xmx1G -XX:MaxPermSize=256m -XX:+HeapDumpOnOutOfMemoryError -XX:+AggressiveOpts -XX:InlineSmallCode=3072 -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -Djava.net.preferIPv4Stack=true -cp ./lib/common/*:./lib/server/*:/opt/sonar/sonarqube-6.7.1/lib/jdbc/postgresql/postgresql-42.1.4.jar org.sonar.server.app.WebServer /opt/sonar/sonarqube-6.7.1/temp/sq-process6699142698739435554properties
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
2018.01.08 22:45:00 INFO app[][o.s.a.SchedulerImpl] Process [web] is stopped
Per SonarQube Troubleshooting documentation , it's a good time to go check web.log and see what happens there.
Killing all the JDK instance (pids)and restarting sonarqube services worked for me.

Resources