analysis token causes an error: You're only authorized to execute a local (preview) SonarQube analysis

We follow the 2 simple steps of ‘Configure analysis’, first create a token, secondly copy & paste the provided script. The script looks fine but it fails.

Using the -X option reveals that an API call fail with an error

curl -u (the token here): name here)

{“errors”:[{“msg”:“You’re only authorized to execute a local (preview) SonarQube analysis without pushing the results to the SonarQube server. Please contact your SonarQube administrator.”}]}

We are using paid plan and the user for whom the token was generated is an admin member of the organisation on

I don’t see any configuration options at to authorise the user to push the result. Is the error even valid for SonarCloud?

1 Like


The error message can definitely be improved.
It looks like that user (for which you created the token) doesn’t have permissions to analyze projects.
Could you please go to the organization, then to the menu Administration -> Permissions and check if the Execute Analysis box is checked for that user?

1 Like


That was the issue. Thank you for your support!

If I may suggest I would also improve the UI workflow. What’s the point of letting the user to generate the token and configure the scan if he does not have permission to do the scan? A meaningful message upon navigating through ‘Configure analysis’ step would be useful.

I’m glad it’s working now!
Noted about improving the workflow - we will look into it.