Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.0.905:sonar (default-cli) on project template: Not authorized. Analyzing this project requires authentication. Please provide a user token in sonar.login or other credentials in s

Good Day

I am hoping someone can assist me with this issue please.
I am trying to run the basic tutorial for setting up SonarQube with one of my project on

and
https://docs.sonarqube.org/latest/setup/get-started-2-minutes/

When I try to run the maven command I get the error mentioned above
The command I use is mvn clean verify sonar:sonar -Dsonar.login=<my generated key from SonarQube>

I am using the latest version of SonarQube as well as the plugin
pom.xml dependency:

<plugin>
	<groupId>org.codehaus.mojo</groupId>
	<artifactId>sonar-maven-plugin</artifactId>
	<version>3.9.0.2155</version>
</plugin>

Thanks in advance

Hi,

Welcome to the community!

That tutorial has some age on it now and default permissions have changed since it was written.

The docs should help

 
HTH,
Ann

Hi Ann

Thanks allot for the response and the assistance, I will go through the documentation that you have provided and try again.

Have a good day and a great week!

Hi Ann

Sorry for the bother, I have now updated my files as per the documents and I have managed to get passed the validation issue, but I am presented with a new one now unfortunately

Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar (default-cli) on project template: Unable to execute SonarQube: INVALID HASH: File C:\Users\Jaco.sonar\cache_tmp\fileCache15659862007500712528.tmp was expected to have hash 84d072286239bb1c3cd904006c90b84edf6e9ab5 but was downloaded with hash d41d8cd98f00b204e9800998ecf8427e → [Help 1]

From what I have seen is that the solution is to restart the SonarQube server which I have done multiple times now but I am still getting the same problem
I have also deleted the cache folders but no luck

Any advice on what could be going wrong here?
Thanks in advance

Hi,

Can you try cleaning out C:\Users\Jaco.sonar and re-running analysis?

 
Ann

Hi Ann

I have cleared out the folders for sonar but it did not work
Apologies but it does appear that I have found the issue

on the SonarQube server I had to add permissions to run the analysis for the user it seems which resolved my problem

Thanks for all the assistance in the matter

1 Like