Analysis fails with permissions error


I’m also facing the same issue:
file for sonar properties:

also have mentioned the sonar.organization in the file as shown below:


the command used for execution:
dotnet tool install --global dotnet-sonarscanner --version 5.2.0

dotnet sonarscanner begin /k:xxxx / /d:sonar.login=${SONAR_USER} /d:sonar.password=${SONAR_PW} /d:project.settings=C:\xxxx\

dotnet sonarscanner end /d:sonar.login=${SONAR_USER} /d:sonar.password=${SONAR_PW}

ERROR: Error during SonarScanner execution

5064ERROR: You’re not authorized to run analysis. Please contact the project administrator.

thanks in advance.


Welcome to the community.

I’ve split your post to a new thread since the one you resurrected was pretty old. It’s best practice to start a new thread, rather than resurrecting an old one.

The error message is pretty clear: you don’t have permissions to perform the analysis. I know you’re passing credentials in both the begin and end commands (:clap: ). Note that you’re using login/password. FYI, using an analysis token instead is preferred as more secure. I see a few scenarios:

  • the credential values are mangled (E.G. the last couple of characters got dropped) and no longer valid
  • the variables are empty or populated with the wrong values
  • the account the credentials belong to doesn’t actually have rights on the project


Hi @ganncamp,

Thanks for the quick response!
as you said I have updated the token in the command as show below:

dotnet sonarscanner begin /k:xxxx / /d:sonar.login="xxxxxx" /d:project.settings=C:\xxxxx\

dotnet sonarscanner end /d:sonar.login="xxxxxx"

but still, I got the same issue and also user has all the required permission for analysis

Thanks in advance.


I’m truly not sure what to tell you here. The error is about permissions & that seems pretty clear. Can you try it with a different user?


Hi @ganncamp,

I have created a new user with the required permission and created a token for that user, but still facing the same issue.


A post was split to a new topic: Getting auth error. Verify .NET analysis command?


Again, I’m not sure what to tell you. Is there any possibility that the token value has gotten mangled? Can you verify that your variables are populated the way you think they are? Can you temporarily allow Anyone analysis rights & try again?


hi @ganncamp,
Thanks for the support it is working now. updated new token.


1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.