Sonar scanner throws warnings and error since last week!

I have updated sonar-scanner to version 4.0. I analyze C++ code on Linux. I have tried anything that I could online but to no avail.

Really appreciate some help!!

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by net.sf.cglib.core.ReflectUtils$1 (file:…/.sonar/cache/866bb1adbf016ea515620f1aaa15ec53/sonar-javascript-plugin.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte,int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of net.sf.cglib.core.ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

ERROR: Analysis didn’t terminate normally, please verify ERROR and WARN logs above. Exit code 1

Hi @Mana_Mhb,

could you please share the entire log output?

I had to add this line (it was working fine without it before) sonar.lang.patterns.c = -. so sonarqube can distinguish between C and C++ files.
Now I get execution success from sonar-scanner. But get an error that analysis didn’t terminate normally.

And here is the log:
INFO: Scanner configuration file: /home/user/Desktop/Related_files/SONAR/sonar-scanner-cli-4.0.0.1744-linux/sonar-scanner-4.0.0.1744-linux/conf/sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: SonarQube Scanner 4.0.0.1744
INFO: Java 11.0.3 AdoptOpenJDK (64-bit)
INFO: Linux 4.15.0-52-generic amd64
INFO: User cache: /home/user/.sonar/cache
INFO: SonarQube server 7.7.0
INFO: Default locale: “en_US”, source code encoding: “UTF-8”
INFO: Load global settings
INFO: Load global settings (done) | time=164ms
INFO: Server id: 4F833BF3-AWl2Ra10eXOdzOB7Zz32
INFO: User cache: /home/user/.sonar/cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=99ms
INFO: Load/download plugins (done) | time=135ms
INFO: Loaded core extensions: developer-scanner
INFO: Process project properties
INFO: Execute project builders
INFO: Execute project builders (done) | time=3ms
INFO: Project key: ***
INFO: Base dir: /home/user/sonar/algobox
INFO: Working dir: /home/user/sonar/algobox/.scannerwork
INFO: Load project settings for component key: '
INFO: Load project settings for component key: '’ (done) | time=63ms
INFO: Load project branches
INFO: Load project branches (done) | time=62ms
INFO: Load project pull requests
INFO: Load project pull requests (done) | time=58ms
INFO: Load branch configuration
INFO: Load branch configuration (done) | time=4ms
INFO: Load project repositories
INFO: Load project repositories (done) | time=242ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=92ms
INFO: Load active rules
INFO: Load active rules (done) | time=2087ms
INFO: Indexing files…
INFO: Project configuration:
INFO: Excluded sources: Thirparty/
/
, Debug/Thirdparty/
/

INFO: 4021 files indexed
INFO: 0 files ignored because of inclusion/exclusion patterns
INFO: 0 files ignored because of scm ignore settings
INFO: Quality profile for c++: PVS-Studio Way
INFO: Quality profile for css: Sonar way
INFO: Quality profile for php: Sonar way
INFO: Quality profile for py: Sonar way
INFO: Quality profile for xml: Sonar way
INFO: ------------- Run sensors on module ***
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=69ms
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by net.sf.cglib.core.ReflectUtils$1 (file:/home/user/.sonar/cache/866bb1adbf016ea515620f1aaa15ec53/sonar-javascript-plugin.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte,int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of net.sf.cglib.core.ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
INFO: Sensor SonarCSS Metrics [cssfamily]
INFO: Sensor SonarCSS Metrics [cssfamily] (done) | time=90ms
INFO: Sensor SonarCSS Rules [cssfamily]
ERROR: Analysis didn’t terminate normally, please verify ERROR and WARN logs above. Exit code 1
INFO: Sensor SonarCSS Rules [cssfamily] (done) | time=1546ms
INFO: Sensor JavaXmlSensor [java]
INFO: 2 source files to be analyzed
INFO: Sensor JavaXmlSensor [java] (done) | time=260ms
INFO: Sensor HTML [web]
INFO: 2/2 source files have been analyzed
INFO: Sensor HTML [web] (done) | time=32ms
INFO: Sensor XML Sensor [xml]
INFO: 2 source files to be analyzed
INFO: Sensor XML Sensor [xml] (done) | time=134ms
INFO: Sensor C++ (Community) SquidSensor [cxx]
INFO: 2/2 source files have been analyzed
WARN: Metric ‘comment_lines_data’ is deprecated. Provided value is ignored.
INFO: Sensor C++ (Community) SquidSensor [cxx] (done) | time=153740ms
INFO: Sensor Python Squid Sensor [python]
INFO: Sensor Python Squid Sensor [python] (done) | time=3402ms
INFO: Sensor Cobertura Sensor for Python coverage [python]
INFO: Sensor Cobertura Sensor for Python coverage [python] (done) | time=8030ms
INFO: Sensor PythonXUnitSensor [python]
INFO: Sensor PythonXUnitSensor [python] (done) | time=8053ms
INFO: Sensor JaCoCo XML Report Importer [jacoco]
INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=10ms
INFO: Sensor PHP sensor [php]
INFO: 5 source files to be analyzed
INFO: 5/5 source files have been analyzed
INFO: No PHPUnit test report provided (see ‘sonar.php.tests.reportPath’ property)
INFO: No PHPUnit coverage reports provided (see ‘sonar.php.coverage.reportPaths’ property)
INFO: Sensor PHP sensor [php] (done) | time=192ms
INFO: Sensor Analyzer for “php.ini” files [php]
INFO: Sensor Analyzer for “php.ini” files [php] (done) | time=10ms
INFO: Sensor PVS-Studio Issues Loader Sensor [pvsstudio]
WARN: Path to PVS-Studio report wasn’t specified, use the following key: ‘sonar.pvs-studio.reportPath’
INFO: Sensor PVS-Studio Issues Loader Sensor [pvsstudio] (done) | time=0ms
INFO: ------------- Run sensors on project
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=113ms
INFO: SCM provider for this project is: git
INFO: 1 files to be analyzed
INFO: 0/1 files analyzed
WARN: Missing blame information for the following files:
WARN: * PVS-Studio.xml
WARN: This may lead to missing/broken features in SonarQube
INFO: 877 files had no CPD blocks
INFO: Calculating CPD for 1937 files
INFO: CPD calculation finished
INFO: Analysis report generated in 909ms, dir size=306 MB
INFO: Analysis report compressed in 15729ms, zip size=54 MB
INFO: Analysis report uploaded in 10079ms
INFO: ANALYSIS SUCCESSFUL, you can browse https://tt-sonarqube.tobii.intra/dashboard?id=***
INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
INFO: More about the report processing at https://tt-sonarqube.tobii.intra/api/ce/task?id=AWv066dwsa5V9vI0QxWN
INFO: Executing post-job ‘Final report’
WARN: Preprocessor: 20463 include directive error(s). This is only relevant if parser creates syntax errors. The preprocessor searches for include files in the with ‘sonar.cxx.includeDirectories’ defined directories and order.
WARN: Source code parser: 3226 syntax error(s) detected. Syntax errors could cause invalid software metric values. Root cause are typically missing includes, missing macros or compiler specific extensions.
INFO: Turn debug info on to get more details (sonar-scanner -X -Dsonar.verbose=true …).
INFO: Executing post-job ‘Final report’
INFO: Turn debug info on to get more details (sonar-scanner -X -Dsonar.verbose=true …).
INFO: Analysis total time: 3:29.715 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 3:30.736s
INFO: Final Memory: 15M/67M
INFO: ------------------------------------------------------------------------

Hi @Mana_Mhb,

you are not using SonarSource C/C++ analyzer, you are using the sonar-cxx plugin which we don’t support, please use their support channel.

Just as a reminder, if you are working on open-source, the C/C++ analysis is free on SonarCloud.

Its probably not really important, which plugin is used, as we can see from this answer: Java issue- WARNING: An illegal reflective access operation has occurred ?