Sonar-scanner in sonarscanner docker fails to execute

  • versions used:
    • SonarQube server: Enterprise EditionVersion 8.9 (build 43852)
    • Scanner: SonarScanner (available via docker image sonarsource/sonar-scanner-cli@sha256:c782340526ea4fc21226dd325da7724beb130ff756b53583387dd6aca26d3a59
  • error observed (after the files are initially detected, once the plugin of the language is starting to run, it fails:
15:22:53.386 ERROR: Error during SonarScanner execution
java.lang.IllegalStateException: Cannot run program "/src/module/.scannerwork/.sonartmp/17249610217304622426/subprocess" (in directory "."): error=2, No such file or directory
        at com.sonar.cpp.analyzer.Subprocess.execute(
        at com.sonar.cpp.analyzer.Subprocess.execute(
        at com.sonar.cpp.plugin.CFamilySensor.lambda$process$8(
        at com.sonar.cpp.analyzer.AnalysisExecutor.lambda$submit$0(
        at java.base/java.util.concurrent.Executors$
        at java.base/
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(
        at java.base/java.util.concurrent.ThreadPoolExecutor$
        at java.base/
Caused by: Cannot run program "/src/module/.scannerwork/.sonartmp/17249610217304622426/subprocess" (in directory "."): error=2, No such file or directory
        at java.base/java.lang.ProcessBuilder.start(
        at java.base/java.lang.ProcessBuilder.start(
        at com.sonar.cpp.analyzer.Subprocess.execute(
        ... 8 more
Caused by: error=2, No such file or directory
        at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
        at java.base/java.lang.ProcessImpl.<init>(
        at java.base/java.lang.ProcessImpl.start(
        at java.base/java.lang.ProcessBuilder.start(
        ... 10 more
  • steps to reproduce:
    just run sonar-scanner on a C project built with build-wrapper

  • potential workaround

    1. use a debian/ubuntu based image
    2. download the scanner zip file
    3. set the JRE_PATH pointing at zip’s jre

the error message does not help to determine what exactly is missing.
But it seems the alpine image is either missing a java library OR a system tool is missing, but overall.

Hi @mvk ,

there is a warning on the github project and on the docker bup page about that:

Warning: These Docker images are not compatible with C/C++/Objective-C projects.

you need to natively run the scanner with build wrapper

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.