Sonarqube Scanner hanging at calling the scanner

I’m running sonarqube as part of the build process in jenkins and have configured the sonarqube plugin, providing all the configuration needed etc. But 8 times out of 10 my builds hang at this point:

SonarScanner for MSBuild 4.7.1
Using the .NET Framework version of the Scanner for MSBuild
Post-processing started.
Calling the SonarQube Scanner...

Then it just hangs here until aborted.

This is my jenkins file snipit:

    stage('Build') {
      steps{
        script {
          if (env.BRANCH_NAME == 'dev') {
            def sqScannerMsBuildHome = tool 'SonarScanner-MsBuild'
            withSonarQubeEnv('Sonarqube-DEV') {                
                powershell "${sqScannerMsBuildHome}\\SonarScanner.MSBuild.exe begin /k:MYPROJECT"
                powershell 'dotnet build -c Release'
                powershell "${sqScannerMsBuildHome}\\SonarScanner.MSBuild.exe end"
            }
          } 
        }
      }
    }

I’m running the latest version of jenkins and the sonarqube plugin for jenkins. Sonarqube version 9.8 is running on ubuntu with java 11. I’ve no real experience with sonarqube so I’m only learning currently.

Hi,

First, the current version of the Scanner for .NET is 5.11. Can you upgrade?

Second, since this is intermittent, I suspect some network problem / interference. Can you talk to your network folks?

And finally, could you add /d:sonar.verbose=true to your failing command line in the hopes of getting some additional logging?

 
Ann

Hi, I’ve installed it using jenkins plugin and version 2.15 is the latest version and is installed so I’m not entirely sure why this would have the scanner updated to 5.11?

I’ll get the network checked and I’ll also add the verbose logging

Hi,

The Sonar Scanner for Jenkins is a wrapper. Dig into its configurations, and you’ll find that it points to a separate Sonar Scanner for .NET.

 
Ann

Hi Ann,

I looked into the configuration as you said and yes that was indeed the case. I’m now using version 5.11. I’ve also updated Sonarqube to 9.9 since then too.
I checked with the network team and can confirm they do not see any issues that would cause this.

I have added the verbose logging and so far I’ve got the following;


Calling the TFS Processor executable...
Executing file D:\Jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\SonarScanner-MsBuild\SonarScanner.MSBuild.TFSProcessor.exe
  Args: ConvertCoverage D:\MYPROJECT\.sonarqube\conf\SonarQubeAnalysisConfig.xml D:\MYPROJECT\.sonarqube\out\sonar-project.properties 
  Working directory: D:\MYPROJECT
  Timeout (ms):-1
  Process id: 6080
Process returned exit code 0
The TFS Processor has finished
Calling the SonarScanner CLI...
Executing file D:\Jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\SonarScanner-MsBuild\sonar-scanner-4.8.0.2856\bin\sonar-scanner.bat
  Args: -Dsonar.scanAllFiles=true -Dproject.settings=D:\MYPROJECT\.sonarqube\out\sonar-project.properties --from=ScannerMSBuild/5.11 --debug <sensitive data removed>
  Working directory: D:\MYPROJECT
  Timeout (ms):-1
  Process id: 2768

After this it hangs again and no progress is made.

EDIT:
This is my configuration on Jenkins for SonarScanner

Hi,

You’ll need to post your full, debug, job logs.

Share the Scanner for .NET verbose logs

  • Add /d:"sonar.verbose=true" to the…
    • SonarScanner.MSBuild.exe or dotnet sonarscanner begin command to get more detailed logs. For example: SonarScanner.MSBuild.exe begin /k:"MyProject" /d:"sonar.verbose=true"
  • The important logs are in the END step (i.e. SonarQubeAnalyze / SonarCloudAnalyze / “Run Code Analysis”)
    • SonarScanner.MSBuild.exe or dotnet sonarscanner end command to get more detailed logs. For example: SonarScanner.MSBuild.exe end /d:"sonar.verbose=true"
       
      Ann

Thanks, I’ve added the following logging to my jenkins file;

    stage('Build') {
      steps{
        script {
          if (env.BRANCH_NAME == 'dev') {
            def sqScannerMsBuildHome = tool 'SonarScanner-MsBuild'
            withSonarQubeEnv('Sonarqube-DEV') {                
                powershell "${sqScannerMsBuildHome}\\SonarScanner.MSBuild.exe begin /k:MYPROJECT /d:sonar.verbose=true"
                powershell 'dotnet build -c Release'
                powershell "${sqScannerMsBuildHome}\\SonarScanner.MSBuild.exe end /d:sonar.verbose=true"
            }
          } 
        }
      }
    }

