SonarQube RTC jazz plugin failing - jenkins

I am working in a .NET environment. I am currently using Jenkins to kick off my automated builds, SCM is Rational Team Concert. I am using SonarQube with the MSBuild Scanner, and the "SonarQube Jazz RTC SCM Plugin" to retrieve blame info (annotate in Rational). Most of the time this works perfectly. Sporadically I was seeing failures with no specific details of why the call was failing. If I resubmited the same jenkins job the run would succeed and I would get my scans through, including all my blame info. Recently in one of my jobs the failures started happening every time, and on the exact same file every time. This is the stack that I get out of the jenkins console log.
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 3:16.401s
ERROR: Error during SonarQube Scanner execution
INFO: Final Memory: 47M/138M
INFO: ------------------------------------------------------------------------
java.lang.IllegalStateException: The jazz annotate command [cmd /C call lscm annotate -u _serviceAccount -P somePassword Areas/SomeArea/Scripts/SomeFile.js] failed:
at org.sonar.plugins.scm.jazzrtc.JazzRtcBlameCommand.blame(JazzRtcBlameCommand.java:74)
at org.sonar.plugins.scm.jazzrtc.JazzRtcBlameCommand.blame(JazzRtcBlameCommand.java:58)
at org.sonar.scanner.scm.ScmSensor.execute(ScmSensor.java:86)
at org.sonar.scanner.sensor.SensorWrapper.analyse(SensorWrapper.java:53)
at org.sonar.scanner.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:57)
at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:49)
at org.sonar.scanner.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:78)
at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:184)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:241)
at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:236)
at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:234)
at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:226)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:47)
at org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:86)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
at org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:115)
at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:118)
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:62)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
at com.sun.proxy.$Proxy0.execute(Unknown Source)
at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:233)
at org.sonarsource.scanner.api.EmbeddedScanner.runAnalysis(EmbeddedScanner.java:151)
at org.sonarsource.scanner.cli.Main.runAnalysis(Main.java:110)
at org.sonarsource.scanner.cli.Main.execute(Main.java:74)
at org.sonarsource.scanner.cli.Main.main(Main.java:61)
ERROR:
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
The SonarQube Scanner did not complete successfully
I have set the -X switch like its asking for and I do not get any more detailed info. I have also tried setting the trace setting in the sonar.log.level to trace in the SonarQube.Analysis.xml file and I can not seem to get any more details about my failure. There is nothing special that I can see about the file that it is failing on. Its JavaScript, its ~1700 lines long. It was getting the annotate/blame calls successfully up until a couple days ago.
Anyone have this issue? Anyone know what I can do to get more details about my failure? Any help is appreciated.
Version info: SonarQube 6.0 SonarQube Jazz Plugin 1.1 Rational
6.0.3 iFix005
Update 1: 8/29
After 11 failed runs, I finally got it to go through without any errors. This is how it looked.
- Run1 failed on FileA
- Run2 failed on FileA
- Run3 failed on FileA
- Run4 failed on FileA
- Run5 failed on FileA
- Run6 failed on FileA
- Run7 failed on FileA
- Run8 aborted
- Run9 failed on FileB
- Run10 failed on FileB
- Run11 failed on FileB
- Run12 successful on all files.
This problem is not gone, but just back to random failures.

Related

Sonarqube Source error in jenkins build

