Below is the error message getting while running sonarqube scanner.
Error:
INFO: Project configuration:
INFO: 1 file indexed
INFO: 0 files ignored because of scm ignore settings
INFO: Quality profile for py: Sonar way
INFO: ------------- Run sensors on module Python-Project
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=57ms
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by net.sf.cglib.core.ReflectUtils$1 (file:/C:/Users/MaheshSathe/.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 Python Squid Sensor [python]
INFO: Load project repositories
INFO: Load project repositories (done) | time=7ms
INFO: Sensor Python Squid Sensor [python] (done) | time=179ms
INFO: Sensor Cobertura Sensor for Python coverage [python]
INFO: Sensor Cobertura Sensor for Python coverage [python] (done) | time=14ms
INFO: Sensor PythonXUnitSensor [python]
INFO: Sensor PythonXUnitSensor [python] (done) | time=1ms
INFO: Sensor JaCoCo XML Report Importer [jacoco]
INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=4ms
INFO: Sensor JavaXmlSensor [java]
INFO: Sensor JavaXmlSensor [java] (done) | time=2ms
INFO: Sensor HTML [web]
INFO: Sensor HTML [web] (done) | time=18ms
INFO: ------------- Run sensors on project
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=32ms
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: * script/mymodule1.py
WARN: This may lead to missing/broken features in SonarQube
INFO: 1 file had no CPD blocks
INFO: Calculating CPD for 0 files
INFO: CPD calculation finished
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Hi @mahesh_sathe ,
In the snippet you posted there isnât anything helping us understanding what is causing the execution failure.
Could you please provide the full log (by private message if it contains sensitive information)?
Moreover, please provide more information to reproduce the problem:
How did you launch the analysis? Are you using sonar-scanner with sonar-project.properties
?
SonarQube version and SonarPython version
Thanks for quick reply,
I have setup sonarqube and sonar scanner in project folder (C:\Users\MaheshSathe\Downloads\Project)
I have created mymodule.py file in C:\Users\MaheshSathe\Desktop\python\script ( File contain print (âHello worldâ)
In sonar-scanner.properties given below details
sonar.projectKey=Python-Project
sonar.projectName=Python-Project
sonar.projectVersion=1.0
sonar.projectBaseDir=C:/Users/MaheshSathe/Desktop/python
sonar.sources=script
When I ran below command it ended with error
C:\Users\MaheshSathe\Downloads\Project\sonar-scanner-cli-4.0.0.1744-windows\sonar-scanner-4.0.0.1744-windows\bin>sonar-scanner.bat
Error:
C:\Users\MaheshSathe\Downloads\Project\sonar-scanner-cli-4.0.0.1744-windows\sonar-scanner-4.0.0.1744-windows\bin>sonar-scanner.bat
INFO: Scanner configuration file: C:\Users\MaheshSathe\Downloads\Project\sonar-scanner-cli-4.0.0.1744-windows\sonar-scanner-4.0.0.1744-windows\binâŚ\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: Windows 10 10.0 amd64
INFO: User cache: C:\Users\MaheshSathe.sonar\cache
INFO: SonarQube server 7.9.1
INFO: Default locale: âen_INâ, source code encoding: âwindows-1252â (analysis is platform dependent)
INFO: Load global settings
INFO: Load global settings (done) | time=118ms
INFO: Server id: BF41A1F2-AWxSH2YLK2dbeu1Jog8G
INFO: User cache: C:\Users\MaheshSathe.sonar\cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=92ms
INFO: Load/download plugins (done) | time=177ms
INFO: Process project properties
INFO: Execute project builders
INFO: Execute project builders (done) | time=4ms
INFO: Project key: Python-Project
INFO: Base dir: C:\Users\MaheshSathe\Desktop\python
INFO: Working dir: C:\Users\MaheshSathe\Desktop\python.scannerwork
INFO: Load project settings for component key: âPython-Projectâ
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=141ms
INFO: Load active rules
INFO: Load active rules (done) | time=4279ms
INFO: Indexing filesâŚ
INFO: Project configuration:
INFO: 1 file indexed
INFO: 0 files ignored because of scm ignore settings
INFO: Quality profile for py: Sonar way
INFO: ------------- Run sensors on module Python-Project
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=57ms
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by net.sf.cglib.core.ReflectUtils$1 (file:/C:/Users/MaheshSathe/.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 Python Squid Sensor [python]
INFO: Load project repositories
INFO: Load project repositories (done) | time=7ms
INFO: Sensor Python Squid Sensor [python] (done) | time=179ms
INFO: Sensor Cobertura Sensor for Python coverage [python]
INFO: Sensor Cobertura Sensor for Python coverage [python] (done) | time=14ms
INFO: Sensor PythonXUnitSensor [python]
INFO: Sensor PythonXUnitSensor [python] (done) | time=1ms
INFO: Sensor JaCoCo XML Report Importer [jacoco]
INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=4ms
INFO: Sensor JavaXmlSensor [java]
INFO: Sensor JavaXmlSensor [java] (done) | time=2ms
INFO: Sensor HTML [web]
INFO: Sensor HTML [web] (done) | time=18ms
INFO: ------------- Run sensors on project
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=32ms
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: * script/mymodule1.py
WARN: This may lead to missing/broken features in SonarQube
INFO: 1 file had no CPD blocks
INFO: Calculating CPD for 0 files
INFO: CPD calculation finished
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 9.180s
INFO: Final Memory: 12M/44M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution
java.lang.NullPointerException
at org.sonarsource.scm.git.GitScmProviderBefore77.revisionId(GitScmProviderBefore77.java:173)
at org.sonar.scanner.scm.ScmRevisionImpl.get(ScmRevisionImpl.java:62)
at org.sonar.scanner.report.MetadataPublisher.addScmInformation(MetadataPublisher.java:153)
at org.sonar.scanner.report.MetadataPublisher.publish(MetadataPublisher.java:105)
at org.sonar.scanner.report.ReportPublisher.generateReportFile(ReportPublisher.java:152)
at org.sonar.scanner.report.ReportPublisher.execute(ReportPublisher.java:138)
at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:366)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:141)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:73)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)
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:185)
at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:137)
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)
ERROR:
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
C:\Users\MaheshSathe\Downloads\Project\sonar-scanner-cli-4.0.0.1744-windows\sonar-scanner-4.0.0.1744-windows\bin>
Version :Am using
sonar-scanner-4.0.0.1744-windows
Sonarqube7.9.1
python3.7
edu
(edu)
August 6, 2019, 7:48am
6
Could you add this line to your sonar-project.properties and rerun?
sonar.scm.disabled = True
It should allow you to run the analysis while avoiding what appears to be a git-related issue.
1 Like
I have added above mentioned in conf file
C:\Users\MaheshSathe\Downloads\Project\sonar-scanner-cli-4.0.0.1744-windows\sonar-scanner-4.0.0.1744-windows\conf
Scanner-Properties.conf
sonar.projectKey=Python-Project
sonar.projectName=Python-Project
sonar.projectVersion=1.0
sonar.projectBaseDir=C:/Users/MaheshSathe/Desktop/python
sonar.sources=script
sonar.scm.disabled = True
I have run below command
Output : Is below output is suucess ?
C:\Users\MaheshSathe\Downloads\Project\sonar-scanner-cli-4.0.0.1744-windows\sonar-scanner-4.0.0.1744-windows\bin>sonar-scanner.bat
INFO: Scanner configuration file: C:\Users\MaheshSathe\Downloads\Project\sonar-scanner-cli-4.0.0.1744-windows\sonar-scanner-4.0.0.1744-windows\binâŚ\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: Windows 10 10.0 amd64
INFO: User cache: C:\Users\MaheshSathe.sonar\cache
INFO: SonarQube server 7.9.1
INFO: Default locale: âen_INâ, source code encoding: âwindows-1252â (analysis is platform dependent)
INFO: Load global settings
INFO: Load global settings (done) | time=267ms
INFO: Server id: BF41A1F2-AWxSH2YLK2dbeu1Jog8G
INFO: User cache: C:\Users\MaheshSathe.sonar\cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=91ms
INFO: Load/download plugins (done) | time=1065ms
INFO: Process project properties
INFO: Execute project builders
INFO: Execute project builders (done) | time=4ms
INFO: Project key: Python-Project
INFO: Base dir: C:\Users\MaheshSathe\Desktop\python
INFO: Working dir: C:\Users\MaheshSathe\Desktop\python.scannerwork
INFO: Load project settings for component key: âPython-Projectâ
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=177ms
INFO: Load active rules
INFO: Load active rules (done) | time=5118ms
INFO: Indexing filesâŚ
INFO: Project configuration:
INFO: 1 file indexed
INFO: Quality profile for py: Sonar way
INFO: ------------- Run sensors on module Python-Project
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=68ms
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by net.sf.cglib.core.ReflectUtils$1 (file:/C:/Users/MaheshSathe/.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 Python Squid Sensor [python]
INFO: Load project repositories
INFO: Load project repositories (done) | time=6ms
INFO: Sensor Python Squid Sensor [python] (done) | time=334ms
INFO: Sensor Cobertura Sensor for Python coverage [python]
INFO: Sensor Cobertura Sensor for Python coverage [python] (done) | time=8ms
INFO: Sensor PythonXUnitSensor [python]
INFO: Sensor PythonXUnitSensor [python] (done) | time=3ms
INFO: Sensor JaCoCo XML Report Importer [jacoco]
INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=3ms
INFO: Sensor JavaXmlSensor [java]
INFO: Sensor JavaXmlSensor [java] (done) | time=7ms
INFO: Sensor HTML [web]
INFO: Sensor HTML [web] (done) | time=16ms
INFO: ------------- Run sensors on project
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=32ms
INFO: SCM Publisher is disabled
INFO: 1 file had no CPD blocks
INFO: Calculating CPD for 0 files
INFO: CPD calculation finished
INFO: Analysis report generated in 118ms, dir size=72 KB
INFO: Analysis report compressed in 23ms, zip size=10 KB
INFO: Analysis report uploaded in 1743ms
INFO: ANALYSIS SUCCESSFUL, you can browse http://localhost:9000/dashboard?id=Python-Project
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 http://localhost:9000/api/ce/task?id=AWxmTg44Q0YN2noBsaoc
INFO: Analysis total time: 10.890 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 15.886s
INFO: Final Memory: 6M/27M
INFO: ------------------------------------------------------------------------
Thanks Andrea, I did confirm sonarqube my file is successfully verified.
Really appreciate for your help.Thanks