Analysis fails with permissions error

Hi,

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

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

sonar.projectKey=xxxx
sonar.projectName=xxxx
sonar.projectVersion=xxxx
sonar.organization=xxxx

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

dotnet sonarscanner begin /k:xxxx /d:sonar.host.url=https://sonarqube.xxxx.com /d:sonar.login=${SONAR_USER} /d:sonar.password=${SONAR_PW} /d:project.settings=C:\xxxx\sonar-project.properties

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.

Hi,

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

 
HTH,
Ann

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.host.url=https://sonarqube.xxxx.com /d:sonar.login="xxxxxx" /d:project.settings=C:\xxxxx\sonar-project.properties

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.

Hi,

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?

 
Ann

Hi @ganncamp,

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

Thanks!

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

Hi,

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?

 
Ann

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

thanks,
ashutosh

1 Like

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