Prepare Analysis Configuration Fails in version 6.3.2

We have integrated SonarQube Analysis into our Azure DevOps Pipeline, which was functioning correctly until 2024.08.05. However, starting from 2024.08.06, the pipeline began failing consistently after exactly 1 minute with the following error message:

Observations:

  • The failure coincides with an upgrade from SonarQube version 6.3.1 to 6.3.2. Prior to the upgrade, everything was working smoothly.
  • Reverting the task version to 5.* resolves the issue, but this version is deprecated, and we would prefer to use the latest version.
  • Given the circumstances, it seems unlikely that this issue is related to firewall or authentication, as the error occurs consistently at the 1-minute mark, suggesting a potential timeout problem.
  • I verified the version endpoint, and it is accessible via my browser, returning version 9.9.6.92038 without issue.

Environment:

  • We are using Microsoft Hosted Agents with the Windows Latest agent.
  • The pipeline is configured with the “Integrate with MSBuild” option in the SonarQube prepare task for a .NET 6.0 Web API project.

Steps Taken:

  1. Attempted to use older versions in the Scanner MSBuild Version input.
  2. Tried updating NodeJS and Java versions within the pipeline.
  3. Reverted to the 5.* version of the DevOps task, which successfully completed the pipeline.

Request:

We need assistance in identifying and resolving the issue with SonarQube version 6.3.2 to ensure our pipelines can run successfully with the latest version.

Thank you.

I managed to find the source of the problem. The task fails in this file at line 24.

I found the Pull Request where the version of the task was increased to 6.3.2. and it includes the node-fetch package update from 2.7.0 to 3.3.2. The 5.* version of the Prepare Analysis task works, because it uses the 2.7.0 node-fetch version. It seems the 3.3.2 version of the node-fetch package has an issue.

1 Like

Hi,

Welcome to the community and thanks for this report!

I’ve flagged this for the team.

 
Ann

Hello,

We experience the same problem. What is interesting is that with the Task version 5.x it works fine but with 6.x we get operation aborted after 1 minute.

##[debug][SQ] API GET: ‘/api/server/version’ with full URL "https://***/api/server/version" and query “undefined”
##[debug]Not using a proxy agent
##[debug][SQ] API GET ‘/api/server/version’ failed, error is The operation was aborted.
##[warning]Error while executing SonarQube:Prepare task: [SQ] API GET ‘/api/server/version’ failed, error is The operation was aborted.
##[debug]Processed: ##vso[task.issue type=warning;]Error while executing SonarQube:Prepare task: [SQ] API GET ‘/api/server/version’ failed, error is The operation was aborted.
##[debug]task result: Failed

URL is correct (I have replaced it with *** but it is the correct URL there), I even tried to run a PowerShell script by the pipeline to call the same URL and the version is returned.

Any idea what else could I check?

Thanks,
Gabor

Hi @Gabor_Lorincz,

Welcome to the community!

Would you be able to packet trace when the scanner makes that failing call?

Also, can you share whether your build agent is self hosted?

 
Thx,
Ann

Hello Ann,

It is not self hosted, a windows-latest Azure agent.

Some additional information to the issue:
On 5 August it was working with version 6.3.1 but failed the following day with version 6.3.2. Can it be related to the node-fetch update?

For packet tracing, I would need to raise an internal ticket to our IT team, I would like to keep that as the last option.

Thanks,
Gabor

Does anyone here have any update? On our side the issue still persists.

Good morning,

We also have the same problem on our side with this version. In graphics pipelines we cannot specify a minor version and we had no choice but to revert to version 5 which is deprecated and displayed a warning when using it.

But we managed to configure our yaml pipelines to use version 6.3.1. Which does not solve the problem since version 6.3.2 still does not work.

Hello @Gergo , and @TADIE_Denis_Laurel , @Gabor_Lorincz for reporting to this thread.

It seems y’all are using the windows-latest Microsoft agents. Unfortunately, I could not reproduce your issue using these runners.

Can you please confirm:

  • Whether the Microsot agent is setup with any kind of proxy (through Agent.ProxyUrl, HTTP[S}_PROXY or any other variable)
  • Share your pipeline definition
  • Share your debug logs for the failing prepare task
  • Feel free to send this by PM if you have privacy conerns

Also, can you please put this in your pipeline

- task: Bash@3
  inputs:
    targetType: 'inline'
    script: |
      curl -v 'https://your-sq/api/server/version'

and tell me if this works? Thanks a lot for your help
Benjamin

2 Likes

Hello @benjamin.raymond !

Thanks for looking into our issue.

Curl is working, just as when I tried with PowerShell earlier. The “workaround” of @TADIE_Denis_Laurel is also working, version 6.3.1 seems to be able to connect.

Gabor

1 Like

Here is an update on this thread: We started an effort this week to harden the extension and we will try to mitigate this issue. Refer to this ticket for updates in our progress. You can reasonibly expect the fix to be released next week in the next weeks.

At the meantime, if you find time to send the information that I mentioned in my previous post, please do as it can help reproduce the issue:

  • Pipeline definition
  • Debug logs for the failing prepare task
  • Tell me whether you are using a proxy and how (Agent.ProxyURL, HTTP[S]_PROXY env variable, …)

Thanks for your help
Benjamin

1 Like

Hello Benjamin,

