sonarqube v5.4 analysis failed on WARN messages - sonarqube

My cobertura coverage on sonarqube v4.5.6 with runner-2.4, and 2.5.1 has some warning "WARN-File not found:" but the sonar analysis complete successfully.
However, when the same job run on sonarqube v5.4 with same runner versions, the sonar analysis failed with "execution failure". I haven't found a way to ignore this warning for now. Has anyone run into the same issue and got it resolved? Thanks,
...
02:03:48.202 INFO - Sensor Groovy CoberturaSensor
02:03:48.202 INFO - Analyzing Cobertura report: target/test-reports/cobertura/coverage.xml
02:03:48.402 WARN - File not found: Route1.groovy
02:03:48.402 WARN - File not found: Route2.groovy
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
...

Related

Snoarqube- I keep getting the error "The 'report' parameter is missing"

I can not seem to find any answers regarding this issue
5:04:56.635 INFO: ------------------------------------------------------------------------
05:04:56.635 INFO: EXECUTION FAILURE
05:04:56.635 INFO: ------------------------------------------------------------------------
05:04:56.635 INFO: Total time: 28.403s
05:04:56.849 INFO: Final Memory: 63M/1435M
05:04:56.849 INFO: ------------------------------------------------------------------------
05:04:56.849 ERROR: Error during SonarQube Scanner execution
The 'report' parameter is missing
05:04:56.850 DEBUG: Execution getVersion
05:04:56.850 DEBUG: Execution stop
For me, this was that the SonarQube server had a full HDD
Re-run SonarQube using the -X switch to enable full debug logging.

SonarQube upgrade from 6.4 to 6.5 breaks the scanner

I am on sonarQube6.4 and have upgraded to 6.5
Sonar-scanner is 3.0.3
Now after the upgrade the scanner fails anytime there is a java file in the source path. If I don't scan java files everything works just fine.
However If I rollback an use 6.4 version, everything works fine, so is there any regression? This is the stack trace, when I run the scanner command with -X command. So is it a mandate in 6.5 to provided the location of all compiled classed, is there a way to ignore it.
04:56:21.218 DEBUG: Sensors : JavaSquidSensor -> SurefireSensor ->
JaCoCoSensor -> SonarJavaXmlFileSensor -> Analyzer for "php.ini" files
-> Zero Coverage Sensor -> CPD Block Indexer 04:56:21.218 INFO: Sensor JavaSquidSensor [java] 04:56:21.558 INFO: Configured Java source
version (sonar.java.source): none 04:56:21.565 INFO: JavaClasspath
initialization 04:56:21.570 INFO:
------------------------------------------------------------------------ 04:56:21.571 INFO: EXECUTION FAILURE 04:56:21.571 INFO:
------------------------------------------------------------------------ 04:56:21.571 INFO: Total time: 6.545s 04:56:21.707 INFO: Final Memory:
51M/1083M 04:56:21.707 INFO:
------------------------------------------------------------------------ 04:56:21.707 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.(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:78)
at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:179)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:144)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:129)
at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:261)
at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:256)
at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:245)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:144)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:129)
at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:47)
at org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:84)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:144)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:129)
at org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:119)
at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:116)
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) 04:56:21.710 DEBUG: Execution getVersion 04:56:21.711 DEBUG: Execution
stop
When I run the same with 6.4, it works fine and the only warning I see in the console is :
04:52:42.738 WARN: Bytecode of dependencies was not provided for analysis of source files, you might end up with less precise results. Bytecode can be provided using sonar.java.libraries property
Error during SonarQube Scanner execution
org.sonar.squidbridge.api.AnalysisException: Please provide compiled
classes of your project with sonar.java.binaries property
Since SonarJava 4.12, you must specify sonar.java.binaries property https://docs.sonarqube.org/display/PLUG/Java+Plugin+and+Bytecode
Example :
sonar-scanner -Dsonar.projectKey=fr.demo:my-project -Dsonar.sources=. -Dsonar.java.binaries=.
The error message says:
Error during SonarQube Scanner execution org.sonar.squidbridge.api.AnalysisException:
Please provide compiled classes of your project with sonar.java.binaries property
It seems like the java sensor requires the .class files, in addition to the .java files.
You could:
Add those files to the analysis (it will by the way give you more valuable sonar findings!)
Try adding and removing files to find out, which piece of code causes the issue and report it as a Sonar Java bug
I had this issue as well and I fixed it in the following way:
This page mentions about an entry which was optional before and became mandatory during the latest update (4.12). It says that the sonar.java.binaries entry in the Jenkins project settings should be set. When set, even to a faulty folder, it will fix your errors, leaving only a warning and your pipeline will be running again.
The setting should be added to Jenkins -> "your project" -> Configuration -> Build -> Execute SonarQube Scanner -> Analysis Properties. Add this entry and point it to your binaries folder.
Even i was also facing same issue after SonarQube upgrade to latest 6.5 version. But after downgrading SonarJava plugin(from 4.12 to 4.11), it worked.
Hope it will help you.

