I am using sonarcloud to scan a maven project.
The analysis is fine but jenkins does not get the result. It returns
“No previous SonarQube analysis found on this pipeline execution. Please use the ‘withSonarQubeEnv’ wrapper to run your analysis.”
what am I doing wrong
ganncamp
(G Ann Campbell)
September 26, 2022, 4:35pm
2
Hi,
Perhaps the docs on pausing your pipeline for the Quality Gate status will help.
Ann
I have followed the steps…below is the build log
/home/ec2-user/tools/hudson.plugins.sonar.SonarRunnerInstallation/Sonarscanner/bin/sonar-scanner -Dsonar.projectBaseDir=/home/ec2-user/workspace/BIS_development@2 -Dsonar.organization=baxi -Dproject.settings=./sonar-project.properties -Dsonar.qualitygate.wait=true
INFO: Scanner configuration file: /home/ec2-user/tools/hudson.plugins.sonar.SonarRunnerInstallation/Sonarscanner/conf/sonar-scanner.properties
INFO: Project root configuration file: /home/ec2-user/workspace/BIS_development@2/./sonar-project.properties
INFO: SonarScanner 4.6.0.2311
INFO: Java 11.0.16 Amazon.com Inc. (64-bit)
INFO: Linux 4.14.287-215.504.amzn2.x86_64 amd64
INFO: User cache: /home/ec2-user/.sonar/cache
INFO: Scanner configuration file: /home/ec2-user/tools/hudson.plugins.sonar.SonarRunnerInstallation/Sonarscanner/conf/sonar-scanner.properties
INFO: Project root configuration file: /home/ec2-user/workspace/BIS_development@2/./sonar-project.properties
INFO: Analyzing on SonarCloud
INFO: Default locale: "en_US", source code encoding: "UTF-8"
INFO: Load global settings
INFO: Load global settings (done) | time=233ms
INFO: Server id: 1BD809FA-AWHW8ct9-T_TB3XqouNu
INFO: User cache: /home/ec2-user/.sonar/cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=222ms
INFO: Load/download plugins (done) | time=4222ms
INFO: Loaded core extensions: developer-scanner
INFO: Found an active CI vendor: 'Jenkins'
INFO: Load project settings for component key: 'bis'
INFO: Load project settings for component key: 'bis' (done) | time=214ms
INFO: Process project properties
INFO: Execute project builders
INFO: Execute project builders (done) | time=1ms
INFO: Project key: bis
INFO: Base dir: /home/ec2-user/workspace/BIS_development@2
INFO: Working dir: /home/ec2-user/workspace/BIS_development@2/.scannerwork
INFO: Load project branches
INFO: Load project branches (done) | time=203ms
INFO: Check ALM binding of project 'bis'
INFO: Detected project binding: NOT_BOUND
INFO: Check ALM binding of project 'bis' (done) | time=184ms
INFO: Load project pull requests
INFO: Load project pull requests (done) | time=178ms
INFO: Load branch configuration
INFO: Load branch configuration (done) | time=2ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=237ms
INFO: Load active rules
INFO: Load active rules (done) | time=2362ms
INFO: Organization key: baxi
INFO: Load project repositories
INFO: Load project repositories (done) | time=542ms
INFO: Indexing files...
INFO: Project configuration:
INFO: Excluded sources: **/build-wrapper-dump.json
INFO: 603 files indexed
INFO: 0 files ignored because of inclusion/exclusion patterns
INFO: 0 files ignored because of scm ignore settings
INFO: Quality profile for java: Sonar way
INFO: ------------- Run sensors on module bis
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=189ms
INFO: Sensor JavaSensor [java]
INFO: Configured Java source version (sonar.java.source): none
INFO: JavaClasspath initialization
INFO: JavaClasspath initialization (done) | time=2ms
INFO: JavaTestClasspath initialization
INFO: JavaTestClasspath initialization (done) | time=1ms
INFO: Server-side caching is enabled. The Java analyzer will not try to leverage data from a previous analysis.
INFO: Using ECJ batch to parse 603 Main java source files with batch size 411 KB.
INFO: Starting batch processing.
INFO: The Java analyzer cannot skip unchanged files in this context. A full analysis is performed for all files.
INFO: 100% analyzed
INFO: Batch processing: Done.
INFO: Did not optimize analysis for any files, performed a full analysis for all 603 files.
WARN: Dependencies/libraries were not provided for analysis of SOURCE files. The 'sonar.java.libraries' property is empty. Verify your configuration, as you might end up with less precise results.
WARN: Unresolved imports/types have been detected during analysis. Enable DEBUG mode to see them.
WARN: Use of preview features have been detected during analysis. Enable DEBUG mode to see them.
INFO: No "Test" source files to scan.
INFO: No "Generated" source files to scan.
INFO: Sensor JavaSensor [java] (done) | time=14210ms
INFO: Sensor C# Project Type Information [csharp]
INFO: Sensor C# Project Type Information [csharp] (done) | time=1ms
INFO: Sensor C# Analysis Log [csharp]
INFO: Sensor C# Analysis Log [csharp] (done) | time=12ms
INFO: Sensor C# Properties [csharp]
INFO: Sensor C# Properties [csharp] (done) | time=0ms
INFO: Sensor SurefireSensor [java]
INFO: parsing [/home/ec2-user/workspace/BIS_development@2/target/surefire-reports]
INFO: Sensor SurefireSensor [java] (done) | time=1ms
INFO: Sensor HTML [web]
INFO: Sensor HTML [web] (done) | time=4ms
INFO: Sensor Text Sensor [text]
INFO: 603 source files to be analyzed
INFO: 603/603 source files have been analyzed
INFO: Sensor Text Sensor [text] (done) | time=76ms
INFO: Sensor VB.NET Project Type Information [vbnet]
INFO: Sensor VB.NET Project Type Information [vbnet] (done) | time=0ms
INFO: Sensor VB.NET Analysis Log [vbnet]
INFO: Sensor VB.NET Analysis Log [vbnet] (done) | time=12ms
INFO: Sensor VB.NET Properties [vbnet]
INFO: Sensor VB.NET Properties [vbnet] (done) | time=0ms
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 CSS Rules [javascript]
INFO: No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
INFO: Sensor CSS Rules [javascript] (done) | time=1ms
INFO: Sensor ThymeLeaf template sensor [securityjavafrontend]
INFO: Sensor ThymeLeaf template sensor [securityjavafrontend] (done) | time=4ms
INFO: Sensor Serverless configuration file sensor [security]
INFO: 0 Serverless function entries were found in the project
INFO: 0 Serverless function handlers were kept as entrypoints
INFO: Sensor Serverless configuration file sensor [security] (done) | time=4ms
INFO: Sensor AWS SAM template file sensor [security]
INFO: Sensor AWS SAM template file sensor [security] (done) | time=0ms
INFO: Sensor javabugs [dbd]
INFO: Reading IR files from: /home/ec2-user/workspace/BIS_development@2/.scannerwork/ir/java
INFO: Analyzing 1934 functions to detect bugs.
INFO: Sensor javabugs [dbd] (done) | time=6109ms
INFO: Sensor pythonbugs [dbd]
INFO: Reading IR files from: /home/ec2-user/workspace/BIS_development@2/.scannerwork/ir/python
INFO: No IR files have been included for analysis.
INFO: Sensor pythonbugs [dbd] (done) | time=2ms
INFO: Sensor JavaSecuritySensor [security]
INFO: Reading type hierarchy from: /home/ec2-user/workspace/BIS_development@2/.scannerwork/ucfg2/java
INFO: Read 1103 type definitions
INFO: Reading UCFGs from: /home/ec2-user/workspace/BIS_development@2/.scannerwork/ucfg2/java
INFO: 02:56:20.860561 Building Runtime Type propagation graph
INFO: 02:56:20.878029 Running Tarjan on 1002 nodes
INFO: 02:56:20.881093 Tarjan found 991 components
INFO: 02:56:20.885006 Variable type analysis: done
INFO: 02:56:20.887399 Building Runtime Type propagation graph
INFO: 02:56:20.895147 Running Tarjan on 1002 nodes
INFO: 02:56:20.896076 Tarjan found 991 components
INFO: 02:56:20.897925 Variable type analysis: done
INFO: Analyzing 708 ucfgs to detect vulnerabilities.
INFO: All rules entrypoints : 0
INFO: Retained UCFGs : 0
INFO: Taint analysis starting. Entrypoints: 0
INFO: Taint analysis: done.
INFO: Sensor JavaSecuritySensor [security] (done) | time=1402ms
INFO: Sensor CSharpSecuritySensor [security]
INFO: Reading type hierarchy from: /home/ec2-user/workspace/BIS_development@2/ucfg_cs2
INFO: Read 0 type definitions
INFO: Reading UCFGs from: /home/ec2-user/workspace/BIS_development@2/ucfg_cs2
INFO: No UCFGs have been included for analysis.
INFO: Sensor CSharpSecuritySensor [security] (done) | time=1ms
INFO: Sensor PhpSecuritySensor [security]
INFO: Reading type hierarchy from: /home/ec2-user/workspace/BIS_development@2/.scannerwork/ucfg2/php
INFO: Read 0 type definitions
INFO: Reading UCFGs from: /home/ec2-user/workspace/BIS_development@2/.scannerwork/ucfg2/php
INFO: No UCFGs have been included for analysis.
INFO: Sensor PhpSecuritySensor [security] (done) | time=0ms
INFO: Sensor PythonSecuritySensor [security]
INFO: Reading type hierarchy from: /home/ec2-user/workspace/BIS_development@2/.scannerwork/ucfg2/python
INFO: Read 0 type definitions
INFO: Reading UCFGs from: /home/ec2-user/workspace/BIS_development@2/.scannerwork/ucfg2/python
INFO: No UCFGs have been included for analysis.
INFO: Sensor PythonSecuritySensor [security] (done) | time=0ms
INFO: Sensor JsSecuritySensor [security]
INFO: Reading type hierarchy from: /home/ec2-user/workspace/BIS_development@2/.scannerwork/ucfg2/js
INFO: Read 0 type definitions
INFO: Reading UCFGs from: /home/ec2-user/workspace/BIS_development@2/.scannerwork/ucfg2/js
INFO: No UCFGs have been included for analysis.
INFO: Sensor JsSecuritySensor [security] (done) | time=1ms
INFO: ------------- Run sensors on project
INFO: Sensor Analysis Warnings import [csharp]
INFO: Sensor Analysis Warnings import [csharp] (done) | time=0ms
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=33ms
INFO: Sensor Java CPD Block Indexer
INFO: Sensor Java CPD Block Indexer (done) | time=288ms
INFO: CPD Executor 279 files had no CPD blocks
INFO: CPD Executor Calculating CPD for 324 files
INFO: CPD Executor CPD calculation finished (done) | time=74ms
INFO: Analysis report generated in 695ms, dir size=3 MB
INFO: Analysis report compressed in 670ms, zip size=1 MB
INFO: Analysis report uploaded in 428ms
INFO: ------------- Check Quality Gate status
INFO: Waiting for the analysis report to be processed (max 300s)
INFO: QUALITY GATE STATUS: PASSED - View details on https://sonarcloud.io/dashboard?id=bis
INFO: Analysis total time: 42.118 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 49.686s
INFO: Final Memory: 128M/460M
INFO: ------------------------------------------------------------------------
Blockquote
still tells me “No previous analysis found”
Colin
(Colin)
September 27, 2022, 8:49am
4
Hey there.
You can’t use both sonar.qualitygate.wait=true
and the waitForQualityGate
step – you get to use one or other.
It still fails with same error
Colin:
waitForQualityGate
ste
This worked!
Thanks Colin
system
(system)
Closed
October 4, 2022, 9:56am
7
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.