# Error running scanner in client

**URL:** <https://community.sonarsource.com/t/error-running-scanner-in-client/37323>\
**Category:** SonarQube Server / Community Build\
**Tags:** msbuild, scanner\
**Created:** [January 20, 2021, 8:18am UTC](https://community.sonarsource.com/t/error-running-scanner-in-client/37323 "2021-01-20T08:18:13Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![yapeutat](https://avatars.discourse-cdn.com/v4/letter/y/c6cbf5/32.png) [@yapeutat](https://community.sonarsource.com/u/yapeutat)\
**Post date:** [January 20, 2021, 8:18am UTC](https://community.sonarsource.com/t/error-running-scanner-in-client/37323/1 "2021-01-20T08:18:13Z")

</div>

Hi,

When I am running scanner using the global tool and below is the cmd  
dotnet sonarscanner begin /k:“testprojectkey2token” /d:sonar.login=“admin” /d:sonar.password=“admin1”

Above cmd is running successfully. And the admin credential is used to login to sonarqube server.

And when I created a token in sonarqube server using admin credential, so I replace the cmd with  
dotnet sonarscanner begin /k:“testprojectkey2token” /d:sonar.login=“token-generated”

And error display as: The token you provided doesn’t have sufficient rights to check license.

---

<div class="post-metadata">

**Author:** ![mickaelcaro](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/mickaelcaro/32/4147_2.png) [@mickaelcaro](https://community.sonarsource.com/u/mickaelcaro)\
**Post date:** [January 20, 2021, 9:48am UTC](https://community.sonarsource.com/t/error-running-scanner-in-client/37323/4 "2021-01-20T09:48:20Z")

</div>

Hi @yapeutat

First which version and edtion of SonarQube are you using ?

Thanks.

Mickaël

---

<div class="post-metadata">

**Author:** ![yapeutat](https://avatars.discourse-cdn.com/v4/letter/y/c6cbf5/32.png) [@yapeutat](https://community.sonarsource.com/u/yapeutat)\
**Post date:** [January 21, 2021, 1:15am UTC](https://community.sonarsource.com/t/error-running-scanner-in-client/37323/5 "2021-01-21T01:15:56Z")

</div>

Hi Mickaël, I am using Community Edition \* Version 8.6 (build 39681)

---

<div class="post-metadata">

**Author:** ![mickaelcaro](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/mickaelcaro/32/4147_2.png) [@mickaelcaro](https://community.sonarsource.com/u/mickaelcaro)\
**Post date:** [January 21, 2021, 8:23am UTC](https://community.sonarsource.com/t/error-running-scanner-in-client/37323/6 "2021-01-21T08:23:13Z")

</div>

Thanks ! I wasn’t able to reproduce on my side. Do you have any specific setting on your instance that can forbid any token-based authentication maybe ?

---

<div class="post-metadata">

**Author:** ![mickaelcaro](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/mickaelcaro/32/4147_2.png) [@mickaelcaro](https://community.sonarsource.com/u/mickaelcaro)\
**Post date:** [January 21, 2021, 8:46am UTC](https://community.sonarsource.com/t/error-running-scanner-in-client/37323/8 "2021-01-21T08:46:43Z")

</div>

I’m not quite sure that this is related, but if it works now on you side, then it’s good !

---

<div class="post-metadata">

**Author:** ![yapeutat](https://avatars.discourse-cdn.com/v4/letter/y/c6cbf5/32.png) [@yapeutat](https://community.sonarsource.com/u/yapeutat)\
**Post date:** [January 21, 2021, 8:50am UTC](https://community.sonarsource.com/t/error-running-scanner-in-client/37323/9 "2021-01-21T08:50:24Z")

</div>

Oops sorry. I mixed up with other post I created earlier.

Do you have any specific setting on your instance that can forbid any token-based authentication maybe ?  
Not that I know.

Actually this happened to me earlier too.  
Scanner can run when I use username together with password.  
But is not working when I use the token generated.

---

<div class="post-metadata">

**Author:** ![mickaelcaro](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/mickaelcaro/32/4147_2.png) [@mickaelcaro](https://community.sonarsource.com/u/mickaelcaro)\
**Post date:** [January 21, 2021, 9:01am UTC](https://community.sonarsource.com/t/error-running-scanner-in-client/37323/10 "2021-01-21T09:01:14Z")

</div>

Can you double check if the token is correctly past or if it hasn’t been revoked ?

---

<div class="post-metadata">

**Author:** ![yapeutat](https://avatars.discourse-cdn.com/v4/letter/y/c6cbf5/32.png) [@yapeutat](https://community.sonarsource.com/u/yapeutat)\
**Post date:** [January 21, 2021, 9:04am UTC](https://community.sonarsource.com/t/error-running-scanner-in-client/37323/11 "2021-01-21T09:04:10Z")

</div>

Yes it’s correctly passed and is not revoked.

---

<div class="post-metadata">

**Author:** ![mickaelcaro](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/mickaelcaro/32/4147_2.png) [@mickaelcaro](https://community.sonarsource.com/u/mickaelcaro)\
**Post date:** [January 27, 2021, 6:20am UTC](https://community.sonarsource.com/t/error-running-scanner-in-client/37323/12 "2021-01-27T06:20:46Z")

</div>

Hi @yapeutat

Sorry for getting back late to you.

Can you test this token by calling an SQ API directly ? To see which kind of result you get.

Thanks in advance

---

<div class="post-metadata">

**Author:** ![yapeutat](https://avatars.discourse-cdn.com/v4/letter/y/c6cbf5/32.png) [@yapeutat](https://community.sonarsource.com/u/yapeutat)\
**Post date:** [January 27, 2021, 6:33am UTC](https://community.sonarsource.com/t/error-running-scanner-in-client/37323/13 "2021-01-27T06:33:59Z")

</div>

Hi Mickaël,

Just found out the issue.

In scanner SonarQube.Analysis.xml,  
[http://sonarqubserver:9000](http://sonarqubserver:9000/)  
admin  
password

If the SonarQube.Analysis.xml is set with the credential as above, then the scanner will only work when username + password provided.

If the SonarQube.Analysis.xml is set using token in the login attribute instead of username + password, then the scanner will work when token is provided.

Thanks for your help anyway!

---

<div class="post-metadata">

**Author:** ![mickaelcaro](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/mickaelcaro/32/4147_2.png) [@mickaelcaro](https://community.sonarsource.com/u/mickaelcaro)\
**Post date:** [January 27, 2021, 6:37am UTC](https://community.sonarsource.com/t/error-running-scanner-in-client/37323/14 "2021-01-27T06:37:39Z")

</div>

Indeed, thanks and sorry !

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/system/32/31083_2.png) [@system](https://community.sonarsource.com/u/system)\
**Post date:** [February 3, 2021, 6:37am UTC](https://community.sonarsource.com/t/error-running-scanner-in-client/37323/15 "2021-02-03T06:37:47Z")

</div>

Closed on February 3, 2021, 6:37am UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
