SonarQubeAnalyze@4 in Azure DevOps pipeline throwing errors since SonarQube upgrade 8.5 -> 8.9

SonarQube Version: 8.9.0.43852
AzureDevOps SonarQube Extension: SonarQubeAnalyze@4
SonarQube Edition: Community

Since upgrading from 8.5 to 8.9 we are getting errors in the SonarQubeAnalyze@4 yaml task. No changes have been made to the task and it was working fine before the upgrade.

Some of the errors we are getting:

2021-05-06T20:31:09.6071023Z ##[error]21:31:09.596 ERROR: C:\\_work\7\.sonarqube\out\.sonar\mod12\css-bundle\node_modules\queue-microtask\index.js:5
2021-05-06T20:31:09.6073468Z 21:31:09.596 ERROR: C:\\_work\7\.sonarqube\out\.sonar\mod12\css-bundle\node_modules\queue-microtask\index.js:5
2021-05-06T20:31:09.6078975Z ##[error]21:31:09.596 ERROR:   ? queueMicrotask.bind(globalThis)
21:31:09.596 ERROR:                         ^
21:31:09.596 ERROR: 
21:31:09.596 ERROR: ReferenceError: globalThis is not defined
21:31:09.596 ERROR:     at Object.<anonymous> (C:\\_work\7\.sonarqube\out\.sonar\mod12\css-bundle\node_modules\queue-microtask\index.js:5:25)
21:31:09.596 ERROR:     at Module._compile (internal/modules/cjs/loader.js:816:30)
21:31:09.596 ERROR:     at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
21:31:09.596 ERROR:     at Module.load (internal/modules/cjs/loader.js:685:32)
21:31:09.596 ERROR:     at Function.Module._load (internal/modules/cjs/loader.js:620:12)
21:31:09.596 ERROR:     at Module.require (internal/modules/cjs/loader.js:723:19)
21:31:09.596 ERROR:     at require (internal/modules/cjs/helpers.js:14:16)
21:31:09.596 ERROR:     at Object.<anonymous> (C:\\_work\7\.sonarqube\out\.sonar\mod12\css-bundle\node_modules\run-parallel\index.js:4:24)
21:31:09.596 ERROR:     at Module._compile (internal/modules/cjs/loader.js:816:30)
21:31:09.596 ERROR:     at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
2021-05-06T20:31:09.6081912Z 21:31:09.596 ERROR:   ? queueMicrotask.bind(globalThis)
2021-05-06T20:31:09.6082277Z 21:31:09.596 ERROR:                         ^
2021-05-06T20:31:09.6083176Z 21:31:09.596 ERROR: 
2021-05-06T20:31:09.6083610Z 21:31:09.596 ERROR: ReferenceError: globalThis is not defined
2021-05-06T20:31:09.6084240Z 21:31:09.596 ERROR:     at Object.<anonymous> (C:\\_work\7\.sonarqube\out\.sonar\mod12\css-bundle\node_modules\queue-microtask\index.js:5:25)
2021-05-06T20:31:09.6084933Z 21:31:09.596 ERROR:     at Module._compile (internal/modules/cjs/loader.js:816:30)
2021-05-06T20:31:09.6085884Z 21:31:09.596 ERROR:     at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
2021-05-06T20:31:09.6086373Z 21:31:09.596 ERROR:     at Module.load (internal/modules/cjs/loader.js:685:32)
2021-05-06T20:31:09.6086884Z 21:31:09.596 ERROR:     at Function.Module._load (internal/modules/cjs/loader.js:620:12)
2021-05-06T20:31:09.6087397Z 21:31:09.596 ERROR:     at Module.require (internal/modules/cjs/loader.js:723:19)
2021-05-06T20:31:09.6087901Z 21:31:09.596 ERROR:     at require (internal/modules/cjs/helpers.js:14:16)
2021-05-06T20:31:09.6088576Z 21:31:09.596 ERROR:     at Object.<anonymous> (C:\\_work\7\.sonarqube\out\.sonar\mod12\css-bundle\node_modules\run-parallel\index.js:4:24)
2021-05-06T20:31:09.6091456Z 21:31:09.596 ERROR:     at Module._compile (internal/modules/cjs/loader.js:816:30)
2021-05-06T20:31:09.6092012Z 21:31:09.596 ERROR:     at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
2021-05-06T20:32:09.3743070Z ##[error]21:32:09.369 ERROR: CSS rules were not executed. Failed to start server (60s timeout)
org.sonarsource.nodejs.NodeCommandException: Failed to start server (60s timeout)
2021-05-06T20:32:09.3744399Z 21:32:09.369 ERROR: CSS rules were not executed. Failed to start server (60s timeout)
2021-05-06T20:32:09.3746379Z org.sonarsource.nodejs.NodeCommandException: Failed to start server (60s timeout)
2021-05-06T20:32:09.3760682Z ##[error]at org.sonar.css.plugin.server.CssAnalyzerBridgeServer.startServer(CssAnalyzerBridgeServer.java:113)
	at org.sonar.css.plugin.server.CssAnalyzerBridgeServer.startServerLazily(CssAnalyzerBridgeServer.java:177)
	at org.sonar.css.plugin.CssRuleSensor.execute(CssRuleSensor.java:99)
	at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:48)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:85)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:59)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:77)
