Tokens created by non-owners aren't accepted

I’m involved in a project to migrate a large number of repositories to GitHub and we’re setting up Sonarcloud as part of this project. We’ve granted the “Create” permission to the team members performing the migrations. They’re able to create projects and get the token for the project, but none of those tokens are accepted. Every time, the GitHub Action job fails with this error:

ERROR: Project not found. Please check the ‘sonar.projectKey’ and ‘sonar.organization’ properties, the ‘SONAR_TOKEN’ environment variable, or contact the project administrator

We’ve confirmed that the sonar.projectKey and sonar.organization values are correct. The team members have regenerated the tokens numerous times, to no avail. Thus far, the only solution has been for an organization owner to create the token.

If a team member has the “Create” permission, and can generate a token, shouldn’t that token be usable with the Sonar GitHub Action?

Hey there.

The permission to Create Projects and Execute Analysis are distinct.

And, to set default permissions on newly created projects (including the ability to give the creator of the project Execute Analysis permissions, if that’s what you desire), check out the documentation on permission templates

… and this is a valid point. The user experience is confusing if you’re allowed to generate a token and follow the tutorial but it fails due to permissions. I’ll flag this for attention.

1 Like