Starting: Prepare analysis on SonarQube
==============================================================================
Task : Prepare Analysis Configuration
Description : Prepare SonarQube analysis configuration
Version : 5.17.2
Author : sonarsource
Help : Version: 5.17.2. [More Information](http://redirect.sonarsource.com/doc/install-configure-scanner-tfs-ts.html)
==============================================================================
C:\BuildAgents\***\agent_v2\_work\_tasks\SonarQubePrepare_15b84ca1-b62f-4a2a-a403-89b77a063157\5.17.2\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe begin /k:Sonarqube_Core
SonarScanner for MSBuild 5.14
Using the .NET Framework version of the Scanner for MSBuild
Pre-processing started.
Preparing working directories...
08:36:30.204 Updating build integration targets...
##[error]08:36:30.465 Unauthorized: Access is denied due to invalid credentials. Please check the authentication parameters.
08:36:30.468 Pre-processing failed. Exit code: 1
08:36:30.465 Unauthorized: Access is denied due to invalid credentials. Please check the authentication parameters.
08:36:30.468 Pre-processing failed. Exit code: 1
##[error]The process 'C:\BuildAgents\***\agent_v2\_work\_tasks\SonarQubePrepare_15b84ca1-b62f-4a2a-a403-89b77a063157\5.17.2\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe' failed with exit code 1
Finishing: Prepare analysis on SonarQube
Hi,
Welcome to the community!
I supose youâre asking for help with that error message?
What does it mean to you?
Ann
Iâm have this same issue with Azure DevOps Server. If I create a service connection and enter my SonarQube URL and Token I get â##[error]16:36:11.856 Unauthorized: Access is denied due to invalid credentials. Please check the authentication parameters.â
Iâve used ten different Tokens from âadminâ to two different administrative users. Combinations of User, Project Analysis and Global Analysis. All failâŚ
Non-working YAML:
- task: SonarQubePrepare@5
displayName: SonarQube Begin
inputs:
SonarQube: âSonarQubeServerâ
scannerMode: âMSBuildâ
projectKey: âSMTestâ
projectVersion: â1.0â
Working YAML:
- task: PowerShell@2
displayName: SonarQube Begin (pwsh)
inputs:
targetType: âinlineâ
script: |
. âC:\Program Files\dotnet\dotnet.exeâ E:\DevOpsTools\sonar-scanner-core\SonarScanner.MSBuild.dll begin -k:âSMTestâ -v:â1.0â -d:sonar.token $(SonarQubeToken)
I should also add we are using an enterprise Root CA.
Hi,
I think this is about how youâre passing your token. In the docs the examples all show something like /d:sonar.login="<token>"
. Note
- the quotes
- the equals sign
- the lack of spaces (probably less important�)
HTH,
Ann
Youâre right I left out the quotes, but that was the code that works!
I tried deleting the service connection and creating a new one with the same settings. Then, it started working. So, I think somehow the old service connection became corrupted.
Maybe @Aniruddh_Gujar could try that?