Sonar scanner issue in jenkins - jenkins

I am trying to integrate sonar with Jenkins in my local, when integrating the build is successfully and execution is success, but it is not getting finished success, it show below error and it show out of memory
INFO: ANALYSIS SUCCESSFUL, you can browse http://localhost:9000/dashboard/index/al-config-server
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://localhost:9000/api/ce/task?id=AWWunlqCAbj3m24yQM89
INFO: Task total time: 6.254 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 8.008s
INFO: Final Memory: 57M/313M
INFO: ------------------------------------------------------------------------
****** B A T C H R E C U R S I O N exceeds STACK limits ******
Recursion Count=593, Stack Usage=90 percent
****** B A T C H PROCESSING IS A B O R T E D ******
WARN: Found multiple 'report-task.txt' in the workspace. Taking the first one.
C:\Users\sreenath.reddy\.jenkins\workspace\al-config-server\.scannerwork\report-task.txt
C:\Users\sreenath.reddy\.jenkins\workspace\al-config-server\target\sonar\report-task.txt
WARN: Found multiple 'report-task.txt' in the workspace. Taking the first one.
C:\Users\sreenath.reddy\.jenkins\workspace\al-config-server\.scannerwork\report-task.txt
C:\Users\sreenath.reddy\.jenkins\workspace\al-config-server\target\sonar\report-task.txt
ERROR: SonarQube scanner exited with non-zero code: 255
Finished: FAILURE

Related

jenkines gat stuck at sonar-qube analysis. The analysis and successfully, but the job stuck

Im running sonar in Jenkins job. The analysis stage end successfully, but after that, the job get stuck, there is nothing in the log, but after a few min I get out off memory error and the job fails.
my sonar property file:
sonar.language=javascript
# sources
sonar.sources=src
sonar.exclusions=**/node_modules/**
# tests
sonar.tests=src
sonar.test.inclusions=**/*.test.js
# tests reports
sonar.testExecutionReportPaths=reports/test-reporter.xml
sonar.javascript.lcov.reportPaths=coverage/lcov.info
sonar.verbose=true
the log:
13:31:10 13:31:10.683 INFO: Analysis report generated in 522ms, dir size=4 MB
13:31:12 13:31:12.797 INFO: Analysis report compressed in 2114ms, zip size=2 MB
13:31:12 13:31:12.797 INFO: Analysis report generated in /my_reports_loc
13:31:12 13:31:12.797 DEBUG: Upload report
13:31:12 13:31:12.955 DEBUG: POST 200 http://my-sonar/api/ce/submit?projectKeymyProjt&projectName=projectNamet | time=157ms
13:31:12 13:31:12.958 INFO: Analysis report uploaded in 161ms
13:31:12 13:31:12.959 DEBUG: Report metadata written to /my_reports_loc
13:31:12 13:31:12.959 INFO: ANALYSIS SUCCESSFUL, you can browse http://my-sonar/dashboard?id=my-project
13:31:12 13:31:12.959 INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
13:31:12 13:31:12.959 INFO: More about the report processing at http://my-sonar/api/ce/task?id=my_id
13:31:12 13:31:12.964 DEBUG: eslint-bridge server will shutdown
13:31:13 13:31:13.208 DEBUG: stylelint-bridge server will shutdown
13:31:13 13:31:13.209 INFO: Analysis total time: 42.940 s
13:31:13 13:31:13.230 INFO: ------------------------------------------------------------------------
13:31:13 13:31:13.230 INFO: EXECUTION SUCCESS
13:31:13 13:31:13.230 INFO: ------------------------------------------------------------------------
13:31:13 13:31:13.230 INFO: Total time: 44.469s
13:31:13 13:31:13.369 INFO: Final Memory: 43M/1106M
13:31:13 13:31:13.369 INFO: ------------------------------------------------------------------------
[Pipeline] }
[Pipeline] //
[Pipeline] }
[Pipeline] //
13:33:47 java.lang.OutOfMemoryError: GC overhead limit exceeded
Finished: FAILURE
You need to increase the Heap Size.
The error about GC overhead implies that Jenkins is thrashing in Garbage Collection. This means it's probably spending more time doing Garbage Collection than doing useful work. This situation normally comes about when the heap is too small for the application.
This post will help you in case if you need to know, how to increase help size for jenkins.

integrate SonarQube with jenkins

