Unable to connect to server

I am facing the below mention issue with window self hosted agent. I tried agent on window server 2012/2019, but every time we are getting same error.

Error is :- ##[error]14:57:47.723 Unable to connect to server. Please check if the server is running and if the address is correct. Url: 'https://sonarcloud.io/api/server/version’.

Please help me to get this resolved.

On our side SonarCloud is up and running!

Does your windows server have access to the public internet?

Thanks Colin for reply.

Yes, The server have the internet access.

hear the error logs-

##[error]14:57:47.723  Unable to connect to server. Please check if the server is running and if the address is correct. Url: 'https://sonarcloud.io/api/server/version'.
14:57:47.723  Unable to connect to server. Please check if the server is running and if the address is correct. Url: 'https://sonarcloud.io/api/server/version'.
##[error]14:57:47.723  An error occured while querying the server version! Please check if the server is running and if the address is correct.
14:57:47.723  An error occured while querying the server version! Please check if the server is running and if the address is correct.
##[error]14:57:47.723  Pre-processing failed. Exit code: 1
14:57:47.723  Pre-processing failed. Exit code: 1
##[error]The process 'F:\Azure pipeline self hosted agent\vsts-agent-win-x64-2.171.1\builds\_tasks\SonarCloudPrepare_14d9cde6-c1da-4d55-aa01-2965cd301255\1.40.2\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe' failed with exit code 1

Thanks. I still find that really odd.

This is a very old version of the VSTS agent (June 2020). Is this the latest one you’re able to use? Which version of Azure DevOps is it associated with?

Thanks for coming back.

We tried with the latest agent vsts-agent-win-x64-3.230.0 but same issue.

Please suggest !!

I would start by trying to isolate whether it’s an issue with the Azure DevOps extension, or with overall connectivity to SonarCloud.

I would suggest running this Powershell both directly on the machine, and also as a part of your pipeline (using a task to run powershell)

invoke-webrequest https://sonarcloud.io/api/server/version