Rule `python:ParsingError` not working

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    • 9.9.6
  • how is SonarQube deployed: zip, Docker, Helm
    • Docker
  • what are you trying to achieve
    • make python parsing errors into sonar errors
  • what have you tried so far to achieve this
    • create a new quality profile based off default python Sonar Way
    • add the python:ParsingError rule
    • attach the quality profile to the project
    • run the scanner during CI
    • should fail, doesn’t.

The below logs should show:

  • the scanner is using the configured profile (line 65)
  • the scanner fails two parses (lines 106, 159)
  • the scanner waits for quality gate result, which incorrectly passes (line 318)

Any help appreciated, perhaps I’m doing something dumb ^^.

configured profile

scan logs

[11:35:59]W: Step 1/3: Sonar PR (Command Line) (33s)
[11:35:59]i:	 [Step 1/3] Build step condition "teamcity.pullRequest.number exists" is satisfied
[11:35:59]i:	 [Step 1/3] Content of /home/debian/teamcity/temp/agentTmp/custom_script16647883639938261135 file: 
            	 sonar-scanner \
            	   -Dsonar.projectKey=myproject \
            	   -Dsonar.sources=. \
            	   -Dsonar.host.url=https://sonar.mycompany.com \
            	   -Dsonar.pullrequest.key=22 \
            	   -Dsonar.pullrequest.branch=sonar-2 \
            	   -Dsonar.pullrequest.base=main \
            	   -Dsonar.scm.provider=git \
            	   -Dsonar.qualitygate.wait=true \
            	   -Dsonar.python.version=3.12
            	 