I am trying to analyze my project with sonarqube scanner in Jenkins. However when I'm building job it's always reporting some kind of an error, more exactly:
INFO: Option -e/--errors is no longer supported and will be ignored
INFO: Scanner configuration file: /var/jenkins_home/tools/hudson.plugins.sonar.SonarRunnerInstallation/SonarScanner1/conf/sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: SonarQube Scanner 3.0.3.778
INFO: Java 1.8.0_151 Oracle Corporation (64-bit)
INFO: Linux 4.9.60-linuxkit-aufs amd64
INFO: User cache: /var/jenkins_home/.sonar/cache
INFO: Publish mode
INFO: Load global settings
INFO: Load global settings (done) | time=232ms
INFO: Server id: AWEptYvpPRWpK4xbT0G4
INFO: User cache: /var/jenkins_home/.sonar/cache
INFO: Load plugins index
INFO: Load plugins index (done) | time=124ms
INFO: SonarQube server 6.7.1
INFO: Default locale: "en", source code encoding: "UTF-8" (analysis is platform dependent)
INFO: Process project properties
ERROR: Invalid value of sonar.sources for test
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 3.218s
INFO: Final Memory: 42M/114M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution
ERROR: The folder 'polacpat/Documents/Jenkins2/workspace/SonarScanningTestProject/src/test' does not exist for 'test' (base directory = /var/jenkins_home/workspace/SonarScanningTestProject)
ERROR:
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
ERROR: SonarQube scanner exited with non-zero code: 1
Finished: FAILURE
Those are my Sonarqube analysis properties
AnalysisProperties
This is location of my project, it's automatically created because code is from gitlab...
Project Location
Now I don't really understand how does this work and how should I configure it. I have added the same name to a new sonarqube project and also sonarqube project key I have created within a sonarqube which is connected with a jenkins to those analyse properties in here, I don't understand how exactly does this works...
Updated folder:
Wrong Folder Being Analysed
Updated second error log after trying to set: sonar.sources=./src or
sonar.sources=./src/main
11:19:28.650 ERROR: Error during SonarQube Scanner execution
org.sonar.squidbridge.api.AnalysisException: Please provide compiled classes of your project with sonar.java.binaries property
at org.sonar.java.JavaClasspath.init(JavaClasspath.java:59)
at org.sonar.java.AbstractJavaClasspath.getElements(AbstractJavaClasspath.java:281)
at org.sonar.java.SonarComponents.getJavaClasspath(SonarComponents.java:141)
at org.sonar.java.JavaSquid.<init>(JavaSquid.java:83)
at org.sonar.plugins.java.JavaSquidSensor.execute(JavaSquidSensor.java:83)
at org.sonar.scanner.sensor.SensorWrapper.analyse(SensorWrapper.java:53)
at org.sonar.scanner.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:88)
at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:82)
at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:68)
at org.sonar.scanner.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:88)
at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:180)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:121)
at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:288)
at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:283)
at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:261)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:121)
at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:48)
at org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:84)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:121)
at org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:121)
at org.sonar.batch.bootstrapper.Batch.doExecuteTask(Batch.java:116)
at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:111)
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:63)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
at com.sun.proxy.$Proxy0.execute(Unknown Source)
at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:233)
at org.sonarsource.scanner.api.EmbeddedScanner.runAnalysis(EmbeddedScanner.java:151)
at org.sonarsource.scanner.cli.Main.runAnalysis(Main.java:123)
at org.sonarsource.scanner.cli.Main.execute(Main.java:77)
at org.sonarsource.scanner.cli.Main.main(Main.java:61)
11:19:28.651 DEBUG: Execution getVersion
11:19:28.656 DEBUG: Execution stop
ERROR: SonarQube scanner exited with non-zero code: 1
Finished: FAILURE
"Invalid value of sonar.sources for test"
sonar.sources must be relative to worskspace
sonar.sources=./src/test
And
Please provide compiled classes of your project with sonar.java.binaries property
means you need set sonar.java.binaries pointing to binaries
sonar.java.binaries=target/classes
See sonar paramenters

Sonar + Jenkins job execution error

