SonarQube 6.5 - Not able to configure the SQL Server Database - sonarqube

I installed the latest version of SonarQube 6.5 and have been able to get the SonarQube server up and running. I have my SQL Server database named ‘Sonar’ created with a user named ‘SonarUser’ and have given it admin rights. I have changed the collation to be case-sensitive (CS) and accent-sensitive (AS).
I have downloaded the jdbc driver and put it in the correct folders.
Followed the steps mentioned here - https://docs.sonarqube.org/display/SONAR/Installing+the+Server
However I am not able to make either Windows Authentication or SQL Server Authentication to work. The database is still empty, and do not see the tables/indexes in there.
I am making the below changes to the ‘sonar.properties’ file – 1 at a time – but it does not work
SQL Authentication
sonar.jdbc.username=SonarUser
sonar.jdbc.password=SonarUser
sonar.jdbc.url=jdbc:sqlserver://localhost;databaseName=Sonar
Windows Authentication
sonar.jdbc.url=jdbc:sqlserver://localhost;databaseName=Sonar;
integratedSecurity=true
When I make any change to the ‘sonar.properties’ file and then start the Sonar Server, it fails with the following error –
2017.10.03 16:59:09 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory C:\Sonarqube-6.5\temp
2017.10.03 16:59:09 INFO app[][o.s.a.p.JavaProcessLauncherImpl] Launch process[es]: C:\Program Files\Java\jre1.8.0_101\bin\java
-Djava.awt.headless=true -Xmx1G -Xms256m -Xss256k -Djna.nosys=true -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -Djava.io.tmpdir=C:\Sonarqube-6.5\temp -cp ./lib/common/;./lib/search/ org.sonar.search.SearchServer
C:\Sonarqube-6.5\temp\sq-process1211130103830390174properties
2017.10.03 16:59:19 INFO app[][o.s.a.SchedulerImpl] Process[es] is up
2017.10.03 16:59:19 INFO app[][o.s.a.p.JavaProcessLauncherImpl] Launch process[web]: C:\Program Files\Java\jre1.8.0_101\bin\java
-Djava.awt.headless=true -Dfile.encoding=UTF-8 -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -Djava.io.tmpdir=C:\Sonarqube-6.5\temp -cp ./lib/common/;./lib/server/;C:\Sonarqube-6.5\lib\jdbc\mssql\mssql-jdbc-6.1.0.jre8.jar
org.sonar.server.app.WebServer
C:\Sonarqube-6.5\temp\sq-process7396503632227644033properties
2017.10.03 16:59:23 INFO app[][o.s.a.SchedulerImpl] Process [web] is stopped
2017.10.03 16:59:24 INFO app[][o.s.a.SchedulerImpl] Process [es] is stopped
2017.10.03 16:59:24 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped <-- Wrapper Stopped
If I undo the changes in ‘sonar.properties’ file, and run the StartSonar.bat - the server runs fine.
Any help will be appreciated.

I was finally able to get through this error and was able to configure my SQL Database. In the web.log file, I saw the error message -
Unsupported mssql version: 10.0. Minimal supported version is 11.0.
Basically I was running an older version of SQL Server, which was causing this error. Once I created a database in SQL Server 2014 with this above steps, I was able to run the SonarQube instance without any issues. All the required tables got created in the database. I also confirmed that there are records inserted into the tables as you run SonarQube against my projects.

Related

Unable to run nifi in window server 2016

