MSBuild.SonarQube.Runner.exe attempting to connect with h2 instead of SQL - sonarqube

The first 2 stages (prep, build) of an analysis from the command line with MSBuild.SonarQube.Runner.exe seem to work fine.
The properties in SonarQube.Analysis.xml are:
<Property Name="sonar.host.url">http://server-45:9000</Property>
<Property Name="sonar.login">admin</Property>
<Property Name="sonar.password">admin</Property>
<Property Name="sonar.jdbc.url">jdbc:jtds:sqlserver://server-46/SonarQube;instance=INSTANCE01;SelectMethod=Cursor</Property>
<Property Name="sonar.jdbc.driverClassName">com.microsoft.sqlserver.jdbc.SQLServerDriver</Property>
<Property Name="sonar.jdbc.username">sonarqube</Property>
<Property Name="sonar.jdbc.password">stackoverflow</Property>
The final stage fails with:
17:30:17.358 INFO - Create JDBC datasource for jdbc:h2:tcp://localhost/sonar
It appears to be ignoring the local xml settings file completely, finding the default one where the exe is which is identical and still trying to create a default h2 connection to a database.
Full log:
C:\Users\me\Documents\Visual Studio 2013\Projects\ClassLibrary9>MSBuild.SonarQube.Runner end
Default properties file was found at C:\Apps\MsSonarRunner\SonarQube.Analysis.xml
Loading analysis properties from C:\Apps\MsSonarRunner\SonarQube.Analysis.xml
Post-processing started.
WARNING: File is not under the project directory and cannot currently be analysed by SonarQube. File: C:\Users\me\AppData\Local\Temp\.NETFramework,Version=v4.5.AssemblyAttributes.cs, project: C:\Users\me\Documents\Visual Studio 2013\Projects\ClassLibrary9\ClassLibrary9\ClassLibrary9.csproj
The SONAR_RUNNER_HOME environment variable is not required and will be ignored.
SONAR_RUNNER_OPTS is not configured. Setting it to the default value of -Xmx1024m
Calling the sonar-runner...
C:\Users\me\Documents\Visual Studio 2013\Projects\ClassLibrary9\.sonarqube\bin\sonar-runner\bin\..
SonarQube Runner 2.4
Java 1.8.0_60 Oracle Corporation (64-bit)
Windows 8 6.2 amd64
SONAR_RUNNER_OPTS=-Xmx1024m
INFO: Error stacktraces are turned on.
INFO: Runner configuration file: C:\Users\me\Documents\Visual Studio 2013\Projects\ClassLibrary9\.sonarqube\bin\sonar-runner\bin\..\conf\sonar-runner.properties
INFO: Project configuration file: C:\Users\me\Documents\Visual Studio 2013\Projects\ClassLibrary9\.sonarqube\out\sonar-project.properties
INFO: Default locale: "en_GB", source code encoding: "UTF-8"
INFO: Work directory: C:\Users\me\Documents\Visual Studio 2013\Projects\ClassLibrary9\.sonarqube\out\.sonar
INFO: SonarQube Server 5.1.2
17:30:17.096 INFO - Load global repositories
17:30:17.295 INFO - Load global repositories (done) | time=200ms
17:30:17.296 INFO - Server id: 20151005162012
17:30:17.298 INFO - User cache: C:\Users\me\.sonar\cache
17:30:17.304 INFO - Install plugins
17:30:17.350 INFO - Install JDBC driver
17:30:17.358 INFO - Create JDBC datasource for jdbc:h2:tcp://localhost/sonar
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 0.817s
Final Memory: 8M/245M
INFO: ------------------------------------------------------------------------
17:30:17.415 Creating a summary markdown file...
Anyone any ideas here?
Thanks in advance.

Fixed.
This was a side effect of the following:
I copied batch files from another analysis over and the /s switch pointed to a completely different settings xml file. Doing the pre build run and the post build run with 2 different sets of settings causes this confusion.

Related

How to handle "Re-run SonarQube Scanner using the -X switch to enable full debug logging" Error

We've suddenly got the SonarQube Error on CI/CD pipeline, Concourse. Since we had no change around sonar properties recently, totally confused what this error requires us.
Preparing SonarQube scanner...
Starting sonar-scanner (type: cli)...
INFO: Scanner configuration file: /opt/sonar-scanner/conf/sonar-scanner.properties
INFO: Project root configuration file: /tmp/build/put/sonar-input/sonar-project.properties
INFO: SonarQube Scanner 4.0.0.1744
INFO: Java 1.8.0_151 Oracle Corporation (64-bit)
INFO: Linux 4.15.0-159-generic amd64
INFO: User cache: /root/.sonar/cache
INFO: SonarQube server 7.9.1
INFO: Default locale: "en_US", source code encoding: "UTF-8" (analysis is platform dependent)
WARN: SonarScanner will require Java 11+ to run starting in SonarQube 8.x
INFO: Sensor SurefireSensor [java] (done) | time=70ms
~
INFO: Sensor JavaXmlSensor [java]
INFO: Sensor JavaXmlSensor [java] (done) | time=3ms
INFO: Sensor HTML [web]
INFO: Sensor HTML [web] (done) | time=14ms
INFO: ------------- Run sensors on project
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=4ms
INFO: Sensor Java CPD Block Indexer
INFO: Sensor Java CPD Block Indexer (done) | time=81ms
INFO: 55 files had no CPD blocks
INFO: Calculating CPD for 44 files
INFO: CPD calculation finished
INFO: Analysis report generated in 91ms, dir size=696 KB
INFO: Analysis report compressed in 319ms, zip size=316 KB
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 18.928s
INFO: Final Memory: 32M/995M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution
ERROR: The 'report' parameter is missing
ERROR:
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
ERROR in /opt/resource/out : line 251 with exit code 2
Is there any way to handle this error...?
And just wondering it would be clear this issue if we would reboot the sonarqube docker.
Any adivise would be highly appreciated.
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
968xxxxxxx5b bitnami/sonarqube:7.9.1 "/app-entrypoint.sh …" 9 months ago Up 8 months 0.0.0.0:80->9000/tcp docker_sonarqube_1
Thanks to following discussion, we understood that caused by the lack of disk spaces. After clean-up, it worked fine in our case.
Error: The ‘report’ parameter is missing
https://community.sonarsource.com/t/error-the-report-parameter-is-missing/9616
– Faced similar issue, and found disk space issue on the server. Once clearing the disk space it worked.
Sonarqube : The 'report' parameter is missing
https://stackoverflow.com/questions/48805695/sonarqube-the-report-parameter-is-missing
--I just had the same problem here: my Linux server ran out of disk space and Sonarqube started to produce the report parameter is missing error. After deleting some unused files and restarting sonarqube, everything worked normal again

Cppcheck errors are not getting reported in SonarQube 7.9.5 using Sonar-cxx community plugin v1.3.3