It's been a week since I tried to deploy this solution locally on my machine and then deploy it to a production server.
However, I faced many difficulties and incomprehension, that is what I did:
Sonar installation via apt-get and launch of it on port 9000 of localhost.
Installation of Jenkins via apt-get and launch of it on port 8080 of localhost.
Download the Sonar plugin for Jenkins.
After trying to running a job, it failed because :
ERROR: Error during SonarQube Scanner execution org.sonarqube.ws.client.HttpException:
The full error stack is:
ERROR: Error during SonarQube Scanner execution
org.sonarqube.ws.client.HttpException: Error 500 on http:/localhost:9000/api/ce/submit?projectKey=sonar.org:projectname&projectName=devops : {"errors":[{"msg":"An error has occurred. Please contact your administrator"}]}
at org.sonarqube.ws.client.BaseResponse.failIfNotSuccessful(BaseResponse.java:36)
at org.sonar.scanner.bootstrap.ScannerWsClient.failIfUnauthorized(ScannerWsClient.java:106)
at org.sonar.scanner.bootstrap.ScannerWsClient.call(ScannerWsClient.java:75)
at org.sonar.scanner.report.ReportPublisher.upload(ReportPublisher.java:177)
at org.sonar.scanner.report.ReportPublisher.execute(ReportPublisher.java:131)
at org.sonar.scanner.phases.PublishPhaseExecutor.publishReportJob(PublishPhaseExecutor.java:72)
at org.sonar.scanner.phases.PublishPhaseExecutor.executeOnRoot(PublishPhaseExecutor.java:54)
at org.sonar.scanner.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:83)
at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:175)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:143)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:128)
at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:262)
at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:257)
at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:247)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:143)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:128)
at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:47)
at org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:86)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:143)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:128)
at org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:118)
at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:117)
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:63)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
at com.sun.proxy.$Proxy0.execute(Unknown Source)
at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:233)
at org.sonarsource.scanner.api.EmbeddedScanner.runAnalysis(EmbeddedScanner.java:151)
at org.sonarsource.scanner.cli.Main.runAnalysis(Main.java:123)
at org.sonarsource.scanner.cli.Main.execute(Main.java:77)
at org.sonarsource.scanner.cli.Main.main(Main.java:61)
http://localhost:9000/api/ce/submit?projectKey=sonar.org:projectname&projectName=devops
: {"errors":[{"msg":"An error has occurred. Please contact your administrator"}]}
When I searched on the SonarQube logs I saw that :
2017.05.02 23:35:25 ERROR web[AVvKZ3JA+DB4lMWaAACV][o.s.s.w.WebServiceEngine] Fail to process
request http:/localhost:9000/api/qualityprofiles/restore
java.lang.IllegalStateException: Can't read file part at
org.sonar.server.ws.ServletRequest.readPart(ServletRequest.java:102)
...
Caused by: java.io.IOException: The temporary upload location [/root/Documents/sonarqube-6.3.1/temp/tc/work/Tomcat/localhost/ROOT] is not valid
As seen in "The temporary upload location is not valid", make sure that the folder /root/Documents/sonarqube-6.3.1/temp/tc/work/Tomcat/localhost/ROOT
does exist
is 775 by the user running Sonar.
Or (as seen here) you can define the temporary folder to another location
JVM_OPTIONS="-Xrs -Xms256m -Xmx512m -Djava.io.tmpdir=/opt/another/tmp"
See this thread and this thread as examples.

SonarQube integration with Jenkins

