[Sonar scanner]Cannot run programe 'subprocess' in .sonartmp folder due to no such file or directory

Hello guys, I am facing the subprocess in .sonartmp cannot be found issue, could you help me to check what the problem?
I am checking the file ‘subprocess’ in temp folder .scannerwork/.sonartmp/11904347178012006523/subprocess during the scanner running, I found it does exist, but was removed soon.

here’s the versions of related tools/OS:

SonarQube version: 9.4.0.54424
build-wrapper, version 6.32 (linux-x86)
SonarScanner 4.7.0.2747
Java 11.0.14.1 Eclipse Adoptium (64-bit)
Linux 5.19.0-32-generic amd64

SonarQube is deployed by docker-compose.

It works well when running command in project folder and the json file can be generated in sonar_output folder:
build-wrapper-linux-x86-64 --out-dir sonar_output ./build.sh

But when I run the sonar-scanner:
sonar-scanner -Dsonar.projectKey=<projectKey> -Dsonar.sources=. -Dsonar.host.url=http://<sonar_server>:9000 -Dsonar.login=<product_token> -Dsonar.cfamily.threads=4 -Dsonar.language=c '-Dsonar.inclusions=**/*.c,**/*.h' -Dsonar.cfamily.cache.enabled=false -Dsonar.branch.name=CItesting -Dsonar.projectVersion=development -Dsonar.cfamily.build-wrapper-output=sonar_output -X

It raises the exception:
19:28:33.416 ERROR: Error during SonarScanner execution
java.lang.IllegalStateException: java.io.IOException: Cannot run program “/project/.scannerwork/.sonartmp/11904347178012006523/subprocess” (in directory “/xxxx”): error=2, No such file or directory
at com.sonar.cpp.driver.ProcessExecutor.execute(ProcessExecutor.java:74)
at com.sonar.cpp.driver.ProcessExecutor.execute(ProcessExecutor.java:45)
at com.sonar.cpp.analyzer.ClangDriver.lambda$probeCompiler$9(ClangDriver.java:612)
at java.base/java.util.HashMap.computeIfAbsent(Unknown Source)
at com.sonar.cpp.analyzer.ClangDriver.probeCompiler(ClangDriver.java:602)
at com.sonar.cpp.analyzer.ClangDriver.onCapture(ClangDriver.java:385)
at com.sonar.cpp.analyzer.CompilerDrivers.onCapture(CompilerDrivers.java:35)
at com.sonar.cpp.plugin.CFamilySensor.lambda$process$12(CFamilySensor.java:648)
at com.sonar.cpp.plugin.BuildWrapperJsonReader.readCaptures(BuildWrapperJsonReader.java:87)
at com.sonar.cpp.plugin.CFamilySensor.process(CFamilySensor.java:645)
at com.sonar.cpp.plugin.CFamilySensor.process(CFamilySensor.java:416)
at com.sonar.cpp.plugin.CFamilySensor.execute(CFamilySensor.java:186)
at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:64)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:85)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:62)
at org.sonar.scanner.scan.SpringModuleScanContainer.doAfterStart(SpringModuleScanContainer.java:81)
at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
at org.sonar.scanner.scan.SpringProjectScanContainer.scan(SpringProjectScanContainer.java:392)
at org.sonar.scanner.scan.SpringProjectScanContainer.scanRecursively(SpringProjectScanContainer.java:388)
at org.sonar.scanner.scan.SpringProjectScanContainer.doAfterStart(SpringProjectScanContainer.java:357)
at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
at org.sonar.scanner.bootstrap.SpringGlobalContainer.doAfterStart(SpringGlobalContainer.java:134)
at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
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 java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/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)
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)
Caused by: java.io.IOException: Cannot run program “/project/.scannerwork/.sonartmp/11904347178012006523/subprocess” (in directory “/xxxx”): error=2, No such file or directory
at java.base/java.lang.ProcessBuilder.start(Unknown Source)
at java.base/java.lang.ProcessBuilder.start(Unknown Source)
at com.sonar.cpp.driver.ProcessExecutor.execute(ProcessExecutor.java:58)
… 39 more
Caused by: java.io.IOException: error=2, No such file or directory
at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
at java.base/java.lang.ProcessImpl.(Unknown Source)
at java.base/java.lang.ProcessImpl.start(Unknown Source)
… 42 more

Thank for your help!

Hi,

Your version is past EOL. You should upgrade to either the latest version or the current LTS at your earliest convenience. Your upgrade path is:

9.4 → 9.9.2 → 10.2.1 (last step optional)

You may find these resources helpful:

If you have questions about upgrading, feel free to open a new thread for that here.

If your error persists after upgrade, please come back to us.