Sonar token doesnt work

Sonarqube 9.6 ce
Sonarscanner - latest
gitlab ce

hello, my sonar tokens dont want to work, i have admin account and although im creating any type of token to run project, it still dont want to work. im putting sonar token to vars and later use it in sonar.properties in gitlab pipeline via sonar.login=$SONAR_TOKEN and during execution i have error like this


and couple more similiar to this one, any suggestions will be helpful

Hey there.

How is your .gitlab-ci.yml file configured?

hey colin, thanks for replying
it looks like this



thats the error i get when i put token into variable in gitlab ci cd settings

and if i have token in sonar.properties like sonar.login=TOKEN its ok

btw what are ci_project_dir and ci_job_name, because they are not defined in gitlab, and i dont know if i have to edit them somewhere or where they are defined

These are predefined variables

Make sure that if you are defining SONAR_TOKEN in your repository variables, you are not also trying to define it in a sonar-project.properties file – the variable should be automatically picked up by the scanner.

sonar token is only in one place, but error still occurs
i am admin at sonarqube, but it doesnt work
if my collegue sends me his token it works, i completely have no idea why its happening, he has less permissions than me

if some person cretes project and generate his token it doesnt work for him also

Has this item been resolved?
I have generated numerous tokens for sonar.token but no tokens ever work. I have checked permissions and tried multiple users.
However if I try sonar.login and sonar.password - it works fine

Hey @damien.gallagher.exl

Without any further details (SonarQube version used, configs you’ve tried) I don’t think we can be that helpful.

Keep in mind that sonar.token only works for SonarQube v10.0+. The user in this thread is referring to an environment variable used by GitLab CI.

I’m going to close this thread. Please open a new one with more details if you need.