TOKEN ERROR WHEN ANALYSING A PROGRAM WITH SONARQUBE COMMUNITY

Can you help me with a problem I have when analyzing it with Sonarque.

1- A project was created in Sonarqube (it is a test project), which creates a token

2- Sonarscanner was downloaded and installed in the environment variables in Windows

3- The analysis chain is generated but it gives a token error which has been generated from Sonarqube, this is the problem I am facing

Sonarqube was completely updated and reviewing the documentation I cannot find the solution to the problem.

that can help me.

I thank you in advance.

Greetings.

Hi @C_Aldair,
What type of token have you generated (user, global or project analysis ) ? How did you configure the token in the sonar-scanner.properties file or in the sonar-scanner command?

Hello dear, it generates token in the 3 cases, global, user and project. For the scanner, I configured the SonarQube.Analitys.xml file, I did not configure the properties file

Hi @C_Aldair ,
What version of the server and scanner are you using?
You can try to declare only the token parameter and remove the user and password parameters.

Hello dear, the SonarQube version is 10.6, the latest, and the scanner is the .NET Framework version 4.6, it is not the general scanner.

1 Like

@C_Aldair here is the documentation to configure SonarQube.Analitys.xml SonarScanner for .NET

Dear, I did what is indicated in the documentation, and it still throws an error. What mistake am I making? Evidence is attached.
archive SonarQube.Analysis.xml


sonar scanner

@C_Aldair,
Do the project and the token have the same name?

No, they do not have the same name, that solution was also tried and it did not work. Evidence is attached…

Hi @C_Aldair,

In the past there have been anomalies with this error message meaning there is a permission problem and not a license problem.

The account associated with the token may not have the rights to perform analyses on your project. You can check the permissions at the url http://localhost:9000/project_roles?id=*project_key*.

Hello dear, I also grant you permissions to analyze in administration. I restarted the SonarQube service and the error persists. I attach evidence

Hi @C_Aldair ,
I think that even with a bad token in command line you should have the same error.
As you set the token in commande line, you can remove sonar.login, sonar.password and sonar.token from SonarQube.Analitys.xml. This will help you to be sure that the token used is the command line.