Problem importing generic issue in sonarqube - missing mandatory field "engineId"

ERROR: Error during SonarScanner execution
java.lang.IllegalStateException: Failed to parse report 'C:\LTO\reporting\VCG\workspace\DATABASE_LAYER.json': missing mandatory field 'engineId'.
	at org.sonar.scanner.externalissue.ReportParser.mandatoryField(ReportParser.java:98)
	at org.sonar.scanner.externalissue.ReportParser.validate(ReportParser.java:54)
	at org.sonar.scanner.externalissue.ReportParser.parse(ReportParser.java:43)
	at org.sonar.scanner.externalissue.ExternalIssuesImportSensor.execute(ExternalIssuesImportSensor.java:72)
	at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:64)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:88)
{
   "rules":[
      {
         "id":"sql:PRAGMA AUTONOMOUS_TRANSACTION",
         "name":"sql:PRAGMA AUTONOMOUS_TRANSACTION",
         "cleanCodeAttribute":"CONVENTIONAL",
         "description":"Stored Procedure Contains COMMIT and/or ROLLBACK Statements in Procedures/Functions, Without the Use of PRAGMA AUTONOMOUS_TRANSACTION.",
         "engineId":"vcg",
         "impacts":[
            {
               "softwareQuality":"SECURITY",
               "severity":"LOW"
            }
         ]
      },
      {
         "id":"sql:ERROR_HANDLING",
         "name":"sql:ERROR_HANDLING",
         "cleanCodeAttribute":"CONVENTIONAL",
         "description":"WHEN OTHERS THEN",
         "engineId":"vcg",
         "impacts":[
            {
               "softwareQuality":"SECURITY",
               "severity":"LOW"
            }
         ]
      },
      {
         "id":"sql:SQL_INJECTION",
         "name":"sql:SQL_INJECTION",
         "cleanCodeAttribute":"CONVENTIONAL",
         "description":"Potential SQL Injection",
         "engineId":"vcg",
         "impacts":[
            {
               "softwareQuality":"SECURITY",
               "severity":"LOW"
            }
         ]
      },
      {
         "id":"sql:INFORMATION_EXPOSURE_THROUGH_AN_ERROR_MESSAGE",
         "name":"sql:INFORMATION_EXPOSURE_THROUGH_AN_ERROR_MESSAGE",
         "cleanCodeAttribute":"CONVENTIONAL",
         "description":"Error Handling With Output Parameters.",
         "engineId":"vcg",
         "impacts":[
            {
               "softwareQuality":"SECURITY",
               "severity":"LOW"
            }
         ]
      },
      {
         "id":"sql:UNENCRYPTED_PASSWORDS",
         "name":"sql:UNENCRYPTED_PASSWORDS",
         "cleanCodeAttribute":"CONVENTIONAL",
         "description":"Code Appears to Process Passwords Without the Use of a Standard Oracle Encryption Module",
         "engineId":"vcg",
         "impacts":[
            {
               "softwareQuality":"SECURITY",
               "severity":"MEDIUM"
            }
         ]
      }
   ],
   "issues":[
      {
         "ruleId":"sql:PRAGMA AUTONOMOUS_TRANSACTION",
         "primaryLocation":{
            "message":"This can result in data corruption, since rolling back or committing will split a wider logical transaction into two possibly conflicting sub-transactions. Exceptions to this include auditing procedures and long-running worker procedures.",
            "filePath":"C:/LTO/reporting/VCG/workspace/SELECTED/AE-DatabaseLayer/Oracle/Procedures/AE_PRC_initEventPubConfig.SQL",
            "textRange":{
               "startLine":101
            }
         }
      },
      {
         "ruleId":"sql:PRAGMA AUTONOMOUS_TRANSACTION",
         "primaryLocation":{
            "message":"This can result in data corruption, since rolling back or committing will split a wider logical transaction into two possibly conflicting sub-transactions. Exceptions to this include auditing procedures and long-running worker procedures.",
            "filePath":

Hey there.

What version of SonarQube are you using?

  • Community Edition Version 9.9.3 (build 79811)

Thanks. Make sure you follow the documentation for the generic issue import format for v9.9 LTS – it looks like you’re using the format from a newer version of SonarQube (v10.3)

Ok, we upgraded Sonarqube to version 10.3, I run an import script:

sonar.projectVersion=20231215
sonar.projectKey=DATABASE_LAYER
sonar.login=the_id
sonar.inclusions=DATABASE_LAYER-*/Oracle/**
sonar.externalIssuesReportPaths=C:/LTO/reporting/VCG/workspace/DATABASE_LAYER.json
sonar.host.url=http://localhost:9000
sonar.sources=.
sonar.sourceEncoding=ISO-8859-1
sonar.java.source=1.8
sonar.java.jdkHome=C:/Program Files/Eclipse Adoptium/jdk-17.0.6.10-hotspot
sonar.scm.disabled=true
sonar.findbugs.timeout=60000000
sonar.externalIssuesReportPaths=C:/LTO/reporting/VCG/workspace/DATABASE_LAYER.json

But none issue are imported. The error.log show:

INFO: ------------- Run sensors on module DATABASE_LAYER
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=29ms
INFO: Sensor Import external issues report
INFO: Imported 0 issues in 0 files
INFO: External issues ignored for 317 unknown files, including: C:/LTO/sonar/DATABASE_LAYER/SONAR_WORKSPACE/AE-DatabaseLayer/Oracle/Procedures/AE_PRC_initEventPubConfig.SQL, C:/LTO/sonar/DATABASE_LAYER/SONAR_WORKSPACE/AE-DatabaseLayer/Oracle/Procedures/AE_PRC_initPosEventConfig.SQL, C:/LTO/sonar/DATABASE_LAYER/SONAR_WORKSPACE/AE-DatabaseLayer/Oracle/Procedures/AE_PRC_updateAccBalance.SQL, C:/LTO/sonar/DATABASE_LAYER/SONAR_WORKSPACE/BO-BANORTE-DatabaseLayer/Oracle/Procedures/BO_PRC_EI_SCAT_GSM.sql, C:/LTO/sonar/DATABASE_LAYER/SONAR_WORKSPACE/BO-DatabaseLayer/Oracle/Functions/APR_FN_BUSINESSDATE.sql
INFO: Sensor Import external issues report (done) | time=68ms

The problem was missing source property (also I changed slashs in full path)

1 Like

But… today the issues are missing from the Dashboard !!!
" No Issues. Hooray!" but they are listed (692) in section Software Quality and Severity at left.
I observe that the project lost the code “The main branch has no lines of code.” (Overview) and “No code files were found for analysis” (Code). I checked that the files are there!

Hey @rriedel

I’m not really getting your last message. Can you share some screenshots?