I am having SonarQube Community Edition (v7.9.5) server running with sonar-cxx community plugin v1.3.3
Now for a test C++ project, I have generated cppcheck (v2.3) analysis report and ran sonar-scanner (https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.5.0.2216-linux.zip) as follows.
$ pwd
/testproj
$ ls
file1.cc
$ cat file1.cc
int main()
{
char a[10];
a[10] = 0;
return 0;
}
$ cppcheck --enable=all --xml . 2> cppcheck_issues.xml
$ cat cppcheck_issues.xml
<?xml version="1.0" encoding="UTF-8"?>
<results version="2">
<cppcheck version="2.3"/>
<errors>
<error id="arrayIndexOutOfBounds" severity="error" msg="Array &apos;a[10]&apos; accessed at index 10, which is out of bounds." verbose="Array &apos;a[10]&apos; accessed at index 10, which is out of bounds." cwe="788" hash="11923574308940205340">
<location file="file1.cc" line="4" column="2" info="Array index out of bounds"/>
</error>
<error id="unreadVariable" severity="style" msg="Variable &apos;a[10]&apos; is assigned a value that is never used." verbose="Variable &apos;a[10]&apos; is assigned a value that is never used." cwe="563" hash="9507758794529763218">
<location file="file1.cc" line="4" column="7"/>
<symbol>a[10]</symbol>
</error>
</errors>
</results>
$ sonar-scanner \
-Dsonar.host.url=<sonar-host-url>\
-Dsonar.login=<sonar-token>\
-Dsonar.projectName=testproj\
-Dsonar.projectKey=testproj\
-Dsonar.projectVersion=0.1\
-Dsonar.cxx.cppcheck.reportPath=cppcheck_issues.xml\
-Dsonar.exclusions=cppcheck_issues.xml
INFO: Scanner configuration file: /code/sonar-scanner/conf/sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: SonarScanner 4.5.0.2216
INFO: Java 11.0.3 AdoptOpenJDK (64-bit)
INFO: Linux 4.1.12-124.43.4.el7uek.x86_64 amd64
INFO: User cache: /root/.sonar/cache
INFO: Scanner configuration file: /code/sonar-scanner/conf/sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: Analyzing on SonarQube server 7.9.5
INFO: Default locale: "en_US", source code encoding: "UTF-8" (analysis is platform dependent)
INFO: Load global settings
INFO: Load global settings (done) | time=142ms
INFO: Server id: 22633092-AXeMotAnTu7ckErSxqZC
INFO: User cache: /root/.sonar/cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=73ms
INFO: Load/download plugins (done) | time=141ms
INFO: Process project properties
INFO: Execute project builders
INFO: Execute project builders (done) | time=9ms
INFO: Project key: testproj
INFO: Base dir: /testproj
INFO: Working dir: /testproj/.scannerwork
INFO: Load project settings for component key: 'testproj'
INFO: Load project settings for component key: 'testproj' (done) | time=74ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=99ms
INFO: Load active rules
INFO: Load active rules (done) | time=1167ms
WARN: SCM provider autodetection failed. Please use "sonar.scm.provider" to define SCM of your project, or disable the SCM Sensor in the project settings.
INFO: Indexing files...
INFO: Project configuration:
INFO: Excluded sources: cppcheck_issues.xml
INFO: 1 file indexed
INFO: 0 files ignored because of inclusion/exclusion patterns
INFO: Quality profile for c++: Sonar way
INFO: ------------- Run sensors on module testproj
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=41ms
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by net.sf.cglib.core.ReflectUtils$1 (file:/root/.sonar/cache/866bb1adbf016ea515620f1aaa15ec53/sonar-javascript-plugin.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of net.sf.cglib.core.ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
INFO: Sensor C++ (Community) SquidSensor [cxx]
INFO: Load project repositories
INFO: Load project repositories (done) | time=31ms
INFO: Sensor C++ (Community) SquidSensor [cxx] (done) | time=312ms
INFO: Sensor JaCoCo XML Report Importer [jacoco]
INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=9ms
INFO: Sensor JavaXmlSensor [java]
INFO: Sensor JavaXmlSensor [java] (done) | time=3ms
INFO: Sensor HTML [web]
INFO: Sensor HTML [web] (done) | time=23ms
INFO: ------------- Run sensors on project
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=27ms
INFO: No SCM system was detected. You can use the 'sonar.scm.provider' property to explicitly specify it.
INFO: 1 file had no CPD blocks
INFO: Calculating CPD for 0 files
INFO: CPD calculation finished
INFO: Analysis report generated in 157ms, dir size=79 KB
INFO: Analysis report compressed in 22ms, zip size=12 KB
INFO: Analysis report uploaded in 58ms
INFO: ANALYSIS SUCCESSFUL, you can browse <sonar-host-url>/dashboard?id=testproj
INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
INFO: More about the report processing at <sonar-host-url>/api/ce/task?id=AXeQLS1KTu7ckErSxt5M
INFO: Executing post-job 'Final report'
INFO: Turn debug info on to get more details (sonar-scanner -X -Dsonar.verbose=true ...).
INFO: Analysis total time: 5.510 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 7.283s
INFO: Final Memory: 12M/44M
INFO: ------------------------------------------------------------------------
Now the project is successfully created/updated in SonarQube; but, the issues are not reported in SonarQube. Someone would be able to suggest on what could be the reason?
Please refer the snapshot of the project in SonarQube
Note-1: sonar.cxx.suffixes.sources is configured to ".cc" value for C++ (Community) plugin in SonarQube server configuration. And, there are no other plugin seen present with the same configuration key.
Note-2: There are no errors/warnings seen in ce.log
The issue cause is found after doing some more digging.
Issue cause: The default quality profile corresponding to the C++ (Community) had their all rules disabled by default, and there was no option to enable them as well.
Fix: Created a new quality profile extending the default one, then enabled rules for that, and finally made it as the default quality profile for C++ (Community) solves the issue.
Update (16-Feb-'21): Got a clarification from sonar-cxx team that this is intentional as well, and the same is documented in https://github.com/SonarOpenCommunity/sonar-cxx/wiki/Manage-Quality-Profiles
Since the cxx plugin contains a large number of sensors with over 4000
rules, all rules are initially deactivated in the default profile
Sonar way for the programming language CXX. Enabling all rules would
have a negative impact on the analysis performance and mostly only a
subset is needed.
Therefore, after installation, no sensor issues are displayed. To
display issues, the corresponding rules must first be enabled in the
Quality Profile being used by the project.

SonarQube scan runs but doesn’t generate any results

I’m running a SonarQube scan for the first time. It’s the CE version, 8.3.1.
I have SQ running on a server at 192.168.56.111. My development workstation is on 192.168.0.11. There are no network problems.
Since I’m new to SQ, I’m trying to keep it as basic as possible. I’m using the sample HelloWorld in https://github.com/SonarSource/sonar-scanning-examples/blob/master/sonarqube-scanner-maven/maven-basic/src/main/java/com/acme/basic/
I’m not using Git. Just saving the HelloWorld project to the local hard drive
The source code is at /opt/workspace/eclipse/java/my-app/src/main/java/com/mycompany/app/
The scanner is at /opt/sonarqube/scanner/sonar-scanner-4.4.0.2170-linux/bin
Here’s a copy of the properties file. I’m using the same file whether or not I put it in the scanner’s conf directory or the application workspace… I’ve seen different webpages that say it goes in either spot:
sonar.host.url=http://192.168.56.111:9000
sonar.sourceEncoding=UTF-8
sonar.projectKey=com.mycompany.app:my-app
sonar.scm.disabled=True
sonar.sources=/opt/workspace/eclipse/java/my-app/src/main/java/com/mycompany/app
sonar.login=73a9a7ab66a335d0d83aee813d576e184934a336
When I run sonar-scanner and then go check the results, Projects | Name | Overview, it says "The main branch has no lines of code".
Question #1: If sonar.scm.disabled=True is in the props file, how can this error happen? I also went to the project settings in the SQ server and disabled the SCM sensor there too. Same results.
Question #2: I noticed in the terminal output, it said .java files are being ignored. So I changed the sonar.sources property to where the class files are at: /opt/workspace/eclipse/java/my-app/target/classes/com/mycompany/app/. Same results. What should the sonar.sources property be? Does SQ work on the java files or the class files?
The results say “No Issues. Hooray!”. So I added this but of ugliness to the sayHello method in the HelloWorld class:
KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA");
kpg.initialize(1024);
Question #3: Still no code issues. SQ should have flagged on the 1024 (as it’s less than 2048) size right?
==== Edit 23 August ====
Adding output from the terminal per #HernánAlarcón 's comment.
INFO: Scanner configuration file: /opt/sonarqube/scanner/sonar-scanner-4.4.0.2170-linux/conf/sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: SonarScanner 4.4.0.2170
INFO: Java 11.0.3 AdoptOpenJDK (64-bit)
INFO: Linux 3.10.0-1127.10.1.el7.x86_64 amd64
INFO: User cache: /home/dogzilla/.sonar/cache
INFO: Scanner configuration file: /opt/sonarqube/scanner/sonar-scanner-4.4.0.2170-linux/conf/sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: Analyzing on SonarQube server 8.3.1
INFO: Default locale: "en_US", source code encoding: "UTF-8"
INFO: Load global settings
INFO: Load global settings (done) | time=69ms
INFO: Server id: A7EE8CF2-AXMiwj91ZEnoz7IhXD_G
INFO: User cache: /home/dogzilla/.sonar/cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=36ms
INFO: Load/download plugins (done) | time=86ms
INFO: Process project properties
INFO: Process project properties (done) | time=7ms
INFO: Execute project builders
INFO: Execute project builders (done) | time=3ms
INFO: Project key: com.mycompany.app:my-app
INFO: Base dir: /opt/workspace/eclipse/java/my-app/target/classes/com/mycompany/app
INFO: Working dir: /opt/workspace/eclipse/java/my-app/target/classes/com/mycompany/app/.scannerwork
INFO: Load project settings for component key: 'com.mycompany.app:my-app'
INFO: Load project settings for component key: 'com.mycompany.app:my-app' (done) | time=17ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=40ms
INFO: Load active rules
INFO: Load active rules (done) | time=851ms
INFO: Indexing files...
INFO: Project configuration:
WARN: File '/opt/workspace/eclipse/java/my-app/src/main/java/com/mycompany/app/HelloWorld.java' is ignored. It is not located in project basedir '/opt/workspace/eclipse/java/my-app/target/classes/com/mycompany/app'.
WARN: File '/opt/workspace/eclipse/java/my-app/src/main/java/com/mycompany/app/AppRunner.java' is ignored. It is not located in project basedir '/opt/workspace/eclipse/java/my-app/target/classes/com/mycompany/app'.
WARN: File '/opt/workspace/eclipse/java/my-app/src/main/java/com/mycompany/app/sonar-scanner.properties' is ignored. It is not located in project basedir '/opt/workspace/eclipse/java/my-app/target/classes/com/mycompany/app'.
INFO: 0 files indexed
INFO: ------------- Run sensors on module com.mycompany.app:my-app
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=38ms
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by net.sf.cglib.core.ReflectUtils$1 (file:/home/dogzilla/.sonar/cache/54f6535c111cefad0fb6a09ba3e61922/sonar-javascript-plugin.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of net.sf.cglib.core.ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
INFO: Sensor SonarCSS Rules [cssfamily]
INFO: No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
INFO: Sensor SonarCSS Rules [cssfamily] (done) | time=1ms
INFO: Sensor JaCoCo XML Report Importer [jacoco]
INFO: 'sonar.coverage.jacoco.xmlReportPaths' is not defined. Using default locations: target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
INFO: No report imported, no coverage information will be imported by JaCoCo XML Report Importer
INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=3ms
INFO: Sensor JavaXmlSensor [java]
INFO: Sensor JavaXmlSensor [java] (done) | time=0ms
INFO: ------------- Run sensors on project
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=0ms
INFO: SCM Publisher is disabled
INFO: CPD Executor Calculating CPD for 0 files
INFO: CPD Executor CPD calculation finished (done) | time=0ms
INFO: Analysis report generated in 70ms, dir size=77 KB
INFO: Analysis report compressed in 12ms, zip size=9 KB
INFO: Analysis report uploaded in 35ms
INFO: ANALYSIS SUCCESSFUL, you can browse http://192.168.56.111:9000/dashboard?id=com.mycompany.app%3Amy-app
INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
INFO: More about the report processing at http://192.168.56.111:9000/api/ce/task?id=AXQeYMFVCyJo7mZCTWSk
INFO: Analysis total time: 2.802 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 3.561s
INFO: Final Memory: 6M/37M
INFO: ------------------------------------------------------------------------

Access denied for Sonar database

I encounter an 'Access denied' error when connecting to the Sonar database. Below the trace:
[workspace] $ /var/lib/jenkins/tools/hudson.plugins.sonar.SonarRunnerInstallation/Sonar/bin/sonar-runner -Dsonar.jdbc.driver=com.mysql.jdbc.Driver -Dsonar.jdbc.url=jdbc:mysql://tridev002.xxxxx.net:3306/sonar ******** ******** -Dsonar.host.url=http://tridev002.xxxx.net:9000/ ******** ******** "-Dsonar.projectBaseDir=/var/lib/jenkins/jobs/Test Sonar/workspace"
SonarQube Runner 2.4
Java 1.7.0_72 Oracle Corporation (64-bit)
Linux 3.2.0-4-amd64 amd64
INFO: Runner configuration file: /var/lib/jenkins/tools/hudson.plugins.sonar.SonarRunnerInstallation/Sonar/conf/sonar-runner.properties
INFO: Project configuration file: NONE
INFO: Default locale: "en_US", source code encoding: "UTF-8" (analysis is platform dependent)
INFO: Work directory: /var/lib/jenkins/jobs/Test Sonar/workspace/.sonar
INFO: SonarQube Server 4.5.1
13:44:54.656 INFO - Load global referentials...
13:44:54.825 INFO - Load global referentials done: 173 ms
13:44:54.833 INFO - User cache: /var/lib/jenkins/.sonar/cache
13:44:54.841 INFO - Install plugins
13:44:54.920 INFO - Install JDBC driver
13:44:54.926 INFO - Create JDBC datasource for jdbc:mysql://tridev002.xxxxx.net:3306/sonar
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 1.494s
Final Memory: 8M/241M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: Fail to connect to database
ERROR: Caused by: Cannot create PoolableConnectionFactory (Access denied for user 'jenkins-sonar'#'tridev002.xxxxx.net' (using password: YES))
ERROR: Caused by: Access denied for user 'jenkins- sonar'#'tridev002.xxxxx.net' (using password: YES)
ERROR:
ERROR: To see the full stack trace of the errors, re-run SonarQube Runner with the -e switch.
ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging.
Build step 'Invoke Standalone Sonar Analysis' marked build as failure
In the Jenkins configuration the Database URL, Database login en Database password are set correctly. With this URL and credentials it is possible to log in via a mysql command line client and we can view the sonar database tables.
We also checked the permissions of the database user and these are set correctly.
We checked the sonar.properties file and everything is commented out.
If we add sonar.jdbc.username and sonar.jdbc.password to the project properties, the connection with the database is successfull. But the password is in plain text then, which is unadvisable.
Does anyone know why the credentials of the system configuration is not used? And what is the solution? Is this a bug in SonarQube?

Read timed out on /batch/project (SonarQube 4.5)

I am struggling with the following problem.
Log of the executed when sonar-runner in Jenkins.
SonarQube Runner 2.4
Java 1.7.0_67 Oracle Corporation (64-bit)
Windows 7 6.1 amd64
SONAR_RUNNER_OPTS=-Xms256m -Xmx512m
INFO: Runner configuration file: D:\CI_BUILD\sonar-runner-2.4\conf\sonar-runner.properties
INFO: Project configuration file: NONE
INFO: Default locale: "ko_KR", source code encoding: "UTF-8"
INFO: Work directory: D:\CI_BUILD\jenkins_home\jobs\CAFE-CLIENT\workspace\.sonar
INFO: SonarQube Server 4.5
05:17:52.119 INFO - Load global referentials...
05:17:53.382 INFO - Load global referentials done: 1263 ms
05:17:53.414 INFO - User cache: C:\Users\pcms_build\.sonar\cache
05:17:53.445 INFO - Install plugins
05:17:54.225 INFO - Install JDBC driver
05:17:54.303 INFO - Create JDBC datasource for jdbc:jtds:sqlserver://10.240.232.145/sonardb;SelectMethod=Cursor
05:17:56.222 INFO - Initializing Hibernate
05:17:59.217 INFO - Load project referentials...
05:18:19.232 INFO - Load project referentials done: 20015 ms
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 34.757s
Final Memory: 21M/291M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: Unable to request: /batch/project?key=CAFE-CLIENT&preview=false
ERROR: Caused by: Read timed out
ERROR:
ERROR: To see the full stack trace of the errors, re-run SonarQube Runner with the -e switch.
ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging.
Build step 'Invoke Standalone Sonar Analysis' marked build as failure
05:18:19.232 INFO - Load project referentials done: 20015 ms
When "Load project referentials done" value is larger than 20,000 ms,
Always "Read timed out" occurs.
Loading of project referentials is not expected to take more than a few seconds. It is very likely you have a performance issue on your SQ server (or with your DB). Here are some criteria that may increase duration of this web service:
you have installed a lot of language plugins or you have enabled a lot of rules in quality profiles
your project is a multi-module project with a lot of modules
Compare for example with:
http://nemo.sonarqube.org/batch/project?key=org.codehaus.sonar%3Asonar&preview=true
that returns more than 1000 rules and 33 modules. It takes less than 2 seconds to return data.
EDIT: it seems there was some SQL issues depending on your DB vendor. See http://jira.codehaus.org/browse/SONAR-5849 and http://jira.codehaus.org/browse/SONAR-6063. Should be fixed in upcoming 4.5.3

Resources