It appears the /d:sonar.verbose=true is not valid in the end command;


SonarScanner for MSBuild 5.11
Using the .NET Framework version of the Scanner for MSBuild
Default properties file was found at D:\Jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\SonarScanner-MsBuild\SonarQube.Analysis.xml
Loading analysis properties from D:\Jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\SonarScanner-MsBuild\SonarQube.Analysis.xml
sonar.verbose=true was specified - setting the log verbosity to 'Debug'
Post-processing started.
15:06:28.515  Using environment variables to determine the download directory...
15:06:28.569  15:06:28.566  Uninstalling target: D:\MYPROJECT\.sonarqube\bin\targets\SonarQube.Integration.targets
powershell.exe : 15:06:28.569  15:06:28.569  This setting is not valid in the "end" phase in this version of the C# plugin: sonar.verbose
At D:\MYPROJECT@tmp\durable-f7d8f1c5\powershellWrapper.ps1:3 char:1
+ & powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -Comm ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (15:06:28.569  1...: sonar.verbose:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
 
15:06:28.57  Post-processing failed. Exit code: 1

After removing it from the end command I get the following;

Log
SonarScanner for MSBuild 5.11
Using the .NET Framework version of the Scanner for MSBuild
Default properties file was found at D:\Jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\SonarScanner-MsBuild\SonarQube.Analysis.xml
Loading analysis properties from D:\Jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\SonarScanner-MsBuild\SonarQube.Analysis.xml
sonar.verbose=true was specified - setting the log verbosity to 'Debug'
Pre-processing started.
Preparing working directories...
Using environment variables to determine the download directory...
15:09:53.671  15:09:53.654  Loading analysis properties from D:\Jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\SonarScanner-MsBuild\SonarQube.Analysis.xml
15:09:53.672  15:09:53.671  sonar.verbose=true was specified - setting the log verbosity to 'Debug'
15:09:53.677  Updating build integration targets...
15:09:53.682  The file SonarQube.Integration.ImportBefore.targets is up to date at C:\Users\jenkins_user\AppData\Local\Microsoft\MSBuild\4.0\Microsoft.Common.targets\ImportBefore
15:09:53.682  The file SonarQube.Integration.ImportBefore.targets is up to date at C:\Users\jenkins_user\AppData\Local\Microsoft\MSBuild\10.0\Microsoft.Common.targets\ImportBefore
15:09:53.682  The file SonarQube.Integration.ImportBefore.targets is up to date at C:\Users\jenkins_user\AppData\Local\Microsoft\MSBuild\11.0\Microsoft.Common.targets\ImportBefore
15:09:53.683  The file SonarQube.Integration.ImportBefore.targets is up to date at C:\Users\jenkins_user\AppData\Local\Microsoft\MSBuild\12.0\Microsoft.Common.targets\ImportBefore
15:09:53.683  The file SonarQube.Integration.ImportBefore.targets is up to date at C:\Users\jenkins_user\AppData\Local\Microsoft\MSBuild\14.0\Microsoft.Common.targets\ImportBefore
15:09:53.683  The file SonarQube.Integration.ImportBefore.targets is up to date at C:\Users\jenkins_user\AppData\Local\Microsoft\MSBuild\15.0\Microsoft.Common.targets\ImportBefore
15:09:53.683  The file SonarQube.Integration.ImportBefore.targets is up to date at C:\Users\jenkins_user\AppData\Local\Microsoft\MSBuild\Current\Microsoft.Common.targets\ImportBefore
15:09:53.684  Installed SonarQube.Integration.targets to D:\MYPROJECT\.sonarqube\bin\targets
15:09:53.686  Creating config and output folders...
15:09:53.687  Creating directory: D:\MYPROJECT\.sonarqube\conf
15:09:53.688  Creating directory: D:\MYPROJECT\.sonarqube\out
15:09:53.717  Downloading from http://10.100.100.30:9000/api/server/version...
15:09:53.747  Checking validity of server license
15:09:53.749  Downloading from http://10.100.100.30:9000/api/editions/is_valid_license...
15:09:53.767  SonarQube Community Edition detected, license is valid.
15:09:53.774  Fetching analysis configuration settings...
15:09:53.782  Fetching properties for project 'MYPROJECT' from http://10.100.100.30:9000/api/settings/values?component=MYPROJECT...
15:09:53.787  Downloading from http://10.100.100.30:9000/api/settings/values?component=MYPROJECT...
15:09:53.825  Downloading from http://10.100.100.30:9000/api/languages/list...
15:09:53.834  Fetching quality profile for project 'MYPROJECT' from http://10.100.100.30:9000/api/qualityprofiles/search?project=MYPROJECT...
15:09:53.839  Downloading from http://10.100.100.30:9000/api/qualityprofiles/search?project=MYPROJECT...
15:09:53.874  Fetching rules for quality profile 'AYYCkgy-iScMU0qNFVgb' from http://10.100.100.30:9000/api/rules/search?f=repo,name,severity,lang,internalKey,templateKey,params,actives&ps=500&qprofile=AYYCkgy-iScMU0qNFVgb&p=1...
15:09:53.878  Downloading from http://10.100.100.30:9000/api/rules/search?f=repo,name,severity,lang,internalKey,templateKey,params,actives&ps=500&qprofile=AYYCkgy-iScMU0qNFVgb&p=1...
15:09:54.016  Local analyzer cache: C:\Users\jenkins_user\AppData\Local\Temp\.sonarqube\resources
15:09:54.026  Writing Roslyn generated ruleset to D:\MYPROJECT\.sonarqube\conf\Sonar-cs.ruleset...
15:09:54.042  Writing Roslyn generated ruleset to D:\MYPROJECT\.sonarqube\conf\Sonar-cs-none.ruleset...
15:09:54.046  Provisioning analyzer assemblies for cs...
15:09:54.048  Installing required Roslyn analyzers...
15:09:54.048  Processing plugin: csharp version 8.51.0.59060
15:09:54.166  Cache hit: using plugin files from C:\Users\jenkins_user\AppData\Local\Temp\.sonarqube\resources\7
15:09:54.167  Processing plugin: vbnet version 8.51.0.59060
15:09:54.168  Cache hit: using plugin files from C:\Users\jenkins_user\AppData\Local\Temp\.sonarqube\resources\8
15:09:54.176  Writing Roslyn analyzer additional file to D:\MYPROJECT\.sonarqube\conf\cs\SonarLint.xml...
15:09:54.177  Fetching quality profile for project 'MYPROJECT' from http://10.100.100.30:9000/api/qualityprofiles/search?project=MYPROJECT...
15:09:54.177  Downloading from http://10.100.100.30:9000/api/qualityprofiles/search?project=MYPROJECT...
15:09:54.2  Fetching rules for quality profile 'AYYCkhI0iScMU0qNFWPz' from http://10.100.100.30:9000/api/rules/search?f=repo,name,severity,lang,internalKey,templateKey,params,actives&ps=500&qprofile=AYYCkhI0iScMU0qNFWPz&p=1...
15:09:54.2  Downloading from http://10.100.100.30:9000/api/rules/search?f=repo,name,severity,lang,internalKey,templateKey,params,actives&ps=500&qprofile=AYYCkhI0iScMU0qNFWPz&p=1...
15:09:54.265  Local analyzer cache: C:\Users\jenkins_user\AppData\Local\Temp\.sonarqube\resources
15:09:54.266  Writing Roslyn generated ruleset to D:\MYPROJECT\.sonarqube\conf\Sonar-vbnet.ruleset...
15:09:54.266  Writing Roslyn generated ruleset to D:\MYPROJECT\.sonarqube\conf\Sonar-vbnet-none.ruleset...
15:09:54.267  Provisioning analyzer assemblies for vbnet...
15:09:54.267  Installing required Roslyn analyzers...
15:09:54.267  Processing plugin: csharp version 8.51.0.59060
15:09:54.267  Cache hit: using plugin files from C:\Users\jenkins_user\AppData\Local\Temp\.sonarqube\resources\7
15:09:54.267  Processing plugin: vbnet version 8.51.0.59060
15:09:54.268  Cache hit: using plugin files from C:\Users\jenkins_user\AppData\Local\Temp\.sonarqube\resources\8
15:09:54.272  Writing Roslyn analyzer additional file to D:\MYPROJECT\.sonarqube\conf\vbnet\SonarLint.xml...
15:09:54.278  Processing analysis cache
15:09:54.278  Base branch parameter was not provided. Incremental PR analysis is disabled.
15:09:54.314  Pre-processing succeeded.
  
--- Snipped Build ---
  
SonarScanner for MSBuild 5.11
Using the .NET Framework version of the Scanner for MSBuild
Post-processing started.
15:12:32.747  15:12:32.678  Uninstalling target: D:\MYPROJECT\.sonarqube\bin\targets\SonarQube.Integration.targets
15:12:32.747  15:12:32.747  sonar.verbose=true was specified - setting the log verbosity to 'Debug'
15:12:32.748  Loading the SonarQube analysis config from D:\MYPROJECT\.sonarqube\conf\SonarQubeAnalysisConfig.xml
15:12:32.748  Not running under TeamBuild
15:12:32.749  Analysis base directory: D:\MYPROJECT\.sonarqube
Build directory: 
Bin directory: D:\MYPROJECT\.sonarqube\bin
Config directory: D:\MYPROJECT\.sonarqube\conf
Output directory: D:\MYPROJECT\.sonarqube\out
Config file: D:\MYPROJECT\.sonarqube\conf\SonarQubeAnalysisConfig.xml
15:12:32.757  Generating SonarQube project properties file to D:\MYPROJECT\.sonarqube\out\sonar-project.properties
15:12:32.794  Setting analysis property: sonar.visualstudio.enable=false
15:12:32.813  The supplied Code Analysis ErrorLog file is a valid json file and does not need to be fixed: D:\MYPROJECT\.sonarqube\out\0\Issues.json
15:12:32.815  The supplied Code Analysis ErrorLog file is a valid json file and does not need to be fixed: D:\MYPROJECT\.sonarqube\out\1\Issues.json
15:12:32.923  Using longest common projects path as a base directory: 'D:\MYPROJECT'.
15:12:33.017  Dumping content of sonar-project.properties
------------------------------------------------------------------------
sonar.projectKey=MYPROJECT
sonar.working.directory=D:\\MYPROJECT\\.sonarqube\\out\\.sonar
sonar.projectBaseDir=D:\\MYPROJECT
sonar.pullrequest.cache.basepath=D:\\MYPROJECT

DC50A478-C3A1-49F5-ADD1-412FA201244D.sonar.projectKey=MYPROJECT:DC50A478-C3A1-49F5-ADD1-412FA201244D
DC50A478-C3A1-49F5-ADD1-412FA201244D.sonar.projectName=MYPROJECT.Models
DC50A478-C3A1-49F5-ADD1-412FA201244D.sonar.projectBaseDir=D:\\MYPROJECT\\MYPROJECT.Models
DC50A478-C3A1-49F5-ADD1-412FA201244D.sonar.sourceEncoding=utf-8
DC50A478-C3A1-49F5-ADD1-412FA201244D.sonar.sources=\
"D:\\MYPROJECT\\MYPROJECT.Models\\Account.cs",\
"D:\\MYPROJECT\\MYPROJECT.Models\\AuditTrail.cs",\
"D:\\MYPROJECT\\MYPROJECT.Models\\AuditTrailEntry.cs",\
"D:\\MYPROJECT\\MYPROJECT.Models\\Banding.cs",\
"D:\\MYPROJECT\\MYPROJECT.Models\\BandingEntryLicenceFee.cs",\
"D:\\MYPROJECT\\MYPROJECT.Models\\BaseImportUpload.cs",\
"D:\\MYPROJECT\\MYPROJECT.Models\\ChartData.cs",\
"D:\\MYPROJECT\\MYPROJECT.Models\\ClientConfig.cs",\
"D:\\MYPROJECT\\MYPROJECT.Models\\Contact.cs",\
"D:\\MYPROJECT\\MYPROJECT.Models\\ContentBlock.cs",\
"D:\\MYPROJECT\\MYPROJECT.Models\\Contract.cs",\

ADBF7B4B-0AB6-42F5-9F44-CEBDF21782DD.sonar.cs.analyzer.projectOutPaths=\
"D:\\MYPROJECT\\.sonarqube\\out\\8"
ADBF7B4B-0AB6-42F5-9F44-CEBDF21782DD.sonar.cs.roslyn.reportFilePaths=\
"D:\\MYPROJECT\\.sonarqube\\out\\8\\Issues.json"

ADBF7B4B-0AB6-42F5-9F44-CEBDF21782DD.sonar.working.directory=D:\\MYPROJECT\\.sonarqube\\out\\.sonar\\mod22
F532ED1D-B6B1-4A90-B0FF-CB89DC2BFF86.sonar.projectKey=MYPROJECT:F532ED1D-B6B1-4A90-B0FF-CB89DC2BFF86
F532ED1D-B6B1-4A90-B0FF-CB89DC2BFF86.sonar.projectName=MYPROJECT.ION
F532ED1D-B6B1-4A90-B0FF-CB89DC2BFF86.sonar.projectBaseDir=D:\\MYPROJECT\\Customers\\MYPROJECT.ION
F532ED1D-B6B1-4A90-B0FF-CB89DC2BFF86.sonar.sourceEncoding=utf-8
F532ED1D-B6B1-4A90-B0FF-CB89DC2BFF86.sonar.sources=\
"D:\\MYPROJECT\\Customers\\MYPROJECT.ION\\Controllers\\ValuesController.cs",\
"D:\\MYPROJECT\\Customers\\MYPROJECT.ION\\Program.cs",\
"D:\\MYPROJECT\\Customers\\MYPROJECT.ION\\Startup.cs",\
"D:\\MYPROJECT\\Customers\\MYPROJECT.ION\\obj\\Release\\net6.0\\.NETCoreApp,Version=v6.0.AssemblyAttributes.cs",\
"D:\\MYPROJECT\\Customers\\MYPROJECT.ION\\obj\\Release\\net6.0\\MYPROJECT.ION.AssemblyInfo.cs",\
"D:\\MYPROJECT\\Customers\\MYPROJECT.ION\\appsettings.Development.json",\
"D:\\MYPROJECT\\Customers\\MYPROJECT.ION\\appsettings.json",\
"D:\\MYPROJECT\\Customers\\MYPROJECT.ION\\UpdateDatabase.bat",\
"D:\\MYPROJECT\\Customers\\MYPROJECT.ION\\Properties\\launchSettings.json"

F532ED1D-B6B1-4A90-B0FF-CB89DC2BFF86.sonar.cs.analyzer.projectOutPaths=\
"D:\\MYPROJECT\\.sonarqube\\out\\9"
F532ED1D-B6B1-4A90-B0FF-CB89DC2BFF86.sonar.cs.roslyn.reportFilePaths=\
"D:\\MYPROJECT\\.sonarqube\\out\\9\\Issues.json"

F532ED1D-B6B1-4A90-B0FF-CB89DC2BFF86.sonar.working.directory=D:\\MYPROJECT\\.sonarqube\\out\\.sonar\\mod23
sonar.host.url=http://10.100.100.30:9000
sonar.visualstudio.enable=false

sonar.modules=DC50A478-C3A1-49F5-ADD1-412FA201244D,2285321E-A2F5-4C3C-BD4E-33AFB7BCCBAE,6398E171-4432-4B62-AADB-C66F41276F82,BF17CCC0-5C15-4F1B-95D6-00F9F12634F7,3C10BE67-D6CB-4671-ACB3-4478AF809621,E21CE51F-EC47-4969-B77B-2D96D7DEBD89,D85821B2-7A40-420A-8083-D53736BFCD3B,1E7A59D9-6A9E-4B33-B27A-0C4D80DC9887,B0AA3F38-A44B-4D06-8140-44829224FB62,8763BABA-0CA8-433D-955E-5A9C367314F1,62956FBB-0005-42EA-8E45-1B2A539649A2,CF4A0E6C-245E-4222-8C06-978190499EE2,159E857C-015E-456E-BE7D-7980EAD9541B,C0E8821F-8EFD-4CEF-8BB1-132995ECC1AA,2008FD8B-B62B-483C-98C7-8246AC63A909,260C9921-AE1B-4973-9DFD-1F613411ADB1,F1E20084-5175-4AE7-8C05-EDE229955264,B3901466-0066-42F7-A0BD-A3E8976AB4DF,C8DC5587-3DDB-4B4A-BE45-B21186C81969,97590987-058B-43FB-9EEF-4900D16656A5,53792B45-27DA-4F2E-8B12-1C8C43D23CB6,4D015E37-8FA3-4CD6-9018-FA622449D790,ADBF7B4B-0AB6-42F5-9F44-CEBDF21782DD,F532ED1D-B6B1-4A90-B0FF-CB89DC2BFF86

------------------------------------------------------------------------
15:12:34.047  Writing processing summary to D:\MYPROJECT\.sonarqube\out\ProjectInfo.log
Calling the TFS Processor executable...
Executing file D:\Jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\SonarScanner-MsBuild\SonarScanner.MSBuild.TFSProcessor.exe
  Args: ConvertCoverage D:\MYPROJECT\.sonarqube\conf\SonarQubeAnalysisConfig.xml D:\MYPROJECT\.sonarqube\out\sonar-project.properties 
  Working directory: D:\MYPROJECT
  Timeout (ms):-1
  Process id: 688
Process returned exit code 0
The TFS Processor has finished
Calling the SonarScanner CLI...
Executing file D:\Jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\SonarScanner-MsBuild\sonar-scanner-4.8.0.2856\bin\sonar-scanner.bat
  Args: -Dsonar.scanAllFiles=true -Dproject.settings=D:\MYPROJECT\.sonarqube\out\sonar-project.properties --from=ScannerMSBuild/5.11 --debug <sensitive data removed>
  Working directory: D:\MYPROJECT
  Timeout (ms):-1
  Process id: 4624

Thanks

Hi,

Sorry about the bad instruction on the debug log. I misunderstood what I had been told. Sorry I passed that confusion forward.

So when you turn on debugging, the scanner doesn’t hang?

 
Ann

No problem, mistakes are made!

No, unfortunately when I turn on debugging the scanner still hangs except I get a few more lines of information until it hangs here;

Calling the TFS Processor executable...
Executing file D:\Jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\SonarScanner-MsBuild\SonarScanner.MSBuild.TFSProcessor.exe
  Args: ConvertCoverage d:\MYPROJECT\.sonarqube\conf\SonarQubeAnalysisConfig.xml d:\MYPROJECT\.sonarqube\out\sonar-project.properties 
  Working directory: d:\MYPROJECT
  Timeout (ms):-1
  Process id: 4300
Process returned exit code 0
The TFS Processor has finished
Calling the SonarScanner CLI...
Executing file D:\Jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\SonarScanner-MsBuild\sonar-scanner-4.8.0.2856\bin\sonar-scanner.bat
  Args: -Dsonar.scanAllFiles=true -Dproject.settings=d:\MYPROJECT\.sonarqube\out\sonar-project.properties --from=ScannerMSBuild/5.11 --debug <sensitive data removed>
  Working directory: d:\MYPROJECT
  Timeout (ms):-1
  Process id: 2052

Weirdly the very odd time it doesn’t hang and successfully completes.

When I take the command that’s executing and run it via command line on the jenkins server using the same arguments and from the same working directory it just hangs as shown below.

I have noticed that sometimes it will run but not very often. I’ve tried to find out why exactly it’s hanging by following the running processes but it just leads me to java and therefore can’t get any further.

image

I do sometimes get an output which shows authentication error which I’d expect but besides that I’m at a complete loss as to why it works approximately 1 in 20 times…

Hi,

Okay, I’ve called for help.

 
Ann

1 Like

Any further help on this yet?
Thanks

Hi,
Could there be an antivirus interfering with executing the sonar-scanner process?

Also is java well defined in the environment and do we have permissions to run it? That bat script will essentially look for a java binary and use it to run the scanner (sources here)

There’s no antivirus that would be interfering. It’s strange how it runs sometimes but more often than not it doesn’t.

Yes java is defined in the environment and it has permission to run.

I can’t understand why it would work the odd time and not just not at all?

Do I understand correctly that it hangs with the java process running?
If that’s the case, could you run jstack <pid> so that we can see the stack traces?

I’m clueless as well.

Hi Duarte,

I’ll have to install JDK (as I have JRE installed) to get stack trace so I will do this and get back to you.

Thanks

Hi Duarte,

After installing JDK, I ran jstack 2088 (pid) it produced the following;

image

Is the process running java with the same JDK as jstack?
What version are you using, by the way?

Yes, both are now running with the same version.

image