I am not able to run nifi in window server 2016 even though I change to java 8
java version "1.8.0_202"
Java(TM) SE Runtime Environment (build 1.8.0_202-b08)
Java HotSpot(TM) 64-Bit Server VM (build 25.202-b08, mixed mode)
C:\Users\HelloWorld\Desktop\nifi-1.16.1-bin\nifi-1.16.1\bin>run-nifi.bat
2022-05-11 23:20:58,804 INFO [main] org.apache.nifi.bootstrap.Command Starting Apache NiFi...
2022-05-11 23:20:58,804 INFO [main] org.apache.nifi.bootstrap.Command Working Directory: C:\Users\HelloWorld\Desktop\NIFI-1~1.1-B\NIFI-1~1.1
2022-05-11 23:20:58,804 INFO [main] org.apache.nifi.bootstrap.Command Command: C:\Program Files\Java\jdk1.8.0_202\bin\java.exe -classpath C:\Users\HelloWorld\Desktop\NIFI-1~1.1-B\NIFI-1~1.1\.\conf;C:\Users\HelloWorld\Desktop\NIFI-1~1.1-B\NIFI-1~1.1\.\lib\logback-classic-1.2.11.jar;C:\Users\HelloWorld\Desktop\NIFI-1~1.1-B\NIFI-1~1.1\.\lib\logback-core-1.2.11.jar;C:\Users\HelloWorld\Desktop\NIFI-1~1.1-B\NIFI-1~1.1\.\lib\nifi-api-1.16.1.jar;C:\Users\HelloWorld\Desktop\NIFI-1~1.1-B\NIFI-1~1.1\.\lib\nifi-nar-utils-1.16.1.jar;C:\Users\HelloWorld\Desktop\NIFI-1~1.1-B\NIFI-1~1.1\.\lib\nifi-properties-1.16.1.jar;C:\Users\HelloWorld\Desktop\NIFI-1~1.1-B\NIFI-1~1.1\.\lib\nifi-property-utils-1.16.1.jar;C:\Users\HelloWorld\Desktop\NIFI-1~1.1-B\NIFI-1~1.1\.\lib\nifi-runtime-1.16.1.jar;C:\Users\HelloWorld\Desktop\NIFI-1~1.1-B\NIFI-1~1.1\.\lib\nifi-stateless-api-1.16.1.jar;C:\Users\HelloWorld\Desktop\NIFI-1~1.1-B\NIFI-1~1.1\.\lib\nifi-stateless-bootstrap-1.16.1.jar;C:\Users\HelloWorld\Desktop\NIFI-1~1.1-B\NIFI-1~1.1\.\lib\slf4j-api-1.7.36.jar -Dorg.apache.jasper.compiler.disablejsr199=true -Xmx512m -Xms512m -Dcurator-log-only-first-connection-issue-as-error-level=true -Djavax.security.auth.useSubjectCredsOnly=true -Djava.security.egd=file:/dev/urandom -Dzookeeper.admin.enableServer=false -Dsun.net.http.allowRestrictedHeaders=true -Djava.net.preferIPv4Stack=true -Djava.awt.headless=true -Djava.protocol.handler.pkgs=sun.net.www.protocol -Dnifi.properties.file.path=C:\Users\HelloWorld\Desktop\NIFI-1~1.1-B\NIFI-1~1.1\.\conf\nifi.properties -Dnifi.bootstrap.listen.port=54233 -Dapp=NiFi -Dorg.apache.nifi.bootstrap.config.log.dir=C:\Users\HelloWorld\Desktop\NIFI-1~1.1-B\NIFI-1~1.1\bin\..\\logs org.apache.nifi.NiFi
2022-05-11 23:20:59,078 WARN [main] org.apache.nifi.bootstrap.Command Failed to set permissions so that only the owner can read pid file C:\Users\HelloWorld\Desktop\NIFI-1~1.1-B\NIFI-1~1.1\bin\..\run\nifi.pid; this may allows others to have access to the key needed to communicate with NiFi. Permissions should be changed so that only the owner can read this file
2022-05-11 23:20:59,078 WARN [main] org.apache.nifi.bootstrap.Command Failed to set permissions so that only the owner can read status file C:\Users\HelloWorld\Desktop\NIFI-1~1.1-B\NIFI-1~1.1\bin\..\run\nifi.status; this may allows others to have access to the key needed to communicate with NiFi. Permissions should be changed so that only the owner can read this file
2022-05-11 23:20:59,078 INFO [main] org.apache.nifi.bootstrap.Command Launched Apache NiFi with Process ID 964

ElasticSearch-based problem when starting Sonarqube: 944 main ERROR Unable to locate plugin type for IfFileName

