# TOKEN ERROR WHEN ANALYSING A PROGRAM WITH SONARQUBE COMMUNITY

**URL:** <https://community.sonarsource.com/t/token-error-when-analysing-a-program-with-sonarqube-community/120513>\
**Category:** SonarQube Server / Community Build\
**Tags:** sonarqube, scanner\
**Created:** [August 11, 2024, 1:03am UTC](https://community.sonarsource.com/t/token-error-when-analysing-a-program-with-sonarqube-community/120513 "2024-08-11T01:03:10Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![C\_Aldair](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/c_aldair/32/60445_2.png) [@C\_Aldair](https://community.sonarsource.com/u/C_Aldair)\
**Post date:** [August 11, 2024, 1:03am UTC](https://community.sonarsource.com/t/token-error-when-analysing-a-program-with-sonarqube-community/120513/1 "2024-08-11T01:03:10Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Bachri\_Abdel](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/bachri_abdel/32/65565_2.png) [@Bachri\_Abdel](https://community.sonarsource.com/u/Bachri_Abdel)\
**Post date:** [August 12, 2024, 12:10am UTC](https://community.sonarsource.com/t/token-error-when-analysing-a-program-with-sonarqube-community/120513/2 "2024-08-12T00:10:28Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![C\_Aldair](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/c_aldair/32/60445_2.png) [@C\_Aldair](https://community.sonarsource.com/u/C_Aldair)\
**Post date:** [August 12, 2024, 5:00am UTC](https://community.sonarsource.com/t/token-error-when-analysing-a-program-with-sonarqube-community/120513/3 "2024-08-12T05:00:55Z")

</div>

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

 ![sonar analitys](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/a/a/aaa42184d01eb4d9d3660f5aef5cd7ed69864012.png)

---

<div class="post-metadata">

**Author:** ![Bachri\_Abdel](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/bachri_abdel/32/65565_2.png) [@Bachri\_Abdel](https://community.sonarsource.com/u/Bachri_Abdel)\
**Post date:** [August 12, 2024, 8:10am UTC](https://community.sonarsource.com/t/token-error-when-analysing-a-program-with-sonarqube-community/120513/4 "2024-08-12T08:10:47Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![C\_Aldair](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/c_aldair/32/60445_2.png) [@C\_Aldair](https://community.sonarsource.com/u/C_Aldair)\
**Post date:** [August 12, 2024, 8:53am UTC](https://community.sonarsource.com/t/token-error-when-analysing-a-program-with-sonarqube-community/120513/5 "2024-08-12T08:53:47Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Bachri\_Abdel](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/bachri_abdel/32/65565_2.png) [@Bachri\_Abdel](https://community.sonarsource.com/u/Bachri_Abdel)\
**Post date:** [August 12, 2024, 9:02am UTC](https://community.sonarsource.com/t/token-error-when-analysing-a-program-with-sonarqube-community/120513/6 "2024-08-12T09:02:21Z")

</div>

@C_Aldair here is the documentation to configure SonarQube.Analitys.xml [SonarScanner for .NET](https://docs.sonarsource.com/sonarqube/latest/analyzing-source-code/scanners/sonarscanner-for-dotnet/)

---

<div class="post-metadata">

**Author:** ![C\_Aldair](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/c_aldair/32/60445_2.png) [@C\_Aldair](https://community.sonarsource.com/u/C_Aldair)\
**Post date:** [August 12, 2024, 12:44pm UTC](https://community.sonarsource.com/t/token-error-when-analysing-a-program-with-sonarqube-community/120513/7 "2024-08-12T12:44:04Z")

</div>

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 analitys](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/a/a/aaa42184d01eb4d9d3660f5aef5cd7ed69864012.png)  
sonar scanner  
 ![sonarscanner](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/0/9/099288233b569eee6c7347e2127b176ba05b5d2d.png)

---

<div class="post-metadata">

**Author:** ![Bachri\_Abdel](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/bachri_abdel/32/65565_2.png) [@Bachri\_Abdel](https://community.sonarsource.com/u/Bachri_Abdel)\
**Post date:** [August 12, 2024, 1:13pm UTC](https://community.sonarsource.com/t/token-error-when-analysing-a-program-with-sonarqube-community/120513/8 "2024-08-12T13:13:56Z")

</div>

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

> [@Error : The token you provided doesn't have sufficient rights to check license](https://community.sonarsource.com/t/error-the-token-you-provided-doesnt-have-sufficient-rights-to-check-license/57860/12):
>
> Hi, The problem was that I was using same name for Project and Token name. So maybe that was creating the problem. So I changed the name of the Project and also gave different name to token also. then it worked

---

<div class="post-metadata">

**Author:** ![C\_Aldair](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/c_aldair/32/60445_2.png) [@C\_Aldair](https://community.sonarsource.com/u/C_Aldair)\
**Post date:** [August 12, 2024, 1:24pm UTC](https://community.sonarsource.com/t/token-error-when-analysing-a-program-with-sonarqube-community/120513/9 "2024-08-12T13:24:30Z")

</div>

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

 ![nombre token](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/2/4/2419ba42a1e7f812e460820e962d5256e51c8fe3.png)

---

<div class="post-metadata">

**Author:** ![Bachri\_Abdel](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/bachri_abdel/32/65565_2.png) [@Bachri\_Abdel](https://community.sonarsource.com/u/Bachri_Abdel)\
**Post date:** [August 12, 2024, 7:48pm UTC](https://community.sonarsource.com/t/token-error-when-analysing-a-program-with-sonarqube-community/120513/10 "2024-08-12T19:48:10Z")

</div>

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](http://localhost:9000/project_roles?id=*project_key)\*.

---

<div class="post-metadata">

**Author:** ![C\_Aldair](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/c_aldair/32/60445_2.png) [@C\_Aldair](https://community.sonarsource.com/u/C_Aldair)\
**Post date:** [August 12, 2024, 9:01pm UTC](https://community.sonarsource.com/t/token-error-when-analysing-a-program-with-sonarqube-community/120513/11 "2024-08-12T21:01:16Z")

</div>

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

 ![image](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/b/2/b25deb01b724560e25b082dd5e47842543383d23.png)

---

<div class="post-metadata">

**Author:** ![Bachri\_Abdel](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/bachri_abdel/32/65565_2.png) [@Bachri\_Abdel](https://community.sonarsource.com/u/Bachri_Abdel)\
**Post date:** [August 12, 2024, 9:24pm UTC](https://community.sonarsource.com/t/token-error-when-analysing-a-program-with-sonarqube-community/120513/12 "2024-08-12T21:24:28Z")

</div>

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.