SonarQube Plugin

I am trying to run sonar analysis and the execution is failing.The error I am seeing :-
Using build-wrapper output: /Users/../out/build-wrapper-dump.json
14:26:01 14:23:02.369 INFO: EXECUTION FAILURE
14:26:01 14:23:02.369 INFO: ------------------------------------------------------------------------
14:26:01 14:23:02.369 INFO: Total time: 28.484s
14:26:01 14:23:02.503 INFO: Final Memory: 83M/1248M
14:26:01 14:23:02.503 ERROR: Error during SonarQube Scanner execution
14:26:01 java.lang.RuntimeException: java.io.FileNotFoundException: /Users/.../app/build-wrapper-dump.json (No such file or directory)
In the sonar project properties I specified sonar.cfamily.build-wrapper-output=app/out

Execution failure, unable to request: /deploy/jdbc-driver.txt

We used a Master/Slaves Jenkins architecture to perform SonarQube. When i runned my job,
Sonar was unable to execute and request the file /deploy/jdbc-driver.txt. I didn't find the reason, my properties files (Sonar server and sonar runner) seems to be good.
Could you help me please ?
Best regards,
David Parcoit
[IBP.DVB] $ D:\sonar-runner\bin\sonar-runner.bat -Dsonar.jdbc.driver=com.mysql.jdbc.Driver "-Dsonar.jdbc.url=jdbc:mysql://ibicer05.srv-ib.dev:54301/sonar?autoReconnect=true&useUnicode=true&characterEncoding=utf8" ******** ******** -Dsonar.host.url=http://ibicer00.srv-ib.dev:8090/sonar "-Dsonar.projectBaseDir=E:\Jenkins\workspace\DVB - Build Quotidien\IBP.DVB" -Dsonar.sourceEncoding=UTF-8 -Dsonar.dotnet.excludeGeneratedCode=true -Dsonar.dotnet.buildConfigurations=Release -Dsonar.language=cs -Dsonar.sources=. -Dsonar.gendarme.mode=skip -Dsonar.projectVersion=1.0.0.0 -Dsonar.projectKey=IBP.DVB -Dsonar.ndeps.mode=skip -Dsonar.dotnet.visualstudio.solution.file=IBP.DVB.sln -Dsonar.projectName=DVB
D:\sonar-runner
SonarQube Runner 2.4
Java 1.8.0_05 Oracle Corporation (64-bit)
Windows Server 2012 6.2 amd64
INFO: Runner configuration file: D:\sonar-runner\conf\sonar-runner.properties
INFO: Project configuration file: NONE
INFO: Default locale: "en_US", source code encoding: "UTF-8"
INFO: Work directory: E:\Jenkins\workspace\DVB - Build Quotidien\IBP.DVB\.sonar
INFO: SonarQube Server 3.7.4
23:47:37.351 INFO - Load batch settings
23:47:37.507 INFO - User cache: C:\Windows\system32\config\systemprofile\.sonar\cache
23:47:37.523 INFO - Install plugins
23:47:42.265 INFO - Install JDBC driver
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 13.573s
Final Memory: 4M/44M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: Unable to request: /deploy/jdbc-driver.txt
ERROR: Caused by: Unexpected end of ZLIB input stream
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
Finished: FAILURE