[11:35:59] :	 [Step 1/3] Starting: /home/debian/teamcity/temp/agentTmp/custom_script16647883639938261135 
[11:35:59] :	 [Step 1/3] in directory: /home/debian/teamcity/work/76ae89bc09b975fd
[11:36:00] :	 [Step 1/3] 12:36:00.231 INFO  Scanner configuration file: /opt/sonar-scanner/conf/sonar-scanner.properties
[11:36:00] :	 [Step 1/3] 12:36:00.236 INFO  Project root configuration file: NONE
[11:36:00] :	 [Step 1/3] 12:36:00.256 INFO  SonarScanner CLI 6.1.0.4477
[11:36:00] :	 [Step 1/3] 12:36:00.258 INFO  Java 21.0.4 Eclipse Adoptium (64-bit)
[11:36:00] :	 [Step 1/3] 12:36:00.262 INFO  Linux 6.1.0-23-amd64 amd64
[11:36:00] :	 [Step 1/3] 12:36:00.304 INFO  User cache: /root/.sonar/cache
[11:36:01] :	 [Step 1/3] 12:36:01.220 INFO  Communicating with SonarQube Server 9.9.6.92038
[11:36:01] :	 [Step 1/3] 12:36:01.756 INFO  Load global settings
[11:36:01] :	 [Step 1/3] 12:36:01.922 INFO  Load global settings (done) | time=168ms
[11:36:01] :	 [Step 1/3] 12:36:01.926 INFO  Server id: E43A3283-AWQiwt3WyXJIGvkmbZ4L
[11:36:01] :	 [Step 1/3] 12:36:01.932 INFO  User cache: /root/.sonar/cache
[11:36:01] :	 [Step 1/3] 12:36:01.937 INFO  Load/download plugins
[11:36:01] :	 [Step 1/3] 12:36:01.937 INFO  Load plugins index
[11:36:02] :	 [Step 1/3] 12:36:02.001 INFO  Load plugins index (done) | time=64ms
[11:36:02] :	 [Step 1/3] 12:36:02.155 INFO  Load/download plugins (done) | time=218ms
[11:36:02] :	 [Step 1/3] 12:36:02.338 INFO  Loaded core extensions: developer-scanner
[11:36:02] :	 [Step 1/3] 12:36:02.854 INFO  Process project properties
[11:36:02] :	 [Step 1/3] 12:36:02.863 INFO  Process project properties (done) | time=9ms
[11:36:02] :	 [Step 1/3] 12:36:02.867 INFO  Execute project builders
[11:36:02] :	 [Step 1/3] 12:36:02.868 INFO  Execute project builders (done) | time=1ms
[11:36:02] :	 [Step 1/3] 12:36:02.871 INFO  Project key: myproject
[11:36:02] :	 [Step 1/3] 12:36:02.871 INFO  Base dir: /home/debian/teamcity/work/76ae89bc09b975fd
[11:36:02] :	 [Step 1/3] 12:36:02.871 INFO  Working dir: /home/debian/teamcity/work/76ae89bc09b975fd/.scannerwork
[11:36:02] :	 [Step 1/3] 12:36:02.883 INFO  Load project settings for component key: 'myproject'
[11:36:02] :	 [Step 1/3] 12:36:02.925 INFO  Load project settings for component key: 'myproject' (done) | time=42ms
[11:36:03] :	 [Step 1/3] 12:36:03.034 INFO  Load project branches
[11:36:03] :	 [Step 1/3] 12:36:03.087 INFO  Load project branches (done) | time=53ms
[11:36:03] :	 [Step 1/3] 12:36:03.090 INFO  Load branch configuration
[11:36:03] :	 [Step 1/3] 12:36:03.091 INFO  Found manual configuration of branch/PR analysis. Skipping automatic configuration.
[11:36:03] :	 [Step 1/3] 12:36:03.094 INFO  Load branch configuration (done) | time=4ms
[11:36:03] :	 [Step 1/3] 12:36:03.166 INFO  Load quality profiles
[11:36:03] :	 [Step 1/3] 12:36:03.234 INFO  Load quality profiles (done) | time=68ms
[11:36:03] :	 [Step 1/3] 12:36:03.249 INFO  Load active rules
[11:36:06] :	 [Step 1/3] 12:36:06.938 INFO  Load active rules (done) | time=3689ms
[11:36:06] :	 [Step 1/3] 12:36:06.944 INFO  Load analysis cache
[11:36:06] :	 [Step 1/3] 12:36:06.972 INFO  Load analysis cache | time=28ms
[11:36:07] :	 [Step 1/3] 12:36:07.023 INFO  Pull request 22 for merge into main from sonar-2
[11:36:07] :	 [Step 1/3] 12:36:07.038 INFO  Load project repositories
[11:36:07] :	 [Step 1/3] 12:36:07.070 INFO  Load project repositories (done) | time=32ms
[11:36:07] :	 [Step 1/3] 12:36:07.072 INFO  SCM collecting changed files in the branch
[11:36:07] :	 [Step 1/3] 12:36:07.218 INFO  Merge base sha1: 8e592bb9fc0ad65e08e8862b94458713c3efd242
[11:36:07] :	 [Step 1/3] 12:36:07.245 INFO  SCM collecting changed files in the branch (done) | time=173ms
[11:36:07] :	 [Step 1/3] 12:36:07.283 INFO  Indexing files...
[11:36:07] :	 [Step 1/3] 12:36:07.284 INFO  Project configuration:
[11:36:07] :	 [Step 1/3] 12:36:07.369 INFO  30 files indexed
[11:36:07] :	 [Step 1/3] 12:36:07.370 INFO  0 files ignored because of scm ignore settings
[11:36:07] :	 [Step 1/3] 12:36:07.371 INFO  Quality profile for css: Sonar way
[11:36:07] :	 [Step 1/3] 12:36:07.371 INFO  Quality profile for plsql: Sonar way
[11:36:07] :	 [Step 1/3] 12:36:07.371 INFO  Quality profile for py: Sonar way - parse as error
[11:36:07] :	 [Step 1/3] 12:36:07.371 INFO  ------------- Run sensors on module myproject
[11:36:07] :	 [Step 1/3] 12:36:07.526 INFO  Load metrics repository
[11:36:07] :	 [Step 1/3] 12:36:07.559 INFO  Load metrics repository (done) | time=33ms
[11:36:10] :	 [Step 1/3] 12:36:10.235 INFO  Sensor PL/SQL Sensor [plsql]
[11:36:10] :	 [Step 1/3] 12:36:10.236 INFO  Sensor PL/SQL Sensor is restricted to changed files only
[11:36:10] :	 [Step 1/3] 12:36:10.279 WARN  The Data Dictionary is not configured for the PLSQL analyzer, which prevents rule(s) S3641, S3921, S3618, S3651 from raising issues. See https://docs.sonarqube.org/latest/analysis/languages/plsql/
[11:36:10] :	 [Step 1/3] 12:36:10.297 INFO  0 source files to be analyzed
[11:36:10] :	 [Step 1/3] 12:36:10.297 INFO  0/0 source files have been analyzed
[11:36:10] :	 [Step 1/3] 12:36:10.297 INFO  Sensor PL/SQL Sensor [plsql] (done) | time=62ms
[11:36:10] :	 [Step 1/3] 12:36:10.298 INFO  Sensor C# Project Type Information [csharp]
[11:36:10] :	 [Step 1/3] 12:36:10.298 INFO  Sensor C# Project Type Information [csharp] (done) | time=0ms
[11:36:10] :	 [Step 1/3] 12:36:10.298 INFO  Sensor C# Analysis Log [csharp]
[11:36:10] :	 [Step 1/3] 12:36:10.311 INFO  Sensor C# Analysis Log [csharp] (done) | time=13ms
[11:36:10] :	 [Step 1/3] 12:36:10.311 INFO  Sensor C# Properties [csharp]
[11:36:10] :	 [Step 1/3] 12:36:10.311 INFO  Sensor C# Properties [csharp] (done) | time=0ms
[11:36:10] :	 [Step 1/3] 12:36:10.312 INFO  Sensor HTML [web]
[11:36:10] :	 [Step 1/3] 12:36:10.312 INFO  Sensor HTML is restricted to changed files only
[11:36:10] :	 [Step 1/3] 12:36:10.314 INFO  Sensor HTML [web] (done) | time=2ms
[11:36:10] :	 [Step 1/3] 12:36:10.314 INFO  Sensor TextAndSecretsSensor [text]
[11:36:10] :	 [Step 1/3] 12:36:10.315 INFO  Sensor TextAndSecretsSensor is restricted to changed files only
[11:36:10] :	 [Step 1/3] 12:36:10.345 INFO  1 source file to be analyzed
[11:36:10] :	 [Step 1/3] 12:36:10.353 INFO  1/1 source file has been analyzed
[11:36:10] :	 [Step 1/3] 12:36:10.354 INFO  Sensor TextAndSecretsSensor [text] (done) | time=40ms
[11:36:10] :	 [Step 1/3] 12:36:10.354 INFO  Sensor VB.NET Project Type Information [vbnet]
[11:36:10] :	 [Step 1/3] 12:36:10.354 INFO  Sensor VB.NET Project Type Information [vbnet] (done) | time=0ms
[11:36:10] :	 [Step 1/3] 12:36:10.355 INFO  Sensor VB.NET Analysis Log [vbnet]
[11:36:10] :	 [Step 1/3] 12:36:10.367 INFO  Sensor VB.NET Analysis Log [vbnet] (done) | time=12ms
[11:36:10] :	 [Step 1/3] 12:36:10.367 INFO  Sensor VB.NET Properties [vbnet]
[11:36:10] :	 [Step 1/3] 12:36:10.368 INFO  Sensor VB.NET Properties [vbnet] (done) | time=1ms
[11:36:10] :	 [Step 1/3] 12:36:10.368 INFO  Sensor Python Sensor [python]
[11:36:10] :	 [Step 1/3] 12:36:10.372 WARN  No explicit support for version 3.12. Python version has been set to 3.10.
[11:36:10] :	 [Step 1/3] 12:36:10.569 INFO  Using cached data to retrieve global symbols.
[11:36:10] :	 [Step 1/3] 12:36:10.596 INFO  Cached information of global symbols will be used for 5 out of 7 main files. Global symbols will be recomputed for the remaining files.
[11:36:10] :	 [Step 1/3] 12:36:10.596 INFO  Fully optimized analysis can be performed for 5 out of 7 files.
[11:36:10] :	 [Step 1/3] 12:36:10.596 INFO  Partially optimized analysis can be performed for 5 out of 7 files.
[11:36:10] :	 [Step 1/3] 12:36:10.597 INFO  Starting global symbols computation
[11:36:10] :	 [Step 1/3] 12:36:10.599 INFO  2 source files to be analyzed
[11:36:10] :	 [Step 1/3] 12:36:10.641 INFO  2/2 source files have been analyzed
[11:36:10] :	 [Step 1/3] 12:36:10.641 INFO  Starting rules execution
[11:36:10] :	 [Step 1/3] 12:36:10.651 INFO  7 source files to be analyzed
[11:36:11]W:	 [Step 1/3] 12:36:11.107 ERROR Unable to parse file: test/insert_dummy_data.py
[11:36:11]W:	 [Step 1/3] 12:36:11.107 ERROR Parse error at line 40 column 87:
[11:36:11]W:	 [Step 1/3] 
[11:36:11]W:	 [Step 1/3]    35: "config.toml"
[11:36:11]W:	 [Step 1/3]    36:         )
[11:36:11]W:	 [Step 1/3]    37:         with open(cpath, "rb") as f:
[11:36:11]W:	 [Step 1/3]    38:             config = tomllib.load(f)
[11:36:11]W:	 [Step 1/3]    39:         go = input(
[11:36:11]W:	 [Step 1/3]   -->              f"Warning: This will truncate all devices in the table defined by {config["DB"]["SCHEMA"]}."
[11:36:11]W:	 [Step 1/3]    41:             " Do not run in production!"
[11:36:11]W:	 [Step 1/3]    42:             " Proceed? (y/n) "
[11:36:11]W:	 [Step 1/3]    43:         )
[11:36:11]W:	 [Step 1/3]    44:         if go.lower() != "y":
[11:36:11]W:	 [Step 1/3]    45:             sys.exit(1)
[11:36:11]W:	 [Step 1/3]    46:         random.seed
[11:36:11]W:	 [Step 1/3] 
[11:36:11] :	 [Step 1/3] 12:36:11.120 WARN  Unable to analyze file: test/insert_dummy_data.py
[11:36:11] :	 [Step 1/3] java.lang.NullPointerException: Cannot invoke "org.sonar.plugins.python.api.tree.FileInput.statements()" because "fileInput" is null
[11:36:11] :	 [Step 1/3] 	at org.sonar.plugins.python.api.tree.BaseTreeVisitor.visitFileInput(BaseTreeVisitor.java:47)
[11:36:11] :	 [Step 1/3] 	at com.sonarsource.dbd.frontend.python.A.scanFile(na:2827)
[11:36:11] :	 [Step 1/3] 	at com.sonarsource.dbd.frontend.python.rules.A.scanFile(na:615)
[11:36:11] :	 [Step 1/3] 	at org.sonar.plugins.python.PythonScanner.scanFile(PythonScanner.java:135)
[11:36:11] :	 [Step 1/3] 	at org.sonar.plugins.python.Scanner.execute(Scanner.java:59)
[11:36:11] :	 [Step 1/3] 	at org.sonar.plugins.python.PythonSensor.execute(PythonSensor.java:117)
[11:36:11] :	 [Step 1/3] 	at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:64)
[11:36:11] :	 [Step 1/3] 	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:88)
[11:36:11] :	 [Step 1/3] 	at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:61)
[11:36:11] :	 [Step 1/3] 	at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:79)
[11:36:11] :	 [Step 1/3] 	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:61)
[11:36:11] :	 [Step 1/3] 	at org.sonar.scanner.scan.SpringModuleScanContainer.doAfterStart(SpringModuleScanContainer.java:82)
[11:36:11] :	 [Step 1/3] 	at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
[11:36:11] :	 [Step 1/3] 	at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
[11:36:11] :	 [Step 1/3] 	at org.sonar.scanner.scan.SpringProjectScanContainer.scan(SpringProjectScanContainer.java:403)
[11:36:11] :	 [Step 1/3] 	at org.sonar.scanner.scan.SpringProjectScanContainer.scanRecursively(SpringProjectScanContainer.java:399)
[11:36:11] :	 [Step 1/3] 	at org.sonar.scanner.scan.SpringProjectScanContainer.doAfterStart(SpringProjectScanContainer.java:368)
[11:36:11] :	 [Step 1/3] 	at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
[11:36:11] :	 [Step 1/3] 	at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
[11:36:11] :	 [Step 1/3] 	at org.sonar.scanner.bootstrap.SpringGlobalContainer.doAfterStart(SpringGlobalContainer.java:137)
[11:36:11] :	 [Step 1/3] 	at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
[11:36:11] :	 [Step 1/3] 	at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
[11:36:11] :	 [Step 1/3] 	at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72)
[11:36:11] :	 [Step 1/3] 	at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:66)
[11:36:11] :	 [Step 1/3] 	at org.sonarsource.scanner.lib.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:41)
[11:36:11] :	 [Step 1/3] 	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
[11:36:11] :	 [Step 1/3] 	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
[11:36:11] :	 [Step 1/3] 	at org.sonarsource.scanner.lib.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:62)
[11:36:11] :	 [Step 1/3] 	at jdk.proxy3/jdk.proxy3.$Proxy2.execute(Unknown Source)
[11:36:11] :	 [Step 1/3] 	at org.sonarsource.scanner.lib.InProcessScannerEngineFacade.doAnalyze(InProcessScannerEngineFacade.java:39)
[11:36:11] :	 [Step 1/3] 	at org.sonarsource.scanner.lib.ScannerEngineFacade.analyze(ScannerEngineFacade.java:61)
[11:36:11] :	 [Step 1/3] 	at org.sonarsource.scanner.cli.Main.analyze(Main.java:77)
[11:36:11] :	 [Step 1/3] 	at org.sonarsource.scanner.cli.Main.main(Main.java:63)
[11:36:11] :	 [Step 1/3] 
[11:36:11] :	 [Step 1/3] 12:36:11.130 WARN  Unable to analyze file: src/app.py
[11:36:11]W:	 [Step 1/3] 12:36:11.130 ERROR Unable to parse file: src/app.py
[11:36:11] :	 [Step 1/3] java.lang.NullPointerException: Cannot invoke "org.sonar.plugins.python.api.tree.FileInput.statements()" because "fileInput" is null
[11:36:11]W:	 [Step 1/3] 12:36:11.130 ERROR Parse error at line 35 column 4:
[11:36:11] :	 [Step 1/3] 	at org.sonar.plugins.python.api.tree.BaseTreeVisitor.visitFileInput(BaseTreeVisitor.java:47)
[11:36:11]W:	 [Step 1/3] 
[11:36:11] :	 [Step 1/3] 	at com.sonarsource.dbd.frontend.python.A.scanFile(na:2827)
[11:36:11]W:	 [Step 1/3]    32: "KEYVAULT"], app.config["AUTH"]["CLIENT_ID"])
[11:36:11] :	 [Step 1/3] 	at com.sonarsource.dbd.frontend.python.rules.A.scanFile(na:615)
[11:36:11]W:	 [Step 1/3]    33: crypto = crypto.Crypto(app.config["CRYPTO"])
[11:36:11]W:	 [Step 1/3]    34: 
[11:36:11] :	 [Step 1/3] 	at org.sonar.plugins.python.PythonScanner.scanFile(PythonScanner.java:135)
[11:36:11]W:	 [Step 1/3]   -->  a = 
[11:36:11] :	 [Step 1/3] 	at org.sonar.plugins.python.Scanner.execute(Scanner.java:59)
[11:36:11]W:	 [Step 1/3]    36: 
[11:36:11] :	 [Step 1/3] 	at org.sonar.plugins.python.PythonSensor.execute(PythonSensor.java:117)
[11:36:11]W:	 [Step 1/3]    37: @app.errorhandler(Exception)
[11:36:11] :	 [Step 1/3] 	at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:64)
[11:36:11]W:	 [Step 1/3]    38: def handle_exception(e: Exception):
[11:36:11] :	 [Step 1/3] 	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:88)
[11:36:11]W:	 [Step 1/3]    39: 
[11:36:11] :	 [Step 1/3] 	at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:61)
[11:36:11]W:	 [Step 1/3]    40:     if not app.debug:
[11:36:11] :	 [Step 1/3] 	at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:79)
[11:36:11]W:	 [Step 1/3]    41:         mail.to_admin
[11:36:11]W:	 [Step 1/3] 
[11:36:11] :	 [Step 1/3] 	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:61)
[11:36:11] :	 [Step 1/3] 	at org.sonar.scanner.scan.SpringModuleScanContainer.doAfterStart(SpringModuleScanContainer.java:82)
[11:36:11] :	 [Step 1/3] 	at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
[11:36:11] :	 [Step 1/3] 	at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
[11:36:11] :	 [Step 1/3] 	at org.sonar.scanner.scan.SpringProjectScanContainer.scan(SpringProjectScanContainer.java:403)
[11:36:11] :	 [Step 1/3] 	at org.sonar.scanner.scan.SpringProjectScanContainer.scanRecursively(SpringProjectScanContainer.java:399)
[11:36:11] :	 [Step 1/3] 	at org.sonar.scanner.scan.SpringProjectScanContainer.doAfterStart(SpringProjectScanContainer.java:368)
[11:36:11] :	 [Step 1/3] 	at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
[11:36:11] :	 [Step 1/3] 	at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
[11:36:11] :	 [Step 1/3] 	at org.sonar.scanner.bootstrap.SpringGlobalContainer.doAfterStart(SpringGlobalContainer.java:137)
[11:36:11] :	 [Step 1/3] 	at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
[11:36:11] :	 [Step 1/3] 	at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
[11:36:11] :	 [Step 1/3] 	at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72)
[11:36:11] :	 [Step 1/3] 	at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:66)
[11:36:11] :	 [Step 1/3] 	at org.sonarsource.scanner.lib.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:41)
[11:36:11] :	 [Step 1/3] 	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
[11:36:11] :	 [Step 1/3] 	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
[11:36:11] :	 [Step 1/3] 	at org.sonarsource.scanner.lib.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:62)
[11:36:11] :	 [Step 1/3] 	at jdk.proxy3/jdk.proxy3.$Proxy2.execute(Unknown Source)
[11:36:11] :	 [Step 1/3] 	at org.sonarsource.scanner.lib.InProcessScannerEngineFacade.doAnalyze(InProcessScannerEngineFacade.java:39)
[11:36:11] :	 [Step 1/3] 	at org.sonarsource.scanner.lib.ScannerEngineFacade.analyze(ScannerEngineFacade.java:61)
[11:36:11] :	 [Step 1/3] 	at org.sonarsource.scanner.cli.Main.analyze(Main.java:77)
[11:36:11] :	 [Step 1/3] 	at org.sonarsource.scanner.cli.Main.main(Main.java:63)
[11:36:11] :	 [Step 1/3] 
[11:36:11] :	 [Step 1/3] 12:36:11.134 INFO  7/7 source files have been analyzed
[11:36:11] :	 [Step 1/3] 12:36:11.134 INFO  The Python analyzer was able to leverage cached data from previous analyses for 5 out of 7 files. These files were not parsed.
[11:36:11] :	 [Step 1/3] 12:36:11.134 INFO  Sensor Python Sensor [python] (done) | time=766ms
[11:36:11] :	 [Step 1/3] 12:36:11.134 INFO  Sensor Cobertura Sensor for Python coverage [python]
[11:36:11] :	 [Step 1/3] 12:36:11.159 INFO  Sensor Cobertura Sensor for Python coverage [python] (done) | time=25ms
[11:36:11] :	 [Step 1/3] 12:36:11.159 INFO  Sensor PythonXUnitSensor [python]
[11:36:11] :	 [Step 1/3] 12:36:11.177 INFO  Sensor PythonXUnitSensor [python] (done) | time=18ms
[11:36:11] :	 [Step 1/3] 12:36:11.177 INFO  Sensor JaCoCo XML Report Importer [jacoco]
[11:36:11] :	 [Step 1/3] 12:36:11.178 INFO  'sonar.coverage.jacoco.xmlReportPaths' is not defined. Using default locations: target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
[11:36:11] :	 [Step 1/3] 12:36:11.179 INFO  No report imported, no coverage information will be imported by JaCoCo XML Report Importer
[11:36:11] :	 [Step 1/3] 12:36:11.179 INFO  Sensor JaCoCo XML Report Importer [jacoco] (done) | time=2ms
[11:36:11] :	 [Step 1/3] 12:36:11.179 INFO  Sensor CSS Rules [javascript]
[11:36:11] :	 [Step 1/3] 12:36:11.179 INFO  Sensor CSS Rules is restricted to changed files only
[11:36:11] :	 [Step 1/3] 12:36:11.180 INFO  No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
[11:36:11] :	 [Step 1/3] 12:36:11.180 INFO  Sensor CSS Rules [javascript] (done) | time=1ms
[11:36:11] :	 [Step 1/3] 12:36:11.180 INFO  Sensor CSS Metrics [javascript]
[11:36:11] :	 [Step 1/3] 12:36:11.180 INFO  Sensor CSS Metrics is restricted to changed files only
[11:36:11] :	 [Step 1/3] 12:36:11.180 INFO  Sensor CSS Metrics [javascript] (done) | time=0ms
[11:36:11] :	 [Step 1/3] 12:36:11.181 INFO  Sensor ThymeLeaf template sensor [securityjavafrontend]
[11:36:11] :	 [Step 1/3] 12:36:11.181 INFO  Sensor ThymeLeaf template sensor [securityjavafrontend] (done) | time=0ms
[11:36:11] :	 [Step 1/3] 12:36:11.181 INFO  Sensor Python HTML templates processing [securitypythonfrontend]
[11:36:11] :	 [Step 1/3] 12:36:11.193 INFO  Sensor Python HTML templates processing [securitypythonfrontend] (done) | time=12ms
[11:36:11] :	 [Step 1/3] 12:36:11.193 INFO  Sensor IaC Docker Sensor [iac]
[11:36:11] :	 [Step 1/3] 12:36:11.193 INFO  Sensor IaC Docker Sensor is restricted to changed files only
[11:36:11] :	 [Step 1/3] 12:36:11.196 INFO  0 source files to be analyzed
[11:36:11] :	 [Step 1/3] 12:36:11.253 INFO  0/0 source files have been analyzed
[11:36:11] :	 [Step 1/3] 12:36:11.253 INFO  Sensor IaC Docker Sensor [iac] (done) | time=60ms
[11:36:11] :	 [Step 1/3] 12:36:11.253 INFO  Sensor Serverless configuration file sensor [security]
[11:36:11] :	 [Step 1/3] 12:36:11.254 INFO  0 Serverless function entries were found in the project
[11:36:11] :	 [Step 1/3] 12:36:11.256 INFO  0 Serverless function handlers were kept as entrypoints
[11:36:11] :	 [Step 1/3] 12:36:11.257 INFO  Sensor Serverless configuration file sensor [security] (done) | time=4ms
[11:36:11] :	 [Step 1/3] 12:36:11.257 INFO  Sensor AWS SAM template file sensor [security]
[11:36:11] :	 [Step 1/3] 12:36:11.258 INFO  Sensor AWS SAM template file sensor [security] (done) | time=0ms
[11:36:11] :	 [Step 1/3] 12:36:11.258 INFO  Sensor AWS SAM Inline template file sensor [security]
[11:36:11] :	 [Step 1/3] 12:36:11.258 INFO  Sensor AWS SAM Inline template file sensor [security] (done) | time=0ms
[11:36:11] :	 [Step 1/3] 12:36:11.258 INFO  Sensor javabugs [dbd]
[11:36:11] :	 [Step 1/3] 12:36:11.259 INFO  Reading IR files from: /home/debian/teamcity/work/76ae89bc09b975fd/.scannerwork/ir/java
[11:36:11] :	 [Step 1/3] 12:36:11.259 INFO  No IR files have been included for analysis.
[11:36:11] :	 [Step 1/3] 12:36:11.260 INFO  Sensor javabugs [dbd] (done) | time=2ms
[11:36:11] :	 [Step 1/3] 12:36:11.260 INFO  Sensor pythonbugs [dbd]
[11:36:11] :	 [Step 1/3] 12:36:11.287 INFO  Reading IR files from: /home/debian/teamcity/work/76ae89bc09b975fd/.scannerwork/ir/python
[11:36:11] :	 [Step 1/3] 12:36:11.289 INFO  Analyzing 7 functions to detect bugs.
[11:36:11] :	 [Step 1/3] 12:36:11.361 INFO  Sensor pythonbugs [dbd] (done) | time=101ms
[11:36:11] :	 [Step 1/3] 12:36:11.361 INFO  Sensor JavaSecuritySensor [security]
[11:36:11] :	 [Step 1/3] 12:36:11.362 INFO  Reading type hierarchy from: /home/debian/teamcity/work/76ae89bc09b975fd/.scannerwork/ucfg2/java
[11:36:11] :	 [Step 1/3] 12:36:11.362 INFO  Read 0 type definitions
[11:36:11] :	 [Step 1/3] 12:36:11.364 INFO  No UCFGs have been included for analysis.
[11:36:11] :	 [Step 1/3] 12:36:11.364 INFO  Sensor JavaSecuritySensor [security] (done) | time=3ms
[11:36:11] :	 [Step 1/3] 12:36:11.364 INFO  Sensor CSharpSecuritySensor [security]
[11:36:11] :	 [Step 1/3] 12:36:11.364 INFO  Reading type hierarchy from: /home/debian/teamcity/work/76ae89bc09b975fd/ucfg_cs2
[11:36:11] :	 [Step 1/3] 12:36:11.364 INFO  Read 0 type definitions
[11:36:11] :	 [Step 1/3] 12:36:11.364 INFO  No UCFGs have been included for analysis.
[11:36:11] :	 [Step 1/3] 12:36:11.364 INFO  Sensor CSharpSecuritySensor [security] (done) | time=0ms
[11:36:11] :	 [Step 1/3] 12:36:11.364 INFO  Sensor PhpSecuritySensor [security]
[11:36:11] :	 [Step 1/3] 12:36:11.365 INFO  Reading type hierarchy from: /home/debian/teamcity/work/76ae89bc09b975fd/.scannerwork/ucfg2/php
[11:36:11] :	 [Step 1/3] 12:36:11.365 INFO  Read 0 type definitions
[11:36:11] :	 [Step 1/3] 12:36:11.365 INFO  No UCFGs have been included for analysis.
[11:36:11] :	 [Step 1/3] 12:36:11.365 INFO  Sensor PhpSecuritySensor [security] (done) | time=1ms
[11:36:11] :	 [Step 1/3] 12:36:11.365 INFO  Sensor PythonSecuritySensor [security]
[11:36:11] :	 [Step 1/3] 12:36:11.365 INFO  Reading type hierarchy from: /home/debian/teamcity/work/76ae89bc09b975fd/.scannerwork/ucfg2/python
[11:36:11] :	 [Step 1/3] 12:36:11.444 INFO  Read 175 type definitions
[11:36:11] :	 [Step 1/3] 12:36:11.447 INFO  Reading UCFGs from: /home/debian/teamcity/work/76ae89bc09b975fd/.scannerwork/ucfg2/python
[11:36:11] :	 [Step 1/3] 12:36:11.618 INFO  12:36:11.618292883 Building Runtime Type propagation graph
[11:36:11] :	 [Step 1/3] 12:36:11.631 INFO  12:36:11.63132515 Running Tarjan on 1836 nodes
[11:36:11] :	 [Step 1/3] 12:36:11.636 INFO  12:36:11.636070048 Tarjan found 1832 components
[11:36:11] :	 [Step 1/3] 12:36:11.645 INFO  12:36:11.645510794 Variable type analysis: done
[11:36:11] :	 [Step 1/3] 12:36:11.647 INFO  12:36:11.647097301 Building Runtime Type propagation graph
[11:36:11] :	 [Step 1/3] 12:36:11.654 INFO  12:36:11.654298084 Running Tarjan on 1829 nodes
[11:36:11] :	 [Step 1/3] 12:36:11.656 INFO  12:36:11.656024989 Tarjan found 1825 components
[11:36:11] :	 [Step 1/3] 12:36:11.660 INFO  12:36:11.660486147 Variable type analysis: done
[11:36:11] :	 [Step 1/3] 12:36:11.661 INFO  Analyzing 834 ucfgs to detect vulnerabilities.
[11:36:11] :	 [Step 1/3] 12:36:11.831 INFO  All rules entrypoints : 0
[11:36:11] :	 [Step 1/3] 12:36:11.831 INFO  Retained UCFGs : 0
[11:36:11] :	 [Step 1/3] 12:36:11.833 INFO  Taint analysis starting. Entrypoints: 0
[11:36:11] :	 [Step 1/3] 12:36:11.833 INFO  Taint analysis: done.
[11:36:11] :	 [Step 1/3] 12:36:11.833 INFO  Sensor PythonSecuritySensor [security] (done) | time=468ms
[11:36:11] :	 [Step 1/3] 12:36:11.833 INFO  Sensor JsSecuritySensor [security]
[11:36:11] :	 [Step 1/3] 12:36:11.833 INFO  Reading type hierarchy from: /home/debian/teamcity/work/76ae89bc09b975fd/.scannerwork/ucfg2/js
[11:36:11] :	 [Step 1/3] 12:36:11.834 INFO  Read 0 type definitions
[11:36:11] :	 [Step 1/3] 12:36:11.834 INFO  No UCFGs have been included for analysis.
[11:36:11] :	 [Step 1/3] 12:36:11.834 INFO  Sensor JsSecuritySensor [security] (done) | time=1ms
[11:36:11] :	 [Step 1/3] 12:36:11.839 INFO  ------------- Run sensors on project
[11:36:11] :	 [Step 1/3] 12:36:11.903 INFO  Sensor Analysis Warnings import [csharp]
[11:36:11] :	 [Step 1/3] 12:36:11.904 INFO  Sensor Analysis Warnings import [csharp] (done) | time=1ms
[11:36:11] :	 [Step 1/3] 12:36:11.905 INFO  Sensor Dependency-Check [dependencycheck]
[11:36:11] :	 [Step 1/3] 12:36:11.905 INFO  Process Dependency-Check report
[11:36:11] :	 [Step 1/3] 12:36:11.906 INFO  Using JSON-Reportparser
[11:36:11] :	 [Step 1/3] 12:36:11.907 INFO  Dependency-Check JSON report does not exists. Please check property sonar.dependencyCheck.jsonReportPath:/home/debian/teamcity/work/76ae89bc09b975fd/${WORKSPACE}/dependency-check-report.json
[11:36:11] :	 [Step 1/3] 12:36:11.907 INFO  JSON-Analysis skipped/aborted due to missing report file
[11:36:11] :	 [Step 1/3] 12:36:11.907 INFO  Dependency-Check HTML report does not exists. Please check property sonar.dependencyCheck.htmlReportPath:/home/debian/teamcity/work/76ae89bc09b975fd/${WORKSPACE}/dependency-check-report.html
[11:36:11] :	 [Step 1/3] 12:36:11.907 INFO  HTML-Dependency-Check report does not exist.
[11:36:11] :	 [Step 1/3] 12:36:11.908 INFO  Process Dependency-Check report (done) | time=3ms
[11:36:11] :	 [Step 1/3] 12:36:11.908 INFO  Sensor Dependency-Check [dependencycheck] (done) | time=3ms
[11:36:11] :	 [Step 1/3] 12:36:11.908 INFO  Sensor Zero Coverage Sensor
[11:36:11] :	 [Step 1/3] 12:36:11.912 INFO  Sensor Zero Coverage Sensor (done) | time=4ms
[11:36:11] :	 [Step 1/3] 12:36:11.915 INFO  SCM Publisher SCM provider for this project is: git
[11:36:11] :	 [Step 1/3] 12:36:11.916 INFO  SCM Publisher 1 source file to be analyzed
[11:36:11] :	 [Step 1/3] 12:36:11.919 INFO  This git repository references another local repository which is not well supported. SCM information might be missing for some files. You can avoid borrow objects from another local repository by not using --reference or --shared when cloning it.
[11:36:11] :	 [Step 1/3] 12:36:11.977 INFO  SCM Publisher 1/1 source file have been analyzed (done) | time=60ms
[11:36:11] :	 [Step 1/3] 12:36:11.982 INFO  CPD Executor 1 file had no CPD blocks
[11:36:11] :	 [Step 1/3] 12:36:11.982 INFO  CPD Executor Calculating CPD for 4 files
[11:36:11] :	 [Step 1/3] 12:36:11.989 INFO  CPD Executor CPD calculation finished (done) | time=7ms
[11:36:12] :	 [Step 1/3] 12:36:12.051 INFO  SCM writing changed lines
[11:36:12] :	 [Step 1/3] 12:36:12.056 INFO  Merge base sha1: 8e592bb9fc0ad65e08e8862b94458713c3efd242
[11:36:12] :	 [Step 1/3] 12:36:12.078 INFO  SCM writing changed lines (done) | time=27ms
[11:36:12] :	 [Step 1/3] 12:36:12.082 INFO  Analysis report generated in 91ms, dir size=204.7 kB
[11:36:12] :	 [Step 1/3] 12:36:12.109 INFO  Analysis report compressed in 27ms, zip size=31.0 kB
[11:36:12] :	 [Step 1/3] 12:36:12.156 INFO  Analysis report uploaded in 47ms
[11:36:12] :	 [Step 1/3] 12:36:12.157 INFO  ------------- Check Quality Gate status
[11:36:12] :	 [Step 1/3] 12:36:12.158 INFO  Waiting for the analysis report to be processed (max 300s)
[11:36:32] :	 [Step 1/3] 12:36:32.311 INFO  QUALITY GATE STATUS: PASSED - View details on https://sonar.mycompany.com/dashboard?id=myproject&pullRequest=22
[11:36:32] :	 [Step 1/3] 12:36:32.327 INFO  Analysis total time: 29.989 s
[11:36:32] :	 [Step 1/3] 12:36:32.331 INFO  EXECUTION SUCCESS
[11:36:32] :	 [Step 1/3] 12:36:32.333 INFO  Total time: 32.103s
[11:36:32] :	 [Step 1/3] Process exited with code 0