I've recently unpacked sonarqube-8.1.0.31237, installed Oracle Java 11 SDK, set Environment Parameters for JAVA_HOME and PATH. When I try to start sonarqube, several errors are logged regarding ElasticSearch.
At sonarqube website, it recommends deleting es6 directory and starting it again but it doesn't work.
Wrapper Started as Console
Launching a JVM...
Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.
Log
2020.01.31 10:43:14 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory D:\EclUtil\sonarqube-8.1.0.31237\sonarqube-8.1.0.31237\temp
2020.01.31 10:43:14 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
2020.01.31 10:43:14 INFO app[][o.s.a.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [D:\EclUtil\sonarqube-8.1.0.31237\sonarqube-8.1.0.31237\elasticsearch]: C:\Program Files (x86)\Java\jdk-11.0.6\bin\java -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=D:\EclUtil\sonarqube-8.1.0.31237\sonarqube-8.1.0.31237\temp -XX:ErrorFile=../logs/es_hs_err_pid%p.log -Xmx512m -Xms512m -XX:+HeapDumpOnOutOfMemoryError -Delasticsearch -Des.path.home=D:\EclUtil\sonarqube-8.1.0.31237\sonarqube-8.1.0.31237\elasticsearch -Des.path.conf=D:\EclUtil\sonarqube-8.1.0.31237\sonarqube-8.1.0.31237\temp\conf\es -cp lib/* org.elasticsearch.bootstrap.Elasticsearch
2020.01.31 10:43:14 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
Java HotSpot(TM) 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
2020.01.31 10:43:15 INFO app[][o.e.p.PluginsService] no modules loaded
2020.01.31 10:43:15 INFO app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2020-01-31 10:43:16,944 main ERROR Unable to locate plugin type for IfFileName
2020-01-31 10:43:16,991 main ERROR Unable to locate plugin for IfAccumulatedFileCount
2020-01-31 10:43:16,991 main ERROR Unable to locate plugin for IfFileName
2020-01-31 10:43:16,991 main ERROR Unable to invoke factory method in class

Sonarqube-7.9.1 HeapDumpOnOutOfMemoryError

I installed sonarqube-7.9.1 on my Ubuntu 18.04 machine. JAVA 11 is installed and Mysql used as database.
Some important rows from sonar.properties are as follows
sonar.web.javaOpts=-Xmx1024m -Xms1024m -XX:+HeapDumpOnOutOfMemoryError
sonar.web.host=127.0.0.1
sonar.ce.javaOpts=-Xmx1024m -Xms1024m -XX:+HeapDumpOnOutOfMemoryError
Sonarqube log file shows following lines
Launching a JVM...
Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.
2019.10.17 12:36:49 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube/sonarqube-7.9.1/temp
2019.10.17 12:36:49 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
2019.10.17 12:36:49 INFO app[][o.s.a.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonarqube/sonarqube-7.9.1/elasticsearch]: /opt/sonarqube/sonarqube-7.9.1/elasticsearch/bin/elasticsearch
2019.10.17 12:36:49 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.10.17 12:36:49 INFO app[][o.e.p.PluginsService] no modules loaded
2019.10.17 12:36:49 INFO app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2019.10.17 12:37:01 INFO app[][o.s.a.SchedulerImpl] Process[es] is up
2019.10.17 12:37:01 INFO app[][o.s.a.ProcessLauncherImpl] Launch process[[key='web', ipcIndex=2, logFilenamePrefix=web]] from [/opt/sonarqube/sonarqube-7.9.1]: /usr/lib/jvm/java-11-openjdk-amd64/bin/java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/opt/sonarqube/sonarqube-7.9.1/temp --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 -Xmx1024m -Xms1024m -XX:+HeapDumpOnOutOfMemoryError -Dhttp.nonProxyHosts=localhost|127.*|[::1] -cp ./lib/common/*:/opt/sonarqube/sonarqube-7.9.1/lib/jdbc/mysql/mysql-connector-java-5.1.46.jar org.sonar.server.app.WebServer /opt/sonarqube/sonarqube-7.9.1/temp/sq-process4977560398960418438properties
2019.10.17 12:37:04 INFO app[][o.s.a.SchedulerImpl] Process[web] is stopped
2019.10.17 12:37:05 WARN app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [es]: 143
2019.10.17 12:37:05 INFO app[][o.s.a.SchedulerImpl] Process[es] is stopped
2019.10.17 12:37:05 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped
<-- Wrapper Stopped
I was also getting the same issue of starting Sonarqube-7.9.1 with OpenJDK-11 because of the port conflicts. I tried changing port numbers and issue got resolved. Try replacing below lines in sonar.properties:
sonar.web.port=9004
sonar.search.port=9005
we can replace below lines also,already given in this question at the start [For me it worked without replacing below lines]:
sonar.web.javaOpts=-Xmx1024m -Xms1024m -XX:+HeapDumpOnOutOfMemoryError
sonar.ce.javaOpts=-Xmx1024m -Xms1024m -XX:+HeapDumpOnOutOfMemoryError
I believe SonarQube is not starting for any reason related to memory but rather from the fact that you attempt to connect to MySQL Database and this DB is not supported anymore (see "Release 7.9 LTS Upgrade Notes" at https://docs.sonarqube.org/latest/setup/upgrade-notes/).
Have a look at web.log (see "Checking the logs" at https://docs.sonarqube.org/latest/setup/troubleshooting/) to confirm it, you will find a clear message there.

SonarQube 6.1 stopping itself. Not starting

I have installed Sonar qube 6.1. I have started sonar by executing sonar.sh start and checked status with sonar.sh status. After few seconds, sonar stopping itself by writing below statements in the wrapper.log file. Please help me on this issue to get resolve.
2017.05.04 07:01:13 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube-6.1/temp
2017.05.04 07:01:13 INFO app[][o.s.p.m.JavaProcessLauncher] Launch process[es]: /usr/java/jdk1.8.0_111/jre/bin/java -Djava.awt.headless=true -Xmx1G -Xms256m -Xss256k -Djna.nosys=true -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -Djava.io.tmpdir=/opt/sonarqube-6.1/temp -javaagent:/usr/java/jdk1.8.0_111/jre/lib/management-agent.jar -cp ./lib/common/*:./lib/search/* org.sonar.search.SearchServer /opt/sonarqube-6.1/temp/sq-process4451619261882420874properties
2017.05.04 07:01:23 INFO app[][o.s.p.m.Monitor] Process[es] is up
2017.05.04 07:01:23 INFO app[][o.s.p.m.JavaProcessLauncher] Launch process[web]: /usr/java/jdk1.8.0_111/jre/bin/java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djruby.management.enabled=false -Djruby.compile.invokedynamic=false -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -Djava.io.tmpdir=/opt/sonarqube-6.1/temp -javaagent:/usr/java/jdk1.8.0_111/jre/lib/management-agent.jar -cp ./lib/common/*:./lib/server/*:/opt/sonarqube-6.1/lib/jdbc/h2/h2-1.3.176.jar org.sonar.server.app.WebServer /opt/sonarqube-6.1/temp/sq-process3625744255132410453properties
2017.05.04 07:01:25 INFO app[][o.s.p.m.Monitor] Process[es] is stopping
2017.05.04 07:01:26 INFO app[][o.s.p.m.Monitor] Process[es] is stopped
es is ElasticSearch, a component that indexes your data to accelerate searching. Maybe your indexes are corrupted. You can rebuild them by removing contents of ${SONARQUBE_HOME}/data/es/ directory, and retry.

SonarQube 5.1.1 and Oracle XE

Hello I'm trying to install SonarQube 5.1.1 with Oracle XE 11g DB.
I've performed the requirements steps:
Create the database user with
CREATE USER sonar IDENTIFIED BY sonar;
GRANT UNLIMITED TABLESPACE, CONNECT, RESOURCE, CREATE SESSION, CREATE TABLE, CREATE VIEW, CREATE SYNONYM, CREATE SEQUENCE, CREATE PROCEDURE, CREATE TRIGGER TO sonar;
EXIT
Download ojdbc6.jar from Oracle's download site and place it in /opt/sonarqube-5.1.1/extensions/jdbc-driver/oracle
Change the conf\sonar.properties as follow:
comment out:
sonar.jdbc.url: jdbc:derby://localhost:1527/sonar;create=true
remove comment from:
sonar.jdbc.url: jdbc:oracle:thin:#localhost/XE
sonar.jdbc.driverClassName: oracle.jdbc.OracleDriver
sonar.jdbc.validationQuery: select 1 from dual
Start the SonarQube server with ./sonar.sh start
The console doesn't work.
When I try to launch the console through ./sonar.sh console I get back the following message.
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 | 2015.07.09 10:51:15 INFO app[o.s.p.m.JavaProcessLauncher] Launch process[search]: /opt/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/sonarqube-5.1.1/temp -cp ./lib/common/*:./lib/search/* org.sonar.search.SearchServer /tmp/sq-process5315721777324339581properties
jvm 1 | 2015.07.09 10:51:21 INFO app[o.s.p.m.Monitor] Process[search] is up
jvm 1 | 2015.07.09 10:51:21 INFO app[o.s.p.m.JavaProcessLauncher] Launch process[web]: /opt/jdk1.8.0_45/jre/bin/java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djruby.management.enabled=false -Djruby.compile.invokedynamic=false -Xmx768m -XX:MaxPermSize=160m -XX:+HeapDumpOnOutOfMemoryError -Djava.net.preferIPv4Stack=true -Djava.io.tmpdir=/opt/sonarqube-5.1.1/temp -cp ./lib/common/*:./lib/server/*:/opt/sonarqube-5.1.1/extensions/jdbc-driver/oracle/ojdbc6.jar org.sonar.server.app.WebServer /tmp/sq-process6137893542254624184properties
jvm 1 | 2015.07.09 10:53:52 INFO app[o.s.p.m.TerminatorThread] Process[search] is stopping
jvm 1 | 2015.07.09 10:53:53 INFO app[o.s.p.m.TerminatorThread] Process[search] is stopped
wrapper | <-- Wrapper Stopped
thanks to #Simon I looked to sonar.log file and I found that the sonar jdbc driver need hostname:port\sid, so I missing the port information. I changed the conf file in that way and now it properly works.

Resources