Unable to run Sonar

I am trying to analyse my solution (C# .NET) using sonar. Unfortunately after plugins loading it is failing with following stacktrace:
14:53:19.646 DEBUG - Release semaphore on project : org.sonar.api.resources.Project#7f9b2bab[id=3169,key=com.exigenservices:cm,qualifier=TRK], with key batch-com.exigenservices:cm
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 2:12.629s
Final Memory: 13M/405M
ERROR: Error during Sonar runner execution
INFO: ------------------------------------------------------------------------
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:90)
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:41)
Caused by: java.util.NoSuchElementException
at java.util.HashMap$HashIterator.nextEntry(HashMap.java:929)
at java.util.HashMap$ValueIterator.next(HashMap.java:954)
at org.sonar.dotnet.tools.commons.visualstudio.VisualStudioProject.getArtifactDirectory(VisualStudioProject.java:178)
at org.sonar.dotnet.tools.commons.visualstudio.VisualStudioProject.getArtifact(VisualStudioProject.java:195)
at org.sonar.dotnet.tools.commons.visualstudio.VisualStudioProject.getGeneratedAssemblies(VisualStudioProject.java:209)
at org.sonar.plugins.csharp.api.sensor.AbstractRegularCSharpSensor.assembliesFound(AbstractRegularCSharpSensor.java:101)
at org.sonar.plugins.csharp.api.sensor.AbstractRegularCSharpSensor.shouldExecuteOnProject(AbstractRegularCSharpSensor.java:81)
at org.sonar.plugins.csharp.api.sensor.AbstractRuleBasedCSharpSensor.shouldExecuteOnProject(AbstractRuleBasedCSharpSensor.java:48)
at org.sonar.batch.bootstrap.BatchExtensionDictionnary.shouldKeep(BatchExtensionDictionnary.java:62)
at org.sonar.batch.bootstrap.BatchExtensionDictionnary.getFilteredExtensions(BatchExtensionDictionnary.java:52)
at org.sonar.batch.bootstrap.BatchExtensionDictionnary.select(BatchExtensionDictionnary.java:42)
at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:63)
at org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:114)
at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:150)
Actually in sonar cache (.sonar) directory presented following plugins:
checkstyle
core
cpd
csharp
csharpfxcop
csharpgallio
csharpgendarme
csharpndeps
csharpsquid
csharpstylecop
dbcleaner
design
emailnotifications
findbugs
jacoco
java
l10nen
mavenbatch
pmd
squidjava
surefire
Unfortunately I have not any idea hot to fix it and where is an issue due poorness of sonar debug messages.
The Visual Studio project parser in SonarQube's .Net plugins expect to find the output files using this xpath:
"/vst:Project/vst:PropertyGroup[contains(#Condition,'" + config + "')]/vst:OutputPath"
where config is the build configuration it has determined it should use.
From what I can tell looking at the current source code and the exception stack trace you provided (which don't line up exactly), the exception is getting thrown on this line:
if (artifactDirectory == null) {
// just take the first one found...
artifactDirectory = buildConfOutputDirMap.values().iterator().next();
which implies that it couldn't find any build output for your project.
If you find that your csproj file has a different location for the OutputPath, please submit a bug report to the SonarQube user mailing list so that it can be fixed in the future.
This means that the CSPROJ file of your project is not correct and is missing some information about the artifact directory where the assembly is generated.

Resources