As I mentionned earlier, the “SonarQube 8.9.1” on the logs is just a mistake in the log message. Your build is using the SonarScanner for Maven, poiting to SonarCloud since you configured the URL.
I can’t explain why your build can’t resolve the SonarCloud token from the AWS Parameter store, but I suspect it is not an issue related to SonarCloud or SonarScanner.
I notice one of your previous answers has been marked as Solution, is it a mistake?
For the last error, could you give me the logs in debug mode (-X) with the full stacktrace?
Thanks for the detailed logs.
I reproduce that same error 100% of the times when I try to scan the repo locally with an empty token, like -Dsonar.login= instead of -Dsonar.login=somecooltoken.
When the token is invalid or the user don’t have the permission, the error is different.
We may have some room to improvement here, to given an appropriate message instead of that exception. I’ll report taht internally for improvement, but of course it won’t solve your issue.
You probably still have some issue on your build configuration.
The recommended way to configure the access token, is now to use an environment variable named SONAR_TOKEN, instead of the sonar.login property than can print tokens clearly in the logs. It is automatically picked by the scanner, the -Dsonar.login=xxx part of the command should be completely removed. Could you try that?
Wow, putting the token value as environmental variable actually worked!
But what if I still want to use AWS’s services, such as Parameter Store or Secrets Manager and store the token values there?
Thank you!
About the storage of the token, for sure it should go on some secure storage. I guess the environment variable can be filled with some value from Parameter Store or Secret Manager, but it’s far beyond my knowledge of AWS services.
We don’t have any specific documentation for that, I found that AWS documentation about Environment variables on CodeBuild, it suggests some other documentations at the bottom of the page about secure ways to store secrets.
Will definitely figure this out, thank you so much for your time, this error was consuming half of my soul, now I feel relieved thanks to you!
Once again, thank you very much!