For the pipeline there is nothing special, here is the Sonar Preparation task:

  • task: SonarQubePrepare@6
    continueOnError: true
    inputs:
    SonarQube: {{SONAR_SERVICE_CONNECTION}}
    scannerMode: ‘MSBuild’
    projectKey: {{PROJECT_KEY}}
    projectName: {{PROJECT_NAME}}
    extraProperties: |
    sonar.cs.vscoveragexml.reportsPaths=/TestResults//.coveragexml
    sonar.cs.vstest.reportsPaths=/TestResults//
    .trx
    sonar.verbose=true

Here are the logs:

##[debug]Evaluating condition for step: 'SonarQubePrepare'

##[debug]Evaluating: SucceededNode()

##[debug]Evaluating SucceededNode:

##[debug]=> True

##[debug]Result: True

Starting: SonarQubePrepare

==============================================================================

Task : Prepare Analysis Configuration

Description : Prepare SonarQube analysis configuration

Version : 6.3.2

Author : sonarsource

Help : [More Information](https://docs.sonarsource.com/sonarqube/latest/analyzing-source-code/scanners/sonarqube-extension-for-azure-devops/)

==============================================================================

##[debug]Using node path: C:\agents\3.243.1\externals\node16\bin\node.exe

##[debug]agent.TempDirectory=D:\a\_temp

##[debug]loading inputs and endpoints

##[debug]loading ENDPOINT_AUTH_da426df9-90e5-4727-8dcb-eae338f770c9

##[debug]loading ENDPOINT_AUTH_PARAMETER_da426df9-90e5-4727-8dcb-eae338f770c9_USERNAME

##[debug]loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN

##[debug]loading ENDPOINT_AUTH_SCHEME_da426df9-90e5-4727-8dcb-eae338f770c9

##[debug]loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION

##[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION

##[debug]loading INPUT_CLIPROJECTVERSION

##[debug]loading INPUT_CLISOURCES

##[debug]loading INPUT_CONFIGFILE

##[debug]loading INPUT_CONFIGMODE

##[debug]loading INPUT_EXTRAPROPERTIES

##[debug]loading INPUT_PROJECTKEY

##[debug]loading INPUT_PROJECTNAME

##[debug]loading INPUT_PROJECTVERSION

##[debug]loading INPUT_SCANNERMODE

##[debug]loading INPUT_SONARQUBE

##[debug]loading SECRET_SYSTEM_ACCESSTOKEN

##[debug]loaded 17

##[debug]Agent.ProxyUrl=undefined

##[debug]Agent.CAInfo=undefined

##[debug]Agent.ClientCert=undefined

##[debug]Agent.SkipCertValidation=undefined

##[debug]Agent.ProxyUrl=undefined

##[debug]Agent.CAInfo=undefined

##[debug]Agent.ClientCert=undefined

##[debug]check path : D:\a\_tasks\SonarQubePrepare_15b84ca1-b62f-4a2a-a403-89b77a063157\6.3.2\lib.json

##[debug]adding resource file: D:\a\_tasks\SonarQubePrepare_15b84ca1-b62f-4a2a-a403-89b77a063157\6.3.2\lib.json

##[debug]system.culture=en-US

##[debug]SonarQube=da426df9-90e5-4727-8dcb-eae338f770c9

##[debug]da426df9-90e5-4727-8dcb-eae338f770c9={{SONAR_SERVER}}

##[debug]da426df9-90e5-4727-8dcb-eae338f770c9 auth param apitoken = undefined

##[debug]da426df9-90e5-4727-8dcb-eae338f770c9 auth param username = ***

##[debug]da426df9-90e5-4727-8dcb-eae338f770c9 auth param password = undefined

##[debug]organization=undefined

##[debug]scannerMode=MSBuild

##[debug]projectKey={{PROJECT_KEY}}

##[debug]projectName={{PROJECT_NAME}}

##[debug]projectVersion=1.0

##[debug]organization=undefined

##[debug][SQ] API GET: '/api/server/version' with full URL "[{{SONAR_SERVER}}/api/server/version"]({{SONAR_SERVER}}/api/server/version%22) and query "undefined"

##[debug]Not using a proxy agent

##[debug][SQ] API GET '/api/server/version' failed, error is The operation was aborted.

##[warning]Error while executing SonarQube:Prepare task: [SQ] API GET '/api/server/version' failed, error is The operation was aborted.

##[debug]Processed: ##vso[task.issue type=warning;]Error while executing SonarQube:Prepare task: [SQ] API GET '/api/server/version' failed, error is The operation was aborted.

##[debug]task result: Failed

##[error][SQ] API GET '/api/server/version' failed, error is The operation was aborted.

##[debug]Processed: ##vso[task.issue type=error;][SQ] API GET '/api/server/version' failed, error is The operation was aborted.

##[debug]Processed: ##vso[task.complete result=Failed;][SQ] API GET '/api/server/version' failed, error is The operation was aborted.

Finishing: SonarQubePrepare

Thanks,
Gabor

Hello again @Gabor_Lorincz ,

It looks like there was a regression in node-fetch that we can not identify. The version of this library will be reverted in the next release that we will do, and we moved to axios for the next major version of tasks we will release (SonarQube@7 and SonarCloud@3). Hopefully, this solves your issue entierely and you can upgrade to V7 when it comes out,

FYI, the release date has been pushed to the week of 14th October,

Thank you all for your patience and your help,
Benjamin

3 Likes