VSTS Error: API GET '/api/server/version' failed, error was: {"code":"ETIMEDOUT"


We use VSTS and we are now trying to analize solutions with SonarQube. We are running SonarQube version:
I was following all suggested steps to analize, but in the SonarQube first step I’am getting this error:

Phase: Prepare SonarQube analysis configuration -->Version 4.*
[SQ] API GET '/api/server/version' failed, error was: {"code":"ETIMEDOUT","errno":"ETIMEDOUT","syscall":"connect","address":"XXX.XX.XXX.XXX","port":9000}

Where XXX.XX.XXX.XXX is our external IP address for SonarQube server running in port 9000.

If we ask to server for this info: http://XXX.XX.XXX.XXX:9000/api/server/version it returns correct answer:

Thanks in advanced,

Hi Jaime,

Similarly to other past threads, it looks like you’re hitting a connectivity issue, independent from SonarQube itself (the error comes from the underlying stacks).

Did you try this from the VSTS agent itself ? If not I would suggest to first simply check if the VSTS agent does have connectivity to that IP address or not.

Hello Nicolas,

You are right. It was connectivity issue.
In VSTS phase I was traying to put the external URL for our SonarQube Server, instead the address for the agent is an internal IP.
Changing the VSTS phase URL address to an internal SonarQube Server URL solve the problem.

Thanks for your help,

1 Like

I’m not getting you. Could you please reply with example.

Hi NicoB,

Where do you find VSTS agent and how to setup it with SonarQube server.



In order to get it work, you have to install an on-premise version of TFS (2017+ is supported) / Azure DevOps Server, then install the SonarQube extension then configure your build pipeline with it.


I have done it but getting below error:

[SQ] API GET ‘/api/server/version’ failed, error was: {“code”:“ETIMEDOUT”,“errno”:“ETIMEDOUT”,“syscall”:“connect”,“address”:“serverIP”,“port”:9000}

Its failing at prepare analysis on sonarqube task.What to do to resolve this issue.

It means that your build agent cannot reach the SonarQube instance.

What is your setup ? Do you have a firewall, something else ?


How do I check and verify. Can I show you using screen sharing.

Try to ping your SonarQube instance from the machine where your build agent is installed. Which version of Azure DevOps are you using ?


If your SonarQube instance is not accessible from the internet, then i guess it’s normal that you get the error.

Yes I’m not able to access my sonarQube instance(hosted on Azure VM) http://10.x.x.x:9000/ from local machine. This service connection I’m accessing from project VSTS pipeline.

Which build agent are you using ? a Microsoft-Hosted or one that you have installed by yourself ? Weird that your IP is a private one whereas your are on an Azure VM (or at least you have a private network inside it)

I’m using VSTS hosted agent.