Problem setting up JS project in CircleCI

Description:
After setting up the project at SonarCloud and CircleCI end, the job fails with “Not authorized. Please check the properties sonar.login and sonar.password” error.

  • sonar-project.properties is in place and data looks correct.
  • SONAR_TOKEN is created with the right value at SonarCloud context.

Other details:

Error log:

INFO: Scanner configuration file: /tmp/cache/scanner/sonar-scanner-4.1.0.1829-linux/conf/sonar-scanner.properties
INFO: Project root configuration file: /home/circleci/project/sonar-project.properties
INFO: SonarQube Scanner 4.1.0.1829
INFO: Java 11.0.3 AdoptOpenJDK (64-bit)
INFO: Linux 4.15.0-1052-aws amd64
INFO: User cache: /tmp/cache/scanner/.sonar/cache
INFO: SonarQube server 8.0.0
INFO: Default locale: "en", source code encoding: "UTF-8" (analysis is platform dependent)
INFO: Load global settings
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 3.270s
INFO: Final Memory: 5M/56M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution
ERROR: Not authorized. Please check the properties sonar.login and sonar.password.
ERROR: 
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.

Exited with code exit status 2

Hi @jjtechuy,

Thanks for your post, and welcome to the community!

Can you check the token you’re using as “sonar.login” is associated to a user that has the "Execute analysis” permission within your project?

Also did you try the “-X switch” as advised on the error?

Thanks Alex!
At CircleCI the context SonarCloud and the SONAR_TOKEN variable is created with the same value configured at SonarCloud.
What I’m not sure from your question is if I have the execute analysis permission in the project. I was assumming that I have enough rights as I’m able to add the project but if executing analysis requires a different kind of permission then I’m not so sure.
How can I determine that?

Also, I’m using orb “sonarsource/sonarcloud@1.0.1” at CircleCI so I understand that the sonar.login variable is correctly taken from the context variable.

Will try to run with -X and update the post. However I’m not sure if that is possible as I’m just adding - sonarcloud/scan as a step in the config.yml will investigate further.

Thanks again!