im trying to integrate SonarQube with jenkins but im facing some errors
This is my analysis properties
sonar.projectBaseDir=/var/lib/jenkins/workspace/sonarqube
sonar.language=Java
#sonar.login=
sonar.projectVersion=1.0
sonar.sources=.
sonar.verbose=true
sonar.projectKey=sonarqube
sonar.host.url=http://x.xxx.xx.xxx:9000/
sonar.projectName=sonarqube
sonar.sourceEncoding=UTF-8
sonar.project.settings=/var/lib/jenkins/workspace/sonarqube/sonarqube-scanner/sonar-project.properties
sonar.analysis.mode=publish
sonar.buildbreaker.skip=true
It shows me this error msg
08:02:22.935 DEBUG: Extract sonar-scanner-api-batch in temp...
08:02:22.961 DEBUG: Get bootstrap index...
08:02:22.962 DEBUG: Download: http://x.xxx.xx.xxx:9000/batch/index
08:02:27.994 ERROR: SonarQube server [http://x.xxx.xx.xxx:9000/] can not be reached
08:02:27.994 INFO: ------------------------------------------------------------------------
08:02:27.994 INFO: EXECUTION FAILURE
08:02:27.994 INFO: ------------------------------------------------------------------------
08:02:27.995 INFO: Total time: 5.588s
08:02:28.020 INFO: Final Memory: 3M/56M
08:02:28.020 INFO: ------------------------------------------------------------------------
08:02:28.020 ERROR: Error during SonarScanner execution
org.sonarsource.scanner.api.internal.ScannerException: Unable to execute SonarScanner analysis
is there any suggestion for this problem?

Sonarqube scan ends with "INFO: ANALYSIS SUCCESSFUL" but sonarqube UI says "Project is not analyzed yet."

I have a jenkins job that is triggered when a PR is made to a bitbucket repository. The job will run a sonarqube scan of the repository.
Then, I use sonarqube plugin called sonar-for-bitbucket that will make a PR comment summarizing the analysis.
This part happens successfully.
This is my sonarqube configuration in jenkins.
This is the console output
...
INFO: ANALYSIS SUCCESSFUL
INFO: Executing post-job Sonar Plug-in for Bitbucket Cloud
INFO: [sonar4bitbucket] Plug-in is active and will analyze pull request with #199...
INFO: Task total time: 1:25.408 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 1:27.292s
INFO: Final Memory: 64M/827M
INFO: ------------------------------------------------------------------------
WARN: Unable to locate 'report-task.txt' in the workspace. Did the SonarScanner succedeed?
Finished: SUCCESS
However, when I go to sonarqube UI it doesn't show any analysis result.
I also tried running this from my macbook with sonar-scanner. Got the same result.
INFO: ANALYSIS SUCCESSFUL
INFO: Task total time: 35.944 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 2:50.449s
INFO: Final Memory: 28M/813M
INFO: ------------------------------------------------------------------------

SonarQube Scanner not sending result to SonarQube after executing in a Jenkins job

After SonarQube Scanner was executed by a Jenkins job, the analysis result is not being uploaded to the SonarQube server:
00:15:23.616 INFO: ANALYSIS SUCCESSFUL
00:15:23.621 DEBUG: Post-jobs : GitHub Pull Request Issue Publisher (wrapped)
00:15:23.621 INFO: Executing post-job GitHub Pull Request Issue Publisher (wrapped)
In one of my other Jenkins jobs, the result is actually uploaded to SonarQube with this log which is not found for above case:
INFO: Sensor CPD Block Indexer (done) | time=0ms
INFO: 20 files had no CPD blocks
INFO: Calculating CPD for 46 files
INFO: CPD calculation finished
INFO: Analysis report generated in 312ms, dir size=1 MB
INFO: Analysis reports compressed in 227ms, zip size=561 KB
INFO: Analysis report uploaded in 256ms
Is there anything I can do to fix this?

Report code coverage result from vsts to sonar

I have generate code coverage report from vsts and trying to report the result in sonar using arguments /d:sonar.cs.vscoveragexml.reportsPaths="C:\Agent\_work\1\s\TestResults\*\*\*\*.coverage but its throwing error
06:47:28.705 INFO - Sensor org.sonar.plugins.csharp.CSharpCodeCoverageProvider$CSharpCoverageReportImportSensor#4d437408
06:47:28.734 INFO - Parsing the Visual Studio coverage XML report C:\Agent\_work\1\s\TestResults\Priyanka_WINDOWSVM 2016-09-21 06_47_04\In\WINDOWSVM\Priyanka_WINDOWSVM 2016-09-21 06_46_46.coverage
06:47:28.878 DEBUG - Release semaphore on project : org.sonar.api.resources.Project#6b283550[id=213,key=MVCandWebApi,qualifier=TRK], with key batch-MVCandWebApi
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 13.942s
INFO: Final Memory: 24M/462M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution
java.lang.IllegalStateException: Error while parsing the XML file: C:\Agent\_work\1\s\TestResults\Priyanka_WINDOWSVM 2016-09-21 06_47_04\In\WINDOWSVM\Priyanka_WINDOWSVM 2016-09-21 06_46_46.coverage
at org.sonar.plugins.dotnet.tests.XmlParserHelper.nextStartTag(XmlParserHelper.java:74)
at org.sonar.plugins.dotnet.tests.XmlParserHelper.checkRootTag(XmlParserHelper.java:56)
at org.sonar.plugins.dotnet.tests.VisualStudioCoverageXmlReportParser$Parser.checkRootTag(VisualStudioCoverageXmlReportParser.java:121)
at org.sonar.plugins.dotnet.tests.VisualStudioCoverageXmlReportParser$Parser.parse(VisualStudioCoverageXmlReportParser.java:56)
at org.sonar.plugins.dotnet.tests.VisualStudioCoverageXmlReportParser.parse(VisualStudioCoverageXmlReportParser.java:37)
at org.sonar.plugins.dotnet.tests.CoverageCache.readCoverageFromCacheOrParse(CoverageCache.java:38)
at org.sonar.plugins.dotnet.tests.CoverageAggregator.aggregate(CoverageAggregator.java:107)
at org.sonar.plugins.dotnet.tests.CoverageAggregator.aggregate(CoverageAggregator.java:98)
at org.sonar.plugins.dotnet.tests.CoverageReportImportSensor.analyze(CoverageReportImportSensor.java:79)

Resources