SonarQube: Failed to upload report

I am getting the below error while running the sonarqube in azure pipeline.
I have no idea on what to do next. I would appreciate any advice to get this running. Thanks for the help.

SonarQube version: 7.9.4

Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin: (default-cli) on project xxxx: Failed to upload report - An error has occurred. Please contact your administrator → [Help 1]

Hey there.

You can probably find details about why the project failed to upload in the logs/web.log file for your SonarQube instance.

Hi Colin,
Thanks for the response. The below is the log which got while running Sonar in Azure pipeline. Please let me know if you need any other inputs,
2021-04-09T07:25:06.0969400Z [INFO] User cache: C:\Users\AzDevOps.sonar\cache
2021-04-09T07:25:07.2024549Z [INFO] SonarQube version: 7.9.4
2021-04-09T07:25:07.2430464Z [INFO] Default locale: “en_US”, source code encoding: “windows-1252” (analysis is platform dependent)
2021-04-09T07:25:07.4884310Z [WARNING] SonarScanner will require Java 11 to run starting in SonarQube 8.x
2021-04-09T07:25:07.6799359Z [INFO] Load global settings
2021-04-09T07:25:07.8872893Z [INFO] Load global settings (done) | time=203ms
2021-04-09T07:25:07.8874795Z [INFO] Server id: 14458AED-1aa489f766049a6
2021-04-09T07:25:07.8875547Z [INFO] User cache: C:\Users\AzDevOps.sonar\cache
2021-04-09T07:25:07.8876110Z [INFO] Load/download plugins
2021-04-09T07:25:07.8876601Z [INFO] Load plugins index
2021-04-09T07:25:07.9735543Z [INFO] Load plugins index (done) | time=78ms
2021-04-09T07:25:11.5676890Z [INFO] Plugin [l10nja] defines ‘l10nen’ as base plugin. This metadata can be removed from manifest of l10n plugins since version 5.2.
2021-04-09T07:25:17.2769263Z [INFO] Load/download plugins (done) | time=9392ms
2021-04-09T07:25:17.6929886Z [WARNING] API compatibility mode is no longer supported. In case of error, plugin Japanese Pack [l10nja] should package its dependencies.
2021-04-09T07:25:18.8665496Z [INFO] Process project properties
2021-04-09T07:25:18.8736334Z [INFO] Execute project builders
2021-04-09T07:25:18.8916854Z [INFO] Execute project builders (done) | time=0ms
2021-04-09T07:25:18.8918812Z [INFO] Project key: OBL_QA
2021-04-09T07:25:18.8919733Z [INFO] Base dir: C:\a\4\s
2021-04-09T07:25:18.8920613Z [INFO] Working dir: C:\a\4\s\target\sonar
2021-04-09T07:25:19.0249660Z [INFO] Load project settings for component key: ‘OBL_QA’
2021-04-09T07:25:19.0741834Z [INFO] Load project settings for component key: ‘OBL_QA’ (done) | time=31ms
2021-04-09T07:25:19.1295656Z [INFO] Load project branches
2021-04-09T07:25:19.1480017Z [INFO] Load project branches (done) | time=15ms
2021-04-09T07:25:19.1504145Z [INFO] Load project pull requests
2021-04-09T07:25:19.1636879Z [INFO] Load project pull requests (done) | time=0ms
2021-04-09T07:25:19.1638144Z [INFO] Load branch configuration
2021-04-09T07:25:19.1669659Z [INFO] Load branch configuration (done) | time=0ms
2021-04-09T07:25:19.2113369Z [INFO] Load quality profiles
2021-04-09T07:25:19.3054064Z [INFO] Load quality profiles (done) | time=78ms
2021-04-09T07:25:19.3056251Z [INFO] Detected Azure DevOps
2021-04-09T07:25:19.3056934Z [INFO] Load active rules
2021-04-09T07:25:20.1819421Z [INFO] Load active rules (done) | time=875ms
2021-04-09T07:25:20.2568262Z [INFO] Branch name: feature/wi-50505/wi-automation-sonarqubepoc, type: short living
2021-04-09T07:25:20.2569873Z [INFO] SCM collecting changed files in the branch
2021-04-09T07:25:20.8183358Z [INFO] SCM collecting changed files in the branch (done) | time=594ms
2021-04-09T07:25:20.9870187Z [INFO] Indexing files…
2021-04-09T07:25:21.0803423Z [INFO] Project configuration:
2021-04-09T07:25:21.4658420Z [INFO] 132 files indexed
2021-04-09T07:25:21.4675308Z [INFO] 0 files ignored because of scm ignore settings
2021-04-09T07:25:21.4676471Z [INFO] Quality profile for java: Sonar way
2021-04-09T07:25:21.4678207Z [INFO] ------------- Run sensors on module OblFalcon
2021-04-09T07:25:22.0386020Z [INFO] Load metrics repository
2021-04-09T07:25:22.4094783Z [INFO] Load metrics repository (done) | time=31ms
2021-04-09T07:25:24.5960837Z [INFO] Sensor JavaSquidSensor [java]
2021-04-09T07:25:24.7431878Z [INFO] Configured Java source version ( 8
2021-04-09T07:25:24.7637668Z [INFO] JavaClasspath initialization
2021-04-09T07:25:24.7639551Z [INFO] JavaClasspath initialization (done) | time=31ms
2021-04-09T07:25:24.7640601Z [INFO] JavaTestClasspath initialization
2021-04-09T07:25:24.7642041Z [INFO] JavaTestClasspath initialization (done) | time=32ms
2021-04-09T07:25:24.8839806Z [INFO] Java Main Files AST scan
2021-04-09T07:25:24.9550840Z [INFO] 49 source files to be analyzed
2021-04-09T07:25:35.4380422Z [INFO] 6/49 files analyzed, current file: src/main/java/web/pageObjects/
2021-04-09T07:25:45.4093916Z [INFO] 29/49 files analyzed, current file: src/main/java/web/pageObjects/
2021-04-09T07:25:55.2426199Z [INFO] 49/49 source files have been analyzed
2021-04-09T07:25:55.2428381Z [INFO] Java Main Files AST scan (done) | time=30339ms
2021-04-09T07:25:55.2430106Z [INFO] Java Test Files AST scan
2021-04-09T07:25:55.2431157Z [INFO] 83 source files to be analyzed
2021-04-09T07:26:02.9538320Z [WARNING] Invalid character encountered in file C:/a/4/s/src/test/java/web/test/xxxxx/ at line 33 for encoding UTF-8. Please fix file content or configure the encoding to be used using property ‘sonar.sourceEncoding’.
2021-04-09T07:26:05.2909690Z [INFO] 52/83 files analyzed, current file: src/test/java/web/test/myPortal/
2021-04-09T07:26:10.0057820Z [INFO] 83/83 source files have been analyzed
2021-04-09T07:26:10.0069234Z [INFO] Java Test Files AST scan (done) | time=14752ms
2021-04-09T07:26:10.0071227Z [INFO] Java Generated Files AST scan
2021-04-09T07:26:10.0264683Z [INFO] 0 source files to be analyzed
2021-04-09T07:26:10.0721083Z [INFO] Java Generated Files AST scan (done) | time=0ms
2021-04-09T07:26:10.1490439Z [INFO] Sensor JavaSquidSensor [java] (done) | time=45482ms
2021-04-09T07:26:10.1538695Z [INFO] Sensor CoberturaSensor [cobertura]
2021-04-09T07:26:10.1539930Z [WARNING] Cobertura report not found at C:\a\4\s\target\site\cobertura\coverage.xml
2021-04-09T07:26:10.1540931Z [INFO] Sensor CoberturaSensor [cobertura] (done) | time=16ms
2021-04-09T07:26:10.1541690Z [INFO] Sensor SonarCSS Rules [cssfamily]
2021-04-09T07:26:10.1542476Z [INFO] No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
2021-04-09T07:26:10.1543369Z [INFO] Sensor SonarCSS Rules [cssfamily] (done) | time=0ms
2021-04-09T07:26:10.1544090Z [INFO] Sensor PmdSensor [pmd]
2021-04-09T07:26:10.2264560Z [INFO] Sensor PmdSensor [pmd] (done) | time=0ms
2021-04-09T07:26:10.2265611Z [INFO] Sensor SurefireSensor [java]
2021-04-09T07:26:10.2266442Z [INFO] parsing [C:\a\4\s\target\surefire-reports]
2021-04-09T07:26:10.2274823Z [INFO] Sensor SurefireSensor [java] (done) | time=31ms
2021-04-09T07:26:10.2275928Z [INFO] Sensor JavaXmlSensor [java]
2021-04-09T07:26:10.2276732Z [INFO] Sensor JavaXmlSensor [java] (done) | time=0ms
2021-04-09T07:26:10.2277538Z [INFO] Sensor HTML [web]
2021-04-09T07:26:10.2278275Z [INFO] Sensor HTML [web] (done) | time=0ms
2021-04-09T07:26:10.2280421Z [INFO] Sensor com.github.mc1arke.sonarqube.plugin.scanner.ScannerConfigurationLoaderSensor
2021-04-09T07:26:10.2281508Z [INFO] Sensor com.github.mc1arke.sonarqube.plugin.scanner.ScannerConfigurationLoaderSensor (done) | time=15ms
2021-04-09T07:26:10.2282500Z [INFO] Sensor Clover Coverage Analysis [clover]
2021-04-09T07:26:10.2283261Z [WARNING] Clover XML report not found
2021-04-09T07:26:10.2284021Z [INFO] 0/0 source files have been analyzed
2021-04-09T07:26:10.2284871Z [INFO] Sensor Clover Coverage Analysis [clover] (done) | time=16ms
2021-04-09T07:26:10.2285735Z [INFO] Sensor JaCoCo XML Report Importer [jacoco]
2021-04-09T07:26:10.2286533Z [INFO] Sensor JaCoCo XML Report Importer [jacoco] (done) | time=15ms
2021-04-09T07:26:10.2287355Z [INFO] Sensor FindBugs Sensor [findbugs]
2021-04-09T07:26:12.0506502Z [INFO] Loading findbugs plugin: C:\a\4\s\target\sonar\findbugs\findsecbugs-plugin.jar
2021-04-09T07:26:12.1009955Z [INFO] Findbugs output report: C:\a\4\s\target\sonar\findbugs-result.xml
2021-04-09T07:26:48.3032791Z The following classes needed for analysis were missing:
2021-04-09T07:26:48.3336467Z call
2021-04-09T07:26:48.3959052Z apply
2021-04-09T07:26:48.3960319Z test
2021-04-09T07:26:48.3982070Z accept
2021-04-09T07:26:48.4060026Z [INFO] Sensor FindBugs Sensor [findbugs] (done) | time=38219ms
2021-04-09T07:26:48.4061198Z [INFO] ------------- Run sensors on project
2021-04-09T07:26:48.4065950Z [INFO] Sensor Dependency-Check [dependencycheck]
2021-04-09T07:26:48.4066766Z [INFO] Process Dependency-Check report
2021-04-09T07:26:48.4067466Z [INFO] Using JSON-Reportparser
2021-04-09T07:26:48.4068790Z [INFO] Dependency-Check JSON report does not exists. Please check property sonar.dependencyCheck.jsonReportPath:C:\a\4\s\target\dependency-check-report.json
2021-04-09T07:26:48.4070096Z [INFO] JSON-Analysis skipped/aborted due to missing report file
2021-04-09T07:26:48.4070855Z [INFO] Using XML-Reportparser
2021-04-09T07:26:48.4072073Z [INFO] Dependency-Check XML report does not exists. Please check property sonar.dependencyCheck.xmlReportPath:C:\a\4\s\target\dependency-check-report.xml
2021-04-09T07:26:48.4229329Z [INFO] XML-Analysis skipped/aborted due to missing report file
2021-04-09T07:26:48.4342724Z [INFO] Dependency-Check HTML report does not exists. Please check property sonar.dependencyCheck.htmlReportPath:C:\a\4\s\target\dependency-check-report.html
2021-04-09T07:26:48.4627142Z [INFO] HTML-Dependency-Check report does not exist.
2021-04-09T07:26:48.4628662Z [INFO] Process Dependency-Check report (done) | time=47ms
2021-04-09T07:26:48.4629673Z [INFO] Sensor Dependency-Check [dependencycheck] (done) | time=47ms
2021-04-09T07:26:48.4630523Z [INFO] Sensor Zero Coverage Sensor
2021-04-09T07:26:48.6470619Z [INFO] Sensor Zero Coverage Sensor (done) | time=156ms
2021-04-09T07:26:48.6472345Z [INFO] Sensor Java CPD Block Indexer
2021-04-09T07:26:49.1342448Z [INFO] Sensor Java CPD Block Indexer (done) | time=563ms
2021-04-09T07:26:49.1349228Z [INFO] SCM provider for this project is: git
2021-04-09T07:26:49.1350586Z [INFO] 1 files to be analyzed
2021-04-09T07:26:49.5021452Z [INFO] 1/1 files analyzed
2021-04-09T07:26:49.5030707Z [INFO] Calculating CPD for 49 files
2021-04-09T07:26:50.9200460Z The process ‘C:\ProgramData\chocolatey\lib\maven\apache-maven-3.6.3\bin\mvn.cmd’ failed with exit code 1
2021-04-09T07:26:50.9202033Z Could not retrieve code analysis results - Maven run failed.
2021-04-09T07:26:50.9203189Z [INFO] CPD calculation finished
2021-04-09T07:26:50.9204397Z [INFO] SCM writing changed lines
2021-04-09T07:26:50.9205077Z [INFO] SCM writing changed lines (done) | time=140ms
2021-04-09T07:26:50.9205853Z [INFO] Analysis report generated in 328ms, dir size=645 KB
2021-04-09T07:26:50.9206649Z [INFO] Analysis report compressed in 157ms, zip size=187 KB
2021-04-09T07:26:50.9207550Z [INFO] Analysis report generated in C:\a\4\s\target\sonar\scanner-report
2021-04-09T07:26:50.9208513Z [INFO] ------------------------------------------------------------------------
2021-04-09T07:26:50.9209597Z [INFO] BUILD FAILURE
2021-04-09T07:26:50.9210392Z [INFO] ------------------------------------------------------------------------
2021-04-09T07:26:50.9211236Z [INFO] Total time: 02:18 min
2021-04-09T07:26:50.9211951Z [INFO] Finished at: 2021-04-09T07:26:50Z
2021-04-09T07:26:50.9212836Z [INFO] ------------------------------------------------------------------------
2021-04-09T07:26:50.9214413Z [ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin: (default-cli) on project OblFalcon: Failed to upload report - An error has occurred. Please contact your administrator → [Help 1]
2021-04-09T07:26:50.9215786Z [ERROR]
2021-04-09T07:26:50.9216571Z [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
2021-04-09T07:26:50.9217548Z [ERROR] Re-run Maven using the -X switch to enable full debug logging.
2021-04-09T07:26:50.9218244Z [ERROR]
2021-04-09T07:26:50.9219175Z [ERROR] For more information about the errors and possible solutions, please read the following articles:
2021-04-09T07:26:50.9220603Z [ERROR] [Help 1]
2021-04-09T07:26:51.3956944Z Result Attachments will be stored in LogStore
2021-04-09T07:26:51.4067278Z Run Attachments will be stored in LogStore
2021-04-09T07:26:51.4333513Z No Result Found to Publish ‘C:\a\4\s\target\surefire-reports\TEST-TestSuite.xml’.
2021-04-09T07:26:51.4402400Z ##[error]Build failed.
2021-04-09T07:26:51.4468539Z ##[section]Async Command Start: Publish test results
2021-04-09T07:26:51.5221963Z ##[section]Async Command End: Publish test results
2021-04-09T07:26:51.5223069Z ##[section]Finishing: Maven

Hey there.

These are analysis logs – not logs from your SonarQube instance (installed on a server somewhere).

Hi Colin,
I am not able to find the logs which you have mentioned in Sonarqube Instance. Could you pls. help is there any other way to resolve it.

Is there a logs directory for your SonarQube installation directory?

❯ ls -la
total 16
drwxr-xr-x@ 12 colin staff 384 Jul 28 2020 .
drwxr-xr-x 15 colin staff 480 Apr 6 10:48 …
-rw-r–r–@ 1 colin staff 7651 Jul 28 2020 COPYING
drwxr-xr-x@ 6 colin staff 192 Jul 28 2020 bin
drwxr-xr-x@ 4 colin staff 128 Jul 28 2020 conf
drwxr-xr-x@ 8 colin staff 256 Mar 22 12:12 data
drwxr-xr-x@ 10 colin staff 320 Jul 28 2020 elasticsearch
drwxr-xr-x@ 5 colin staff 160 Feb 17 09:38 extensions
drwxr-xr-x@ 9 colin staff 288 Jul 28 2020 lib
drwxr-xr-x@ 16 colin staff 512 Mar 23 11:48 logs
drwxr-xr-x@ 7 colin staff 224 Mar 23 11:48 temp
drwxr-xr-x@ 23 colin staff 736 Jul 28 2020 web

Hi Colin,
Report does not reach Sonarqube Instance and its failing in Azure devops pipeline itself, so we are not able to find any logs in it.

This error is coming from your SonarQube instance – the logs of which are located in the logs directory of your SonarQube installation. Where is your SonarQube installation (do you know what server it is installed on)?

Hi Colin,
Thanks for your Input. Able to find the web.logs with the help of server team and the below error was thrown,
2021.04.12 07:26:11 ERROR web[AXiZwR+6ecbXcPbFBuGr][o.s.s.w.WebServiceEngine] Fail to process request
java.lang.IllegalStateException: Current edition does not support branch feature

Could you pls. help on this?

Looks like an error you get when you try and install commercial features on a Community Edition of SonarQube instance via not-so native means. Sorry, we won’t be able to help there.

It seems we are facing the same issue with Enterprise Edition of SonarQube - 8.7

Find the error log:

  1. INFO: Sensor Zero Coverage Sensor (done) | time=86ms

INFO: CPD Executor 13 files had no CPD blocks

INFO: CPD Executor Calculating CPD for 89 files

INFO: CPD Executor CPD calculation finished (done) | time=110ms

INFO: Load New Code definition

INFO: Load New Code definition (done) | time=12ms

INFO: Analysis report generated in 187ms, dir size=902 KB

INFO: Analysis report compressed in 339ms, zip size=369 KB

INFO: ------------------------------------------------------------------------


INFO: ------------------------------------------------------------------------

INFO: Total time: 39.931s

INFO: Final Memory: 9M/34M

INFO: ------------------------------------------------------------------------

##[error]ERROR: Error during SonarScanner execution

ERROR: Error during SonarScanner execution

##[error]ERROR: Failed to upload report - An error has occurred. Please contact your administrator

ERROR: Failed to upload report - An error has occurred. Please contact your administrator



##[error]The SonarScanner did not complete successfully

The SonarScanner did not complete successfully

##[error]12:05:15.504 Post-processing failed. Exit code: 1

12:05:15.504 Post-processing failed. Exit code: 1

##[error]The process ‘D:\a_tasks\SonarQubePrepare_15b84ca1-b62f-4a2a-a403-89b77a063157\4.19.0\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe’ failed with exit code 1

Finishing: Run Code Analysis

We are facing this in the Run Analysis Task of the Azure DevOps pipeline.

We have the same problem and all our team are blocked due to this. We use 4.19 version of AzureDevOps SonarQube extension.

We should be careful not to assume the cause is the same. What do you find in your web.log file on your SonarQube instance?