Using sonar.token instead of sonar.login

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
  • how is SonarQube deployed: zip, Docker, Helm
  • what are you trying to achieve
  • what have you tried so far to achieve this

Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!

I am running sonarscanner cli in an ubuntu docker container with the following versions / parameters:

SonarScanner CLI 6.1.0.4477
Java 17.0.11 Ubuntu (64-bit)
Linux 6.6.14-0-virt aarch64
SONAR_SCANNER_OPTS= -Xmx4G -Xms2G
Communicating with SonarQube Server 9.6.1.59531

Via the following command:

/opt/sonarqube/bin/sonar-scanner -Dsonar.host.url=*** -Dsonar.projectKey=*** -Dsonar.projectName=*** -Dsonar.login=***

Per the sonarqube documentation here (Analysis parameters) I am trying to use -Dsonar.token instead of -Dsonar.login but running the same command as above with -Dsonar.token=*** instead of -Dsonar.login=*** results in this error telling me to use -Dsonar.login

Error during SonarScanner CLI execution
Not authorized. Analyzing this project requires authentication. Please provide a user token in sonar.login or other credentials in sonar.login and sonar.password.

I have created a new token and confirmed it works with sonar.login, why does it not work with sonar.token when that is supposed to be the new work flow?

Realized its because I’m using sonarqube server v9.6 and sonar.token wasn’t introduced until v10…

Closing this thread