Azure DevOps Scanner The token you provided doesn't have sufficient rights to check license

No, i have created it 2 or 3 days ago.
Attaching the screen shot for service connection.

I disconnected the connection and recreated it, still getting same error. With new generated token
Following is the yaml task

  • task: SonarQubePrepare@4
    displayName: ‘SonarQube Initializing’
    inputs:
    SonarQube: ‘SonarQube’
    scannerMode: ‘MSBuild’
    projectKey: ‘Test-AGT’

Hi @mickaelcaro, can you please help me out?

Hi @atif

You don’t have any Additional properties set in your SonarQube Prepare yaml task, right ?

right, nothing else

Apart from having created the service connection recently, did you also installed the extension recently ? Or was it here since a long time ?

I explored sonar qube like 2 weeks ago and decided to give it a try. so everything is new, nothing is old

Thanks ! I identified something on the extension, but that doesn’t seem to occur that much (setting the sonar.password i mean), i’ll have a look and see what i can do here.

perfect, thank you

Hi again @atif

I have few things / requests to ask you on that :

  • Can you try to copy/past a newly generated token to the service connection ? Please note that this is the one to generate in the Security menu of your account on SonarQube, and make sure that you copy it without spaces of “:” character.
  • Can you also try to specify a version in your SonarQubePrepare task version, by writing SonarQubePrepare@4.11.0 instead of SonarQubePrepare@4
  • Can you tell me which build version of Azure DevOps you have currently ?

Thanks.

For this I am getting: ‘Task reference must be in the format @. For example MyTask@2. The following task reference format is invalid: ‘SonarQubePrepare@4.11.0’’

its : Version Dev17.M153.3

Done, copy it with the ‘copy’ button.

Not sure if it helps or not, at service connections, if enter wrong token, it does not give me error.

This is “normal” as there are no verification upon saving.

Can you also try to get that Service Connection through the azdo rest API, and se what is filled as a password value ? You have the doc just here

this is what i am getting

{
“data”: {},
“id”: “xxxxxxxxxxxxxxx”,
“name”: “SonarQube”,
“type”: “sonarqube”,
“url”: “http://10.10.0.40:9000”,
“createdBy”: {
“displayName”: “Atif Farrukh”,
“id”: “xxxxxxxxxxxxxxxxxxxxxxxxxxxx”,
“uniqueName”: “xxxxx”
},
“authorization”: {
“scheme”: “UsernamePassword”
},
“isShared”: false,
“isReady”: true,
“owner”: “Library”
}

Don’t you have any parameters like this inside ?

“parameters”: {
“username”: null
},

nope, not in sonarqube

Did you get all endpoints at once with the API ? Is yes, you need to then get the id, and get it “solo” by just adding the id after a slash in the endpoints

/endpoints/{id]?api-version=xxx

here you go

{
“data”: {},
“id”: “xxxxxxxxxxxxxxxxxxxxx”,
“name”: “SonarQube”,
“type”: “sonarqube”,
“url”: “http://10.10.0.40:9000”,
“createdBy”: {
“displayName”: “Atif Farrukh”,
“url”: “xxxxxxxxxxxxxxxxxxxxxxxxxxx”,
“_links”: {
“avatar”: {
“href”: “xxxxxxxxxxxxxxxxxxxxx”
}
},
“id”: “xxxxxxx”,
“uniqueName”: “xxxxxxxxxxxxx”,
“imageUrl”: “xxxxxxxxxxxxxxxxx”,
“descriptor”: “win.Uy0xLTUtMjEtNDEzNTA2ODk3Ny01ODc5MjQ0MDEtMjE4ODk1NjAyMS0xNjQ0”
},
“authorization”: {
“parameters”: {
“username”: null,
“password”: null
},
“scheme”: “UsernamePassword”
},
“isShared”: false,
“isReady”: true,
“owner”: “Library”
}

@mickaelcaro any update regarding this issue?

any update regarding this issue?

@mickaelcaro any update regarding this issue?

For reference, I have encountered this after upgrade to 8.7.1 and taken the same steps as above, creating a new Service Connection. Still finding that I get this issue, but only when using a Linux based build agent (not sure if that is relevant).

Also, looking at the logs on Sonarqube I can see it is getting a 401 when trying to reach the is_valid_license API endpoint:

[08/Apr/2021:16:30:59 +0100] “GET /api/server/version HTTP/1.0” 200 - “-” “-” “AXirv6CFEDFxZdlpAAWD”
[08/Apr/2021:16:30:59 +0100] “GET /api/editions/is_valid_license HTTP/1.0” 401 - “-” “-” “AXirv6CFEDFxZdlpAAWE”