SonarQubePrepare@7 task failing in Azure DevOps Extension

We have an issue with the Azure DevOps extension SonarQubePrepare@7 task see below – we are hitting our self-hosted Sonar instance running version 9.9.3-developer

We have generated a new user token and added this to the service connection in Azure DevOps.

Can you please help us with this as it is blocking our pipelines.

Thanks in advance

Starting: Prepare SonarQube Analysis 
============================================================================== 
Task : Prepare Analysis Configuration 
Description : Prepare SonarQube Server analysis configuration 
Version : 7.1.1 
Author : sonarsource 
Help : [More Information](https://docs.sonarsource.com/sonarqube/latest/analyzing-source-code/scanners/sonarqube-extension-for-azure-devops/) 
============================================================================== 

/azp/_work/_tasks/SonarQubePrepare_15b84ca1-b62f-4a2a-a403-89b77a063157/7.1.1/SonarQubePrepare.js:50 
`,finalEOL:r=!0,replacer:i=null,spaces:o}={}){let s=r?t:"";return JSON.stringify(e,i,o).replace(/\n/g,t)+s}function pF(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e.replace(/^\uFEFF/,"")}_4.exports={stringify:cF,stripBom:pF}});var L4=q((Qre,B4)=>{var Yo;try{Yo=Qo()}catch{Yo=require("fs")}var Rp=ur(),{stringify:N4,stripBom:F4}=wp();async function dF(e,t={}){typeof t=="string"&&(t={encoding:t});let r=t.fs||Yo,i="throws"in t?t.throws:!0,o=await Rp.fromCallback(r.readFile)(e,t);o=F4(o);let s;try{s=JSON.parse(o,t?t.reviver:null)}catch(n){if(i)throw n.message=`${e}: ${n.message}`,n;return null}return s}var fF=Rp.fromPromise(dF);function hF(e,t={}){typeof t=="string"&&(t={encoding:t});let r=t.fs||Yo,i="throws"in t?t.throws:!0;try{let o=r.readFileSync(e,t);return o=F4(o),JSON.parse(o,t.reviver)}catch(o){if(i)throw o.message=`${e}: ${o.message}`,o;return null}}async function vF(e,t,r={}){let i=r.fs||Yo,o=N4( 
SyntaxError: Unexpected token ? 
    at Module._compile (internal/modules/cjs/loader.js:723:23) 
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) 
    at Module.load (internal/modules/cjs/loader.js:653:32) 
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12) 
    at Function.Module._load (internal/modules/cjs/loader.js:585:3) 
    at Function.Module.runMain (internal/modules/cjs/loader.js:831:12) 
    at startup (internal/bootstrap/node.js:283:19) 
    at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)

Hey there.

This looks a lot like issues I’ve seen in the past where the version of NodeJS that the Azure Pipelines agent uses to run the task (lots of Azure DevOps tasks are written in Node) isn’t compatible with some newer syntax.

Can you, as an experiment, set a AGENT_USE_NODE10 variable in your pipeline to false and see if that changes the behavior?

It would also be good to know what Azure DevOps Agent version you’re using.