I am trying to integrate SonarQube runner in my build process. My build steps consists of an ant build and sonar-runner task. I have attached the Screenshots later. I am getting an error stating "
Unable to determine database dialect to use within sonar with dialect
null jdbc url localhost
Build step 'Invoke Standalone SonarQube Analysis' marked build as failure
"-
[MyProject] $ /var/lib/jenkins/tools/hudson.plugins.sonar.SonarRunnerInstallation/Default-SonarQube-Runner/bin/sonar-runner -X -e -Dsonar.jdbc.url=localhost ******** ******** -Dsonar.host.url=http://qa.MyProject.com:9000 ******** ******** -Dsonar.projectBaseDir=/var/lib/jenkins/workspace/MyProject -Dproject.settings=/var/lib/jenkins/workspace/MyProject/sonar-project.properties
SonarQube Runner 2.4
Java 1.7.0_95 Oracle Corporation (64-bit)
Linux 3.13.0-48-generic amd64
INFO: Error stacktraces are turned on.
INFO: Runner configuration file: /var/lib/jenkins/tools/hudson.plugins.sonar.SonarRunnerInstallation/Default-SonarQube-Runner/conf/sonar-runner.properties
INFO: Project configuration file: /var/lib/jenkins/workspace/MyProject/sonar-project.properties
INFO: Default locale: "en_US", source code encoding: "UTF-8"
INFO: Work directory: /var/lib/jenkins/workspace/MyProject/.sonar
INFO: SonarQube Server 5.1
07:06:34.641 INFO - Load global repositories
07:06:34.651 DEBUG - Download: http://qa.MyProject.com:9000/batch/global (no proxy)
07:06:34.744 INFO - Load global repositories (done) | time=105ms
07:06:34.745 INFO - Server id: 20160304110723
07:06:34.747 INFO - User cache: /var/lib/jenkins/.sonar/cache
07:06:34.755 INFO - Install plugins
07:06:34.755 DEBUG - Download index of plugins
07:06:34.755 DEBUG - Download: http://qa.MyProject.com:9000/deploy/plugins/index.txt (no proxy)
07:06:34.841 DEBUG - Loaded 2196 properties from l10n bundles
07:06:34.842 INFO - Install JDBC driver
07:06:34.842 DEBUG - Download index of jdbc-driver
07:06:34.842 DEBUG - Download: http://qa.MyProject.com:9000/deploy/jdbc-driver.txt (no proxy)
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 0.681s
Final Memory: 3M/59M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
org.sonar.runner.impl.RunnerException: Unable to execute Sonar
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
at java.security.AccessController.doPrivileged(Native Method)
at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
at org.sonar.runner.api.Runner.execute(Runner.java:100)
at org.sonar.runner.Main.executeTask(Main.java:70)
at org.sonar.runner.Main.execute(Main.java:59)
at org.sonar.runner.Main.main(Main.java:53)
Caused by: Unable to determine database dialect to use within sonar with dialect null jdbc url localhost
Build step 'Invoke Standalone SonarQube Analysis' marked build as failure
Finished: FAILURE
Inside my Jenkins->Manage Jenkins->Configure System , I have configured the sonar qube section as shown in the screenshot below-
Here is the screenshot of my build config-
I am not getting the clue on how to debug ? Any suggestion ?
Here are the version details-
SonarQube Runner 2.4
Sonar Version 5.1
Can you double check if you are specifying the correct JDBC URL. In the screenshot attached, SonarQube is configured with datasource URL as 'localhost'.
The stacktrace again says you do not have a database dialect specified. This can be specified in the sonar properties file.
I realised, what was wrong here. I had added incorrect database dialect in my jenkins configuration (Jenkins->Manage Jenkins->Configure System). See the screenshot. Earlier i had used
localhost
instead of
jdbc:mysql://localhost:3306/sonar?autoReconnect=true&useUnicode=true&characterEncoding=utf8

Sonarqube with Jenkins and sonarqube runner

We have configured SOnarqube with Jenkins and sonarqube runner.
Getting following error on building:
Can you please help:
NFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
org.sonar.runner.impl.RunnerException: Unable to execute Sonar
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
at java.security.AccessController.doPrivileged(Native Method)
at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
at org.sonar.runner.api.Runner.execute(Runner.java:100)
at org.sonar.runner.Main.executeTask(Main.java:70)
at org.sonar.runner.Main.execute(Main.java:59)
at org.sonar.runner.Main.main(Main.java:53)
Caused by: java.lang.IllegalStateException: The svn blame command [svn blame --xml --non-interactive -x -w ext/projectmgt/ProjectNumberAutoSuggestion.java] failed: svn: E155036: Please see the 'svn upgrade' command
svn: E155036: The working copy at 'C:\CodeReview\JenkinsHome\jobs\Test\workspace'
is too old (format 29) to work with client version '1.8.13 (r1667537)' (expects format 31). You need to upgrade the working copy first.
at org.sonar.plugins.scm.svn.SvnBlameCommand.blame(SvnBlameCommand.java:110)
at org.sonar.plugins.scm.svn.SvnBlameCommand.access$000(SvnBlameCommand.java:45)
at org.sonar.plugins.scm.svn.SvnBlameCommand$1.call(SvnBlameCommand.java:91)
at org.sonar.plugins.scm.svn.SvnBlameCommand$1.call(SvnBlameCommand.java:88)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
ERROR:
ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging.
Build step 'Invoke Standalone SonarQube Analysis' marked build as failure
Finished: FAILURE
The problem looks pretty clear to me. The workspace was checked out with an older version of SVN, below 1.8. When sonar is trying to run, it is using SVN 1.8 which won't work if the workspace was checked out with a previous SVN version. There are two options here:
Delete the workspace and do the checkout with SVN 1.8
Configure Jenkins to use the same version of SVN you used to check out the code.

Sonar-qube 4.5 Timeout issue with big project

