Not authorized to perform analysis as admin

Command I’m using to try to analyze the project (within project dir):
gradle sonar
-Dsonar.projectKey=(key generated for me) address of host and port 9000)
-Dsonar.login=(key generated for me)“C:\Program Files\Java\jdk-11”
–warning-mode all

./gradlew sonar
-Dsonar.projectKey=(key generated for me) and Port)
-Dsonar.login=(key generated for me)

I received the ./gradlew sonar command from the dashboard after logging in as admin, but I’m getting the following error when I try to run the commands (after altering it to be executable on my machine):
“You’re not authorized to run analysis. Please contact the project administrator.”

As far as I know, I AM the project admin for right now. I’ve seen other posts recommend to add an organization key property as well, but:
A- I have no idea what that means, and thus no idea what to input to get this to work.
B- Shouldn’t that have been generated with the command, like the login, project key, etc?

For further info that might help, I specified for SonarQube to use Java 11 within the command, when I’m executing that command, I’m within a directory holding the project files, I’m hosting SonarQube as a docker container on an AWS EC2 instance with an x86 OS and no other purpose (SonarQube, Gradle, and Docker are the only things installed aside from OS defaults). Lastly, yes I did in fact add the SonarQube plugin to my build.gradle file. I have been trying to configure this thing for literal days now, and now I’m suddenly “Not authorized”? I cannot figure this out, I need some help. I just want to run an analysis on the stupid files so I can be done with my task.


Welcome to the community!

No need for that. That’s only used by SonarCloud.

Does the first version of the command work? Are you certain the analysis token is correct? BTW, you can generate a new token to make sure: [your avatar at the top, right] → My Account → Security.


You need to start Gradle with Java 11. By the time analysis properties are read, it’s too late; the JVM - of whatever version - is already up & running.

Long-term, you’ll ideally move analysis to a different host than the one SonarQube runs on.