Cannot run program ".scannerwork/.sonartmp/subprocess"

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
  1. SonarQube - Enterprise Edition Version 9.9 (build 65466)
  2. SonarScanner - 4.8.1
  • how is SonarQube deployed: zip, Docker, Helm

zip

  • what are you trying to achieve

Get sonar-scanner work from Apple Silicon

% uname -a
Darwin build-node.local 22.6.0 Darwin Kernel Version 22.6.0: Fri Sep 15 13:39:33 PDT 2023; root:xnu-8796.141.3.700.8~1/RELEASE_ARM64_VMAPPLE arm64

% sw_vers
ProductName:            macOS
ProductVersion:         13.6
BuildVersion:           22G120
  • what have you tried so far to achieve this
# /path/to/project/sonar-project.properties
sonar.python.version=3
sonar.sourceEncoding=UTF-8
sonar.projectVersion=1.0
sonar-scanner -Dsonar.host.url=https://sonarqube.server.url -Dsonar.projectKey=my-project-key -Dsonar.cfamily.compile-commands=/path/to/project/default-release/compile_commands.json -Dsonar.cfamily.bullseye.reportPath=/path/to/project/merged.xml -X -Dsonar.verbose=true
...
08:38:05.202 INFO: ------------------------------------------------------------------------
08:38:05.203 INFO: EXECUTION FAILURE
08:38:05.203 INFO: ------------------------------------------------------------------------
08:38:05.208 INFO: Total time: 17.294s
08:38:05.380 INFO: Final Memory: 37M/127M
08:38:05.384 INFO: ------------------------------------------------------------------------
08:38:05.386 ERROR: Error during SonarScanner execution
java.lang.IllegalStateException: java.io.IOException: Cannot run program "/path/to/project/.scannerwork/.sonartmp/14356400883929659291/subprocess" (in directory "/path/to/project/default-release"): error=2, No such file or directory

sonar_scanner.log (47.2 KB)

Have checked that

  • /path/to/project/.cake_build/default-release exists on disk
  • /path/to/project/.scannerwork/.sonartmp/10633693951173527253/subprocess does not exist on disk

Thanks for any help!

Hello @joyt,

How is the compile_commands.json file generated? Could you share it with us? (Let me know if you prefer to share this info privately and I can start a private thread)

Regarding your post:

The log file shows a different path: /path/to/project/default-release. This differs from what you mentioned. Could you check if the former path exists?

This is expected, as .sonartmp is cleared at the end of the analysis.

Sidenote: Please note that native Apple Silicon support has been improved in SonarQube 10.7 and SonarScanner 6.1 or later, Updating can improve analysis performance.

The path is identical and does exist, it’s typo made when I was trying to mask the real project path.

I am using the SonarQube 9.9 shared by other support team, upgrading is not an option for me.

Could you help to start with private thread? I can share more details from there, thank you Mostafa!

The issue is resolved, it was due to corrupted JRE failing to launch the subprocess executable