I'm using Jenkins to run sonar on all my projects. One of them have over 2 millions line of code and started to produce a timeout error when connecting to sonar (posted bellow is the jenkins build log):
[JENKINS] Archiving /app/users/jenkins/jobs/*****RunSonar/workspace/******/pom.xml to com.****.***.****/****Gui/9.1.0/****Gui-9.1.0.pom
[JENKINS] Archiving /app/users/jenkins/jobs/****_****Gui_RunSonar/workspace/****Gui/target/****Gui.war to com.****.***.****/****Gui/9.1.0/****Gui-9.1.0.war
channel stopped
[workspace] $ /app/tools/apache-maven-3.2.1/bin/mvn -f /app/users/jenkins/jobs/****_****Gui_RunSonar/workspace/****Gui/pom.xml -Dgitbranch=my_development -e -B sonar:sonar -Dsonar.preview.readTimeout=90000 -Dsonar.jdbc.driver=oracle.jdbc.driver.OracleDriver -Dsonar.jdbc.url=jdbc:oracle:thin:#mydb:1521:orcl ******** ******** -Dsonar.host.url=https://********/sonar/ -Dsonar.branch=$gitbranch ******** ********
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.****.***.****:****Gui:war:9.1.0
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-war-plugin is missing. # line 408, column 23
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building ****Gui 9.1.0
[INFO] ------------------------------------------------------------------------
[WARNING] The artifact aspectj:aspectjrt:jar:1.5.4 has been relocated to org.aspectj:aspectjrt:jar:1.5.4
[WARNING] The artifact aspectj:aspectjweaver:jar:1.5.4 has been relocated to org.aspectj:aspectjweaver:jar:1.5.4
[WARNING] The artifact org.apache.commons:commons-io:jar:1.3.2 has been relocated to commons-io:commons-io:jar:1.3.2
[INFO]
[INFO] --- sonar-maven-plugin:2.5:sonar (default-cli) # ****Gui ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 34.033 s
[INFO] Finished at: 2015-01-14T10:31:44+00:00
[INFO] Final Memory: 12M/148M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.5:sonar (default-cli) on project ****Gui: Execution default-cli of goal org.codehaus.mojo:sonar-maven-plugin:2.5:sonar failed: SonarQube server can not be reached at https://********/sonar. Please check the parameter 'sonar.host.url'. connect timed out -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.5:sonar (default-cli) on project *******: Execution default-cli of goal org.codehaus.mojo:sonar-maven-plugin:2.5:sonar failed: SonarQube server can not be reached at https://********/sonar. Please check the parameter 'sonar.host.url'.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:224)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:108)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal org.codehaus.mojo:sonar-maven-plugin:2.5:sonar failed: SonarQube server can not be reached at https://*********/sonar. Please check the parameter 'sonar.host.url'.
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:144)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
Caused by: java.lang.IllegalStateException: SonarQube server can not be reached at https://********/sonar. Please check the parameter 'sonar.host.url'.
at org.codehaus.mojo.sonar.ServerMetadata.getVersion(ServerMetadata.java:70)
at org.codehaus.mojo.sonar.ServerMetadata.logSettings(ServerMetadata.java:84)
at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:128)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
... 20 more
Caused by: java.net.SocketTimeoutException: connect timed out
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:579)
at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:618)
at sun.net.NetworkClient.doConnect(NetworkClient.java:175)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)
at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:275)
at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:371)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:191)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:932)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:153)
at org.codehaus.mojo.sonar.ServerMetadata.getConnection(ServerMetadata.java:119)
at org.codehaus.mojo.sonar.ServerMetadata.remoteContent(ServerMetadata.java:91)
at org.codehaus.mojo.sonar.ServerMetadata.getVersion(ServerMetadata.java:66)
... 23 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
Sonar analysis completed: FAILURE
I'm pretty sure the sonar.host.url is correct because all of my other jobs in jenkins that run sonar are working. I already tried to use the "sonar.preview.readTimeout" property but with no success. Sonar produces no log.
Does anyone have any idea how to run sonar to avoid this problem?
Best regards
Have you tried with localhost instead and see if its able to connect to localhost at the very least? For localhost you need to have sonar server running locally of course.

Resources