2021-05-06T20:32:09.3763665Z 	at org.sonar.css.plugin.server.CssAnalyzerBridgeServer.startServer(CssAnalyzerBridgeServer.java:113)
2021-05-06T20:32:09.3764266Z 	at org.sonar.css.plugin.server.CssAnalyzerBridgeServer.startServerLazily(CssAnalyzerBridgeServer.java:177)
2021-05-06T20:32:09.3764824Z 	at org.sonar.css.plugin.CssRuleSensor.execute(CssRuleSensor.java:99)
2021-05-06T20:32:09.3765336Z 	at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:48)
2021-05-06T20:32:09.3766026Z 	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:85)
2021-05-06T20:32:09.3766555Z 	at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:59)
2021-05-06T20:32:09.3767295Z 	at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:77)
2021-05-06T20:32:09.3768502Z ##[error]at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:59)
	at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:82)
2021-05-06T20:32:09.3769869Z 	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:59)
2021-05-06T20:32:09.3770380Z 	at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:82)
2021-05-06T20:32:09.3771930Z ##[error]at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
2021-05-06T20:32:09.3773102Z 	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
2021-05-06T20:32:09.3773644Z 	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
2021-05-06T20:32:09.3777861Z ##[error]at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:392)
	at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:388)
	at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:385)
	at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:357)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
	at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:150)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
2021-05-06T20:32:09.3780457Z 	at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:392)
2021-05-06T20:32:09.3781032Z 	at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:388)
2021-05-06T20:32:09.3781600Z 	at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:385)
2021-05-06T20:32:09.3782189Z 	at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:357)
2021-05-06T20:32:09.3782762Z 	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
2021-05-06T20:32:09.3783303Z 	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
2021-05-06T20:32:09.3783954Z 	at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:150)
2021-05-06T20:32:09.3784519Z 	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
2021-05-06T20:32:09.3785079Z 	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
2021-05-06T20:32:09.3788612Z ##[error]at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72)
	at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:66)
	at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
	at com.sun.proxy.$Proxy0.execute(Unknown Source)
	at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
2021-05-06T20:32:09.3790459Z 	at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72)
2021-05-06T20:32:09.3791806Z 	at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:66)
2021-05-06T20:32:09.3792365Z 	at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
2021-05-06T20:32:09.3792874Z 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2021-05-06T20:32:09.3793428Z 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
2021-05-06T20:32:09.3794166Z 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
2021-05-06T20:32:09.3794549Z 	at java.lang.reflect.Method.invoke(Unknown Source)
2021-05-06T20:32:09.3795010Z 	at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
2021-05-06T20:32:09.3795636Z 	at com.sun.proxy.$Proxy0.execute(Unknown Source)
2021-05-06T20:32:09.3796081Z 	at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
2021-05-06T20:32:09.3798001Z ##[error]at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
	at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
	at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
	at org.sonarsource.scanner.cli.Main.main(Main.java:61)
2021-05-06T20:32:09.3799324Z 	at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
2021-05-06T20:32:09.3799819Z 	at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
2021-05-06T20:32:09.3800624Z 	at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
2021-05-06T20:32:09.3802581Z 	at org.sonarsource.scanner.cli.Main.main(Main.java:61)
2021-05-06T20:32:09.3802809Z 

Any help appreciated.
Andrew

Hey there.

What version of NodeJS is installed on the server? Is it at least 10 (and not 11)?

On our build machines the node js version is 11.14.00. This has not changed since the upgrade

Hey there.

NodeJS 11 is the problem, and started to be the problem between 8.5 and 8.9.

From the docs:

Supported versions are current LTS versions (v10, v12, v14) and latest version v15. Odd (non LTS) versions might work, but are not actively tested. We recommend using the latest available LTS version (v14 as of today) for optimal stability and performance.

Using a supported version should put you back in a good place.

Thanks a lot Colin. Missed that in the documents, so apologies for that. I will upgrade to v12 or 14 and see how I get on. Will post the results back here.

