Authentication Failed with SonarScanner for .NET

I have this setup. I first tried SonarLint, but then opted to go with a more direct approach first:

SonarScanner for MSBuild 9.0.1
SonarQube on Windows via Docker

I’m trying to follow this guide to using SonarScanner for .NET: https://docs.sonarsource.com/sonarqube/latest/analyzing-source-code/scanners/dotnet/using/

I’ve got as far as running this command, as per the guide: dotnet sonarscanner begin /k:"version4" /d:sonar.host.url="http://localhost:9000" /d:sonar.token="xxxxx"

I get this output:

Using the .NET Core version of the Scanner for MSBuild
Pre-processing started.
Preparing working directories...
07:33:35.763  Updating build integration targets...
07:33:35.938  WARNING: Authentication with the server has failed.

I’m using the token I created on my local SonarQube container, so I don’t get why auth fails, but what server is the above output referring to?

Then my real question is, why would auth fail here?

Hi there, @bradyk, welcome to the community!

Could you please run the analysis with /d:sonar.verbose=true and post here the full log?

Denis

Thanks, Dennis, but I did everything over and the scanner is working now.

OK, glad to know it works!

If I may ask, do you know what was wrong the first time? (Just so we know if we are missing some information in the docs for example)

Denis

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.