Sonar scanner failure post sonar upgrade error : 0 C/C++/Objective-C files were analyzed

Make sure to tell us:

  • What version are you upgrading from?
    Sonar 7.7 to sonar9.9 LTS
  • System information (Operating system, Java version, Database provider/version)
    Ubantu 20.0 , java17 and Postgres
  • What’s the issue you’re facing?
    INFO: Total time: 8.741s
    INFO: Final Memory: 54M/320M
    INFO: ------------------------------------------------------------------------
    ERROR: Error during SonarScanner execution
    java.lang.IllegalStateException: The “build-wrapper-dump.json” file was found but 0 C/C++/Objective-C files were analyzed. Please make sure that:
    • you are using the latest version of the build-wrapper and the CFamily analyzer
    • you are correctly invoking the scanner with correct configuration
    • your compiler is supported
    • you are wrapping your build correctly
    • you are wrapping a full/clean build
    • you are providing the path to the correct build-wrapper output directory

same is working in sonar7.7 but fails in the upgraded sonar9.9 LTS

build-wrapper-dump.json (45.0 KB)
build-wrapper.log (105.6 KB)
ddc-test-sonarscan.txt (17.3 KB)
sonar-scanner.txt (45.8 KB)
adding log for reference

Hi @Prakhyath,

looking at your files it seems that there is no match between the compiled files and the sonar-scanner indexed files.

Looking at the build-wrapper-dump.json these two files are compiled:

/home/prakhyatha/OmC/CI_64/build_dir/target-x86_64_glibc/ddc/main.c
/home/prakhyatha/OmC/CI_64/build_dir/target-x86_64_glibc/ddc/ddc.c

and looking at the sonar-scanner.txt those two files don’t appear in the indexed files:

13:51:11.220 INFO: Indexing files...
13:51:11.221 INFO: Project configuration:
13:51:11.221 INFO:   Excluded sources: ut/**
13:51:11.230 DEBUG: 'coverage/ddc.h' indexed with language 'c'
13:51:11.236 DEBUG: 'coverage/ddc.gcda' indexed with no language
13:51:11.237 DEBUG: 'coverage/ddc.gcno' indexed with no language
13:51:11.238 DEBUG: 'coverage/main.o' indexed with no language
13:51:11.239 DEBUG: 'coverage/main.c' indexed with language 'c'
13:51:11.240 DEBUG: 'coverage/ddc.o' indexed with no language
13:51:11.241 DEBUG: 'coverage/main.gcno' indexed with no language
13:51:11.242 DEBUG: 'coverage/ddc.c' indexed with language 'c'
13:51:11.244 DEBUG: 'ut/ddc.c.gcov' indexed as test with no language
13:51:11.244 DEBUG: 'ut/ddc.gcda' indexed as test with no language
13:51:11.245 DEBUG: 'ut/ddc_test' indexed as test with no language
13:51:11.245 DEBUG: 'ut/ddc.gcno' indexed as test with no language
13:51:11.246 DEBUG: 'ut/main.gcno' indexed as test with no language
13:51:11.246 DEBUG: 'ut/Makefile' indexed as test with no language
13:51:11.247 DEBUG: 'ut/ddc_test.c' indexed as test with language 'c'
13:51:11.248 DEBUG: 'ut/unit_test/ddc.gcda' indexed as test with no language
13:51:11.248 DEBUG: 'ut/unit_test/ddc.gcno' indexed as test with no language
13:51:11.249 DEBUG: 'ut/unit_test/ddc.tap' indexed as test with no language
13:51:11.249 DEBUG: 'ut/unit_test/main.gcno' indexed as test with no language
13:51:11.250 DEBUG: 'ut/unit_test/ddc.xml' indexed as test with language 'xml'
13:51:11.250 DEBUG: 'ut/main.c.gcov' indexed as test with no language

I would recommend you check the following things:

  • make sure that you are running a clean build, the build-wrapper needs to observe all files compilation
  • the sonar.sources property is correctly set to what you want to analyze

Hi Thanks for pointing out yes we were pointing sonar.source=coverage after change in make file to point source code to coverage I am able to get a successfull scan

Hi @Prakhyath ,

thank you for your notification. Are you facing any other issues?