Upgraded node to v12 lts. We are now getting this in the ‘prepare SonarQube Analysis’ yaml task

2021-05-10T09:50:36.2540466Z 10:50:36.24 Fetching rules for quality profile ‘AXUhYILxI24wawc1tZd3’ from https:///api/rules/search?f=repo,name,severity,lang,internalKey,templateKey,params,actives&ps=500&qprofile=AXUhYILxI24wawc1tZd3&p=1…
2021-05-10T09:50:36.2556603Z 10:50:36.24 Downloading from https:///api/rules/search?f=repo,name,severity,lang,internalKey,templateKey,params,actives&ps=500&qprofile=AXUhYILxI24wawc1tZd3&p=1…
2021-05-10T09:51:07.7797713Z ##[error]10:51:07.749 Failed to request and parse ‘https:///api/rules/search?f=repo,name,severity,lang,internalKey,templateKey,params,actives&ps=500&qprofile=AXUhYILxI24wawc1tZd3&p=1’: Value cannot be null.
Parameter name: s
2021-05-10T09:51:07.7807946Z 10:51:07.749 Failed to request and parse ‘https://removed/api/rules/search?f=repo,name,severity,lang,internalKey,templateKey,params,actives&ps=500&qprofile=AXUhYILxI24wawc1tZd3&p=1’: Value cannot be null.
2021-05-10T09:51:07.7808628Z Parameter name: s
2021-05-10T09:51:07.9804823Z
2021-05-10T09:51:07.9805281Z ##[error]Unhandled Exception:
2021-05-10T09:51:07.9845859Z ##[error]System.ArgumentNullException: Value cannot be null.
Parameter name: s
at System.IO.StringReader…ctor(String s)
at Newtonsoft.Json.Linq.JObject.Parse(String json, JsonLoadSettings settings)
at SonarScanner.MSBuild.PreProcessor.SonarWebService.<>c__DisplayClass7_1.<b__0>d.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SonarScanner.MSBuild.PreProcessor.SonarWebService.d__17`1.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SonarScanner.MSBuild.PreProcessor.SonarWebService.d__7.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SonarScanner.MSBuild.PreProcessor.TeamBuildPreProcessor.d__14.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SonarScanner.MSBuild.PreProcessor.TeamBuildPreProcessor.d__12.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SonarScanner.MSBuild.PreProcessor.TeamBuildPreProcessor.d__11.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SonarScanner.MSBuild.BootstrapperClass.d__9.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SonarScanner.MSBuild.BootstrapperClass.d__8.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SonarScanner.MSBuild.Program.d__4.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SonarScanner.MSBuild.Program.d__3.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SonarScanner.MSBuild.Program.d__2.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SonarScanner.MSBuild.Program.(String args)

Regards,
Andrew

Any help with the above error would be appreciated. We are totally stuck at the moment since we upgraded to 8.9 community edition.

Regards,
Andrew

Hello, do you use the YAML pipelines or a classic one ?
If you’re using a YAML pipeline, care to share it ?

Hello Mikaël,
This has only started happening since the upgrade to 8.9. Here is the YAML task which has not been touched.

# Prepare SonarQube Analysis
  • task: SonarQubePrepare@4
    displayName: ‘Prepare analysis on SonarQube’
    condition: and(succeeded(), eq(variables[‘Build.Sourcebranch’], ‘refs/heads/master’))
    continueOnError: true
    inputs:
    SonarQube: ‘${{parameters.serviceConnection}}’
    projectKey: ‘${{parameters.projectKey}}’
    projectName: ‘${{parameters.projectName}}’
    extraProperties: |
    sonar.coverageReportPaths=$(Build.SourcesDirectory)/coverageResults/Cobertura/SonarQube.xml
    sonar.verbose=true

Regards,
Andrew

Hey,

Did you try to manually open the url mentioned in your stacktrace ?

Hello,

When I try that I got this:
{“errors”:[{“msg”:“The \u0027p\u0027 parameter cannot be parsed as an integer value: 1\u0027”}]}

Hello,
Any updates on this please ?

Regards,
Andrew

Hey Andrew.

The first question would be – if you revert the change you made to your NodeJS installation, do you move past the Prepare analysis error? Let’s not immediately assume the two are connected.

Hello Colin,
Well we upgraded from nodejs 11 to 12lts so that we could upgrade to 8.9. This is discussed in the earlier part of this thread. Once the upgrade was done and we then ran the build pipeline using the 8.9 and the azure devops build agent running nodejs 12lts we hit the latest error as posted on the stack trace. I do not know how I can prove what you are saying.

Regards,
Andrew

Hello,
Any more thoughts on this, as we are completely stuck.

Regards,
Andrew