TFS Extension Prepare Analysis on SonarQube task not working

Hi All,

I´m getting an error in one of out automated build in our TFS.

  • TFS 2017 Update 2 15.117.26714.0 (Tfs2017.Update2)
  • Sonar Extension version 4.3.2
  • We have the endpoint configured with a valid token (It works with other builds in the same teamproject)

Sometimes when we run our build the Prepare Analysis Configuration Task (Version 4) is failing with the following error (I used the system.debug = true to get a detail log):

[SQ] API GET: ‘/api/server/version’ with query “undefined”

[SQ] API GET ‘/api/server/version’ failed, error was: {“code”:“ECONNREFUSED”,“errno”:“ECONNREFUSED”,“syscall”:“connect”,“address”:"***.***.***.***",“port”:443}

task result: Failed

[SQ] API GET ‘/api/server/version’ failed, error was: {“code”:“ECONNREFUSED”,“errno”:“ECONNREFUSED”,“syscall”:“connect”,“address”:"***.***.***.***",“port”:443}

Processed: ##vso[task.issue type=error;][SQ] API GET ‘/api/server/version’ failed, error was: {“code”:“ECONNREFUSED”,“errno”:“ECONNREFUSED”,“syscall”:“connect”,“address”:"***.***.***.***",“port”:443}

Processed: ##vso[task.complete result=Failed;][SQ] API GET ‘/api/server/version’ failed, error was: {“code”:“ECONNREFUSED”,“errno”:“ECONNREFUSED”,“syscall”:“connect”,“address”:"***.***.***.***",“port”:443}

When I change to version 3 of the task I don´t get the error, but my angular project is not analysed.

Thanks !
Claudio

Hi Claudio,

Looks like you’re hitting a connectivity issue, independent from SonarQube itself (the error comes from the underlying stacks, in this case Node.js).

No surprise here, older versions were based on different technologies.

All in all, similarly to this topic (or this one) you need to understand why the node process (or maybe the OS itself) on the VSTS agent fails to connect to the SonarQube URL you provide.