Failed to load the quality profiles of project

sonarcloud

(Christopher Hill) #1

We are running Teamcity with the SonarQube scanner plugin, connected to SonarCloud.io.

When we try and run a code analysis step, we get the following error message:

[Step 5/16] Code Analysis (SonarQube Runner) (3s)
[Step 5/16] Starting SQS from C:\TeamCity\buildAgent\tools\sonar-qube-scanner.3.0.3.778-scanner
[Step 5/16] -classpath
[Step 5/16] C:\TeamCity\buildAgent\tools\sonar-qube-scanner.3.0.3.778-scanner\lib\sonar-scanner-cli-3.0.3.778.jar
[Step 5/16] org.sonarsource.scanner.cli.Main
[Step 5/16] -Dscanner.home=C:\TeamCity\buildAgent\tools\sonar-qube-scanner.3.0.3.778-scanner
[Step 5/16] Starting: "C:\Program Files\Java\jre1.8.0_161\bin\java.exe" -classpath C:\TeamCity\buildAgent\tools\sonar-qube-scanner.3.0.3.778-scanner\lib\sonar-scanner-cli-3.0.3.778.jar org.sonarsource.scanner.cli.Main "-Dproject.home=." "-Dsonar.host.url=https://sonarcloud.io" "-Dsonar.projectKey=Test.Project" "-Dsonar.projectName=Test.Project" "-Dsonar.projectVersion=872" "-Dsonar.sources=." "-Dsonar.login=" -Dscanner.home=C:\TeamCity\buildAgent\tools\sonar-qube-scanner.3.0.3.778-scanner
[Step 5/16] in directory: C:\TeamCity\buildAgent\work\d98e91dd065e6c9e
[Step 5/16] INFO: Scanner configuration file: C:\TeamCity\buildAgent\tools\sonar-qube-scanner.3.0.3.778-scanner\conf\sonar-scanner.properties
[Step 5/16] INFO: Project root configuration file: NONE
[Step 5/16] INFO: SonarQube Scanner 3.0.3.778
[Step 5/16] INFO: Java 1.8.0_161 Oracle Corporation (64-bit)
[Step 5/16] INFO: Windows Server 2012 R2 6.3 amd64
[Step 5/16] INFO: User cache: C:\Users\teamcity\.sonar\cache
[Step 5/16] INFO: Publish mode
[Step 5/16] INFO: Load global settings
[Step 5/16] INFO: Load global settings (done) | time=284ms
[Step 5/16] INFO: Server id: XXXXXXXX-XXXXXXXX_XXXXXXXX
[Step 5/16] INFO: User cache: C:\Users\teamcity\.sonar\cache
[Step 5/16] INFO: Load/download plugins
[Step 5/16] INFO: Load plugins index
[Step 5/16] INFO: Load plugins index (done) | time=64ms
[Step 5/16] INFO: Load/download plugins (done) | time=183ms
[Step 5/16] INFO: Loaded core extensions: branch-scanner
[Step 5/16] INFO: SonarQube server 7.4.0
[Step 5/16] INFO: Default locale: "en_GB", source code encoding: "windows-1252" (analysis is platform dependent)
[Step 5/16] INFO: Process project properties
[Step 5/16] INFO: Load project branches
[Step 5/16] INFO: Load project branches (done) | time=28ms
[Step 5/16] INFO: Load project pull requests
[Step 5/16] INFO: Load project pull requests (done) | time=31ms
[Step 5/16] INFO: Load branch configuration
[Step 5/16] INFO: Load branch configuration (done) | time=3ms
[Step 5/16] INFO: Load project repositories
[Step 5/16] INFO: Load project repositories (done) | time=92ms
[Step 5/16] INFO: Execute project builders
[Step 5/16] INFO: Execute project builders (done) | time=0ms
[Step 5/16] INFO: Load quality profiles
[Step 5/16] INFO: ------------------------------------------------------------------------
[Step 5/16] INFO: EXECUTION FAILURE
[Step 5/16] INFO: ------------------------------------------------------------------------
[Step 5/16] INFO: Total time: 2.928s
[Step 5/16] INFO: Final Memory: 57M/245M
[Step 5/16] INFO: ------------------------------------------------------------------------
[Step 5/16] ERROR: Error during SonarQube Scanner execution
[Step 5/16] ERROR: Failed to load the quality profiles of project 'Test.Project': Component key 'Test.Project' not found
[Step 5/16] ERROR:
[Step 5/16] ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
[Step 5/16] Process exited with code 1
[Step 5/16] Process exited with code 1 (Step: Code Analysis (SonarQube Runner))
[Step 5/16] Step Code Analysis (SonarQube Runner) failed
[Step 5/16] Error message is logged

On SonarCloud.io, there is a project called “Test.Project” with the component key “Test.Project”
SonarQube authenticates with SonarCloud without any problems, but it fails to load quality profiles.

The quality profiles have been left to default on the project.

Thanks,
Chris.


(Fabrice Bellingard) #2

Hi Chris,

I’ve looked at your organization, and it turns out that you have no project with the “Test.Project” key. This is why the analysis is failing. I also see that you managed to successfully run an analysis on one project, so I guess it’s just a matter of specifying the good “project key” when you configure your analysis. As I can see:

Project root configuration file: NONE

in the logs, I assume that you specify the project key in TeamCity. And this is where I cannot help you further, because this integration is not ours.


(Christopher Hill) #3

Hi fabrice, thanks for the response.

I’ve changed the project name in my logs because I’ve tried to remove any identifiable information (as it’s a public forum).

The project that I’m trying to run analysis on does share the same project name and key on teamcity.

I’ll take a closer look at the project root configuration file: None error message.

Best regards,
Chris.