Sonar msbuild bugs ( Credentials must be passed in both begin and end steps or not at all )

hello i ve this bug when finish of analize a code

this is my config

set JAVA_HOME=C:\Program Files (x86)\Java\jdk1.8.0_112
 SonarScanner.MSBuild.exe begin /k:"somm" /d:sonar.verbose=true /d:sonar.host.url="http://172.18.0.176:9000" /d:sonar.login="581731f147804ca77a0d59dd5daa034780225e5a" 



 "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MsBuild.exe"    "C:\Users\nturri\source\repos\somministrazione-web\Easymatica.Somministrazione.Web.sln" /t:Rebuild /p:Configuration=Debug /p:Platform="Any CPU" 


SonarScanner.MSBuild.exe  end 

ultimate logs

C:\sonar48>SonarScanner.MSBuild.exe  end
SonarScanner for MSBuild 4.10
Using the .NET Framework version of the Scanner for MSBuild
Post-processing started.
17:32:01.209  17:32:01.204  Uninstalling target: C:\Users\nturri\AppData\Local\Microsoft\MSBuild\4.0\Microsoft.Common.targets\ImportBefore\SonarQube.Integration.ImportBefore.targets
17:32:01.21  17:32:01.204  Uninstalling target: C:\Users\nturri\AppData\Local\Microsoft\MSBuild\10.0\Microsoft.Common.targets\ImportBefore\SonarQube.Integration.ImportBefore.targets
17:32:01.21  17:32:01.205  Uninstalling target: C:\Users\nturri\AppData\Local\Microsoft\MSBuild\11.0\Microsoft.Common.targets\ImportBefore\SonarQube.Integration.ImportBefore.targets
17:32:01.21  17:32:01.205  Uninstalling target: C:\Users\nturri\AppData\Local\Microsoft\MSBuild\12.0\Microsoft.Common.targets\ImportBefore\SonarQube.Integration.ImportBefore.targets
17:32:01.211  17:32:01.205  Uninstalling target: C:\Users\nturri\AppData\Local\Microsoft\MSBuild\14.0\Microsoft.Common.targets\ImportBefore\SonarQube.Integration.ImportBefore.targets
17:32:01.211  17:32:01.205  Uninstalling target: C:\Users\nturri\AppData\Local\Microsoft\MSBuild\15.0\Microsoft.Common.targets\ImportBefore\SonarQube.Integration.ImportBefore.targets
17:32:01.211  17:32:01.205  Uninstalling target: C:\Users\nturri\AppData\Local\Microsoft\MSBuild\Current\Microsoft.Common.targets\ImportBefore\SonarQube.Integration.ImportBefore.targets
17:32:01.211  17:32:01.209  sonar.verbose=true was specified - setting the log verbosity to 'Debug'
17:32:01.212  Loading the SonarQube analysis config from C:\sonar48\.sonarqube\conf\SonarQubeAnalysisConfig.xml
17:32:01.213  Not running under TeamBuild
17:32:01.213  Analysis base directory: C:\sonar48\.sonarqube
Build directory:
Bin directory: C:\sonar48\.sonarqube\bin
Config directory: C:\sonar48\.sonarqube\conf
Output directory: C:\sonar48\.sonarqube\out
Config file: C:\sonar48\.sonarqube\conf\SonarQubeAnalysisConfig.xml
17:32:01.214  Credentials must be passed in both begin and end steps or not at all
17:32:01.214  Post-processing failed. Exit code: 1

Hi @nturri1306! Welcome back to the SonarSource Community.

Thank you for showing your properties and command steps and the logs, this is all very helpful.

As the error has stated, you need to pass the sonar.login parameter in the Begin and Steps.

So do the same thing you did for the Begin step and add this parameter to your end step: /d:sonar.login="581731f147804ca77a0d59dd5daa034780225e5a"

So it looks like this:

SonarScanner.MSBuild.exe end /d:sonar.login="581731f147804ca77a0d59dd5daa034780225e5a"

You have to submit the sonar.login two times: one for Begin step and one for End step.

If this still fails, please show the debug logs again.

Joe