"You’re not authorized to run analysis." error on GitHub Actions

Hello everyone,

We have a rather perplexing issue that came up all of a sudden. We have had Github Actions working great for our repos for quite some time now. All of a sudden, one repositories action is failing with the error “You’re not authorized to run analysis. Please contact the project administrator.”. I’ve double checked permissions, tokens, everything. I even assigned the Anyone permissions to “execute analysis” for this project to see if it would help with no luck. The logs show the analysis running, the rules being downloaded, and everything working fine up to the point of uploading the report which then throws the error. Even stranger, I can take the same project key and secret and run the analysis from my laptop with no issue. This repository does contain CloudFormation YAML files which I know is a new feature. It did work for a while and then stopped (I’m not sure if it coincided with our upgrade to 9.3 or not). Any help you guys could provide with this would be greatly appreciated. Thank you so much!

Hey there.

If analysis only failed at the very end, I wouldn’t be surprised if the project key that your GitHub Actions YAML is targeting (or which is inside a sonar-project.properties file) has changed and the user running analysis doesn’t have the Create Projects permission. This causes a permissions error because SonarQube will try to create a new project when it doesn’t find a matching key on the server.

Can you check this?

Hey Colin, sorry for the delay on this. We’ve verified the project key has the appropriate permissions. This same key is being used to analyze other projects with no issue. Any more ideas?