Hello !
What i’m trying to achieve
I’m having some issues setting up Sonarqube with Azure Devops and i couldn’t find any other post similir to this problem.
The SonarQubePrepare@5 task fails after about two minutes with the following error :
[error]Exit code -529697949 returned from process: file name 'C:\azagent\A4\externals\node10\bin\node.exe', arguments '"C:\azagent\A4\_work\_tasks\SonarQubePrepare_15b84ca1-b62f-4a2a-a403-89b77a063157\5.4.0\prepare.js"'.
Context
I’m running Sonarqube Community Edition - Version 9.3 (build 51899) on an VM in Azure Cloud. I have an AzureDevops project hosted in Azure with SonarQube extension 5.4.0 and a Git repo hosted in azure as well.
My pipeline is running on a windows self-hosted agent (Windows 2019, OpenJDK11U-jre_x64).
The project is very small (one CS file and one JS file) as i’m just trying to do a POC.
Investigations
I’m pretty sure that the agent can join the Sonarqube server because i first had a certificate issues that i fixed using “NODE_EXTRA_CA_CERTS” variable.
I think the problem may be related to a ram issue because when looking at the task manager during execution the “node.exe” uses more than 5Go of ram (up to 100% utilization) and that’s when the task fails.
I’ve managed to run the analysis manually with SonnarScanner 4.7 without any issue.
I’ve also tried to run the pipeline in a azure hosted agent but it fails at the same step, but with a different error message (i can provide the full log if needed but I don’t know if this is relevant):
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
Finally, i’ve enabled the debug mode and the verbose output with the hope of finding an error message with more detail, but no luck on this either.
So if anyone has any idea for more troublehsooting steps, how to find more logs, etc… i’m interessted !
This is my pipeline config:
trigger:
branches:
include:
- main
variables:
- name: agentName
value: 'aras-devops01'
- name : System.Debug
value: true
stages:
- stage: Code_Analysis
jobs:
- job : SonarQube_analysis
pool:
name: Default
demands:
- agent.name -equals $(agentName)
variables:
NODE_EXTRA_CA_CERTS: $(System.DefaultWorkingDirectory)\CI-CD\internal.inensia.net_2.cer
SONAR_SCANNER_OPTS: -Xmx2048m
NODE_OPTIONS: --max-old-space-size=4096
steps:
# Prepare Analysis Configuration task
- task: SonarQubePrepare@5
inputs:
SonarQube: 'Inensia Sonarqube'
scannerMode: 'CLI'
configMode: 'manual'
cliProjectKey: 'INENSIA-Test-Project_TEST_CICD'
cliSources: '$(System.DefaultWorkingDirectory)\convertedMethods'
# Run Code Analysis task
- task: SonarQubeAnalyze@5
# Publish Quality Gate Result task
- task: SonarQubePublish@5
inputs:
pollingTimeoutSec: '300'
And this is the full log output from Azure :
##[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_PROJECTVERSION
##[debug]loading INPUT_SCANNERMODE
##[debug]loading INPUT_SONARQUBE
##[debug]loading SECRET_SYSTEM_ACCESSTOKEN
##[debug]loaded 16
##[debug]Agent.ProxyUrl=undefined
##[debug]Agent.CAInfo=undefined
##[debug]Agent.ClientCert=undefined
##[debug]Agent.SkipCertValidation=undefined
##[debug]SonarQube=0497ffba-ad41-4ff6-976b-e485578bac14
##[debug]0497ffba-ad41-4ff6-976b-e485578bac14=https://sonarqube.inensia.net/
##[debug]0497ffba-ad41-4ff6-976b-e485578bac14 auth param apitoken = undefined
##[debug]0497ffba-ad41-4ff6-976b-e485578bac14 auth param username = ***
##[debug]0497ffba-ad41-4ff6-976b-e485578bac14 auth param password = undefined
##[debug]organization=undefined
##[debug]scannerMode=MSBuild
##[debug]projectKey=INENSIA-Test-Project_TEST_CICD
##[debug]projectName=undefined
##[debug]projectVersion=1.0
##[debug]organization=undefined
##[debug][SQ] API GET: '/api/server/version' with query "undefined"
##[error]Exit code -529697949 returned from process: file name 'C:\azagent\A4\externals\node10\bin\node.exe', arguments '"C:\azagent\A4\_work\_tasks\SonarQubePrepare_15b84ca1-b62f-4a2a-a403-89b77a063157\5.4.0\prepare.js"'.
##[debug]Microsoft.VisualStudio.Services.Agent.Util.ProcessExitCodeException: Exit code -529697949 returned from process: file name 'C:\azagent\A4\externals\node10\bin\node.exe', arguments '"C:\azagent\A4\_work\_tasks\SonarQubePrepare_15b84ca1-b62f-4a2a-a403-89b77a063157\5.4.0\prepare.js"'.
at Microsoft.VisualStudio.Services.Agent.Util.ProcessInvoker.ExecuteAsync(String workingDirectory, String fileName, String arguments, IDictionary`2 environment, Boolean requireExitCodeZero, Encoding outputEncoding, Boolean killProcessOnCancel, InputQueue`1 redirectStandardIn, Boolean inheritConsoleHandler, Boolean keepStandardInOpen, Boolean highPriorityProcess, CancellationToken cancellationToken)
at Microsoft.VisualStudio.Services.Agent.ProcessInvokerWrapper.ExecuteAsync(String workingDirectory, String fileName, String arguments, IDictionary`2 environment, Boolean requireExitCodeZero, Encoding outputEncoding, Boolean killProcessOnCancel, InputQueue`1 redirectStandardIn, Boolean inheritConsoleHandler, Boolean keepStandardInOpen, Boolean highPriorityProcess, CancellationToken cancellationToken)
at Microsoft.VisualStudio.Services.Agent.Worker.Handlers.DefaultStepHost.ExecuteAsync(String workingDirectory, String fileName, String arguments, IDictionary`2 environment, Boolean requireExitCodeZero, Encoding outputEncoding, Boolean killProcessOnCancel, Boolean inheritConsoleHandler, CancellationToken cancellationToken)
at Microsoft.VisualStudio.Services.Agent.Worker.Handlers.NodeHandler.RunAsync()
at Microsoft.VisualStudio.Services.Agent.Worker.TaskRunner.RunAsync()
at Microsoft.VisualStudio.Services.Agent.Worker.StepsRunner.RunStepAsync(IStep step, CancellationToken jobCancellationToken)
Finishing: SonarQubePrepare
Thanks,
Alex