Gradle Sonar Plugin - Failed to query JRE metadata

I have a build that hasn’t ran for about a month but without any changes I can see it has started to fail with this message:

Failed to query JRE metadata: GET https://api.sonarcloud.io/analysis/jres?os=linux&arch=x86_64 failed with HTTP 401. Please check the property sonar.token or the environment variable SONAR_TOKEN.

This is a Gradle Build and uses the Azure DevOps Service Connection to authenticate. I have confirmed the token in the Service Connection is valid by opening it and pressing the Verify button. The Build is a Java 21 build but that hasn’t changed since it last worked.

It turns out the Service Connection wasn’t being passed through to the template so the SonarCloudPrepare@3 task wasn’t being ran.

As for the previous run working it looks like someone had been working on our templates between these runs.

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