Hey @saturnchickenlegcake

The issue isn’t appearing because you’re performing a Pull Request Analysis, and file-level issues don’t appear in PR analyses.

This should eventually be covered by this roadmap item, and I expect the issue will (today) raise on your branch analyses.

Hey Colin, thanks for the quick reply :)! unfortunately even running on the main branch rather than a PR also doesn’t work, same thing. Happy to send more logs if that helps?

Hey @saturnchickenlegcake

On both SonarQube v9.9 and v10.6 I’m having no trouble getting the issue to raise…

I have two suspicions:

  • It’s specific to this file. It would be great if you could share the full file (or at least a file where you reproduce the same behavior)
  • It has something to do with SonarQube’s cache mechanisms, but I can’t reproduce this so far

Hey Colin

Apologies for the delay getting back to you – I went off and switch from PR to branch based stuff but (unless I’m mis-understanding), this doesn’t integrate with githubs PRs, so sonar won’t report back on a PR the status of the latest commit.

Is there a work around/fix for this? kinda leaves me in a bind if I need to do branch analysis for parsing errors but pr analysis for github integration, thinking I could maybe just parse the sonar output myself on a PR and fail the build step I suppose?

Any recommendations are helpful :smiley:

Honest question, how many parsing errors are you expecting? They should be the exception, not the rule.

I agree it would be good if the parsing errors showed up in the PR analysis (and hopefully we’ll get there someday with this roadmap item). In the meantime, the worst-case scenario is that you benefit from PR analysis and find out about parsing errors after the merge (when analysis is run on the target branch).

Haha, based on current experience, a non-zero amount ^^ so was hoping to avoid silent failures as early as possible, especially if it gives a false sense of security on PR reviews. But hopefully testing and other such mechanisms would show it up ahead of that fact.

But that’s all good then, just wanted to make sure I wasn’t missing anything currently available to fit this particular slot ^^. Thanks for your time and knowledge :slight_smile: