Failed to request and parse <link> Input string was not in a correct format

Failed to request and parse https:///sonar/api/server/version’: Input string was not in a correct format.
Can somebody help on this

any updates on this @mickaelcaro

Maybe you can give a bit more context on this ? Otherwise it’ll be hard to help you.

Which CI tool are you using ? Which scanner ? When does this error happen ?



CI - tool i am using jenkins
SonarScanner.MSBuild.exe begin /k:"" /“https:///sonar” /d:sonar.login=“loginid” – when i run this command i get error in jenkins and also command Prompt

SonarScanner for MSBuild 4.8
Using the .NET Framework version of the Scanner for MSBuild
Pre-processing started.
Preparing working directories…
05:21:26.806 Updating build integration targets…
05:21:26.837 Fetching analysis configuration settings…
05:21:27.462 Failed to request and parse ‘/sonar/api/server/version’: Input string was not in a correct format.

Unhandled Exception: System.FormatException: Input string was not in a correct format.
at System.Version.VersionResult.SetFailure(ParseFailureKind failure, String argument)
at System.Version.TryParseComponent(String component, String componentName, VersionResult& result, Int32& parsedComponent)
at System.Version.TryParseVersion(String version, VersionResult& result)
at System.Version.Parse(String input)
at System.Version…ctor(String version)
at SonarScanner.MSBuild.PreProcessor.SonarWebService.<>c__DisplayClass15_0.b__0()
at SonarScanner.MSBuild.PreProcessor.SonarWebService.DoLogExceptions[T](Func1 op, String url, Action1 onError)
at SonarScanner.MSBuild.PreProcessor.SonarWebService.DownloadServerVersion()
at SonarScanner.MSBuild.PreProcessor.SonarWebService.GetServerVersion()
at SonarScanner.MSBuild.PreProcessor.SonarWebService.GetProperties(String projectKey, String projectBranch)
at SonarScanner.MSBuild.PreProcessor.TeamBuildPreProcessor.FetchArgumentsAndRulesets(ISonarQubeServer server, ProcessedArgs args, TeamBuildSettings settings, IDictionary2& serverSettings, List1& analyzersSettings)
at SonarScanner.MSBuild.PreProcessor.TeamBuildPreProcessor.DoExecute(ProcessedArgs localSettings)
at SonarScanner.MSBuild.BootstrapperClass.PreProcess()
at SonarScanner.MSBuild.BootstrapperClass.Execute()
at SonarScanner.MSBuild.Program.Execute(String args, ILogger logger)
at SonarScanner.MSBuild.Program.Main(String args)
ERROR: Execution of SonarScanner for MSBuild failed (exit code 255)
Finished: FAILURE

Which version of SonarQube are you using ? Do you downloaded it from the SonarQube website or elsewhere ?

I have downloaded through jenkins plugin…
SonarQube Version -

Do you have redacted this part ?

Failed to request and parse ‘/sonar/api/server/version’

Normal api call should look like this : http://sonarqube.instance/api/server/version , otherwise it will fail to get the version number.

i am able to see the version number

@mickaelcaro - ya due to security i have redacted the url

Are you able to issue the call to a tool like fiddler to see if there’s any hidden character in the response, corresponding to some kind of HTTPS encoding ?

I did test on my side, the only way it can fail is if there is any word-character in any component of the version.

Let me try with fiddler @mickaelcaro

@mickaelcaro : I don’t see any issue in header. I used fiddler , even the protocol is not a issue