API version V2 not available

Must-share information (formatted with Markdown):

  • which versions are you using: SonarQube Developer Edition v9.9.6
  • how is SonarQube deployed: Zip
  • what are you trying to achieve: Updating Azure DevOps Integration from V4 to V6

Hi Team,
Having some trouble with updating our Azure DevOps plugins to use the newer SonarQubePrepare@v6 versions. The issue we are seeing is when we reach out to our Sonar Server, the task “Prepare Analysis Configuration” is attempting to download some files from urls that don’t appear to exist on our self hosted instance of SonarQube.

The Build output, from Azure DevOps is as followed.

SonarScanner for MSBuild 7.1
Using the .NET Framework version of the Scanner for MSBuild
Pre-processing started.
Preparing working directories...
03:12:17.909  Updating build integration targets...
03:12:18.371  Downloading from https://sonarqube.xxxxxxx.com.au/api/v2/analysis/version failed. Http status code is NotFound.
03:12:18.793  Downloading from https://sonarqube.xxxxxxx.com.au/api/v2/analysis/jres?os=windows&arch=x64 failed. Http status code is NotFound.
03:12:18.803  03:12:18.803  WARNING: JRE Metadata could not be retrieved from analysis/jres?os=windows&arch=x64.
03:12:18.831  Downloading from https://sonarqube.xxxxxxx.com.au/api/v2/analysis/jres?os=windows&arch=x64 failed. Http status code is NotFound.
03:12:18.831  03:12:18.831  WARNING: JRE Metadata could not be retrieved from analysis/jres?os=windows&arch=x64.
03:12:18.839  Fetching analysis configuration settings...

Hosted SonarQube Output

I have attempted to find these APIs in the Web API ‘https://sonarqube.xxxxxxx.com.au/web_api’ documentation of our SonarQube instance, they don’t appear to be present. In addition, when running these urls against the instance itself they are returning the following response.

https://sonarqube.xxxxxxx.com.au/api/v2/analysis/version
{
    "errors": [
        {
            "msg": "Unknown url : /api/v2/analysis/version"
        }
    ]
}
https://sonarqube.xxxxxxx.com.au/api/v2/analysis/jres?os=windows&arch=x64
{
    "errors": [
        {
            "msg": "Unknown url : /api/v2/analysis/jres"
        }
    ]
}

Are these APIs a part of a version of sonar that we don’t have(we run LTS). IE: We need to update?
Note: We are having no trouble running on the SonarQubePrepare@4 versions, but we are getting the deprecated warnings and want to update.

Hey there.

These APIs are part of later SonarQube versions (not v9.9).

Is analysis actually failing, or are you just seeing these warnings in the logs, and analysis proceeds as normal?

Thanks for the super-fast response Colin.

The process continues and we are able to finish out the analysis run without error. Its just the warnings in the logs, I’ve been burnt in the past from ignoring them with other products so thought I should get it checked out.

Are there any major downsides to not having these features available or should we be all good to update to version 6?

This was the last thing I needed to check before applying the changes across the platform, all our testing has otherwise gone well.

There are no major downsides. SonarQube v10.6 simply has some new features that you’ll get when you upgrade (specifically no longer having to maintain the version of Java on your build agents to match SonarQube’s requirements).

I will flag this for attention to see if we are firmly set on this log level, or if we can add some more messages (Version of SonarQube < 10.6 detected, proceeding as normal… something like that)

Cheers, thanks again.

Thank you, Colin and @gavina, for pointing this out. This is indeed a warning we should try to avoid on SonarQube versions before 10.6. I created an issue and added it to our current sprint, so we can have a look at what we can do about it:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.