Failed to parse sarif file

Hi – I’m trying to get issues identified by Eslint imported into Sonar. I have Eslint configured to generate a *.sarif file, and I have sonar-project.properties configured to import the generated file (sonar.sarifReportPaths=application/tmp/eslint-report.sarif, application/tmp/tslint-report.sarif, application/tmp/rubocop.sarif).

I can see that all three .sarif files are found and processed, but one of the three fails to be processed successfully:

2025-08-28T18:26:06.0497871Z 18:26:06.049 DEBUG Importing SARIF issues from 'application/tmp/rubocop.sarif' 
2025-08-28T18:26:06.1910367Z 18:26:06.190 DEBUG Importing SARIF issues from 'application/tmp/eslint-report.sarif' 
2025-08-28T18:26:06.1982956Z 18:26:06.198 DEBUG Importing SARIF issues from 'application/tmp/tslint-report.sarif' 
2025-08-28T18:26:06.1984604Z 18:26:06.198 WARN  Failed to process SARIF report from file 'application/tmp/tslint-report.sarif', error: 'Failed to read SARIF report at '/home/runner/_work/***-rails/***-rails/application/tmp/tslint-report.sarif'' 
2025-08-28T18:26:06.1986000Z 18:26:06.198 INFO  File application/tmp/rubocop.sarif: 1 run(s) successfully imported (0 vulnerabilities in total). 
2025-08-28T18:26:06.1986915Z 18:26:06.198 INFO  File application/tmp/eslint-report.sarif: 1 run(s) successfully imported (0 vulnerabilities in total).

The fill tslint.sarif file is attached below. The file is placed on the filesystem in the same manner as the other two files (same location, same permissions, etc). The only difference appears to be that the file that’s failing to process contains issues whereas the other two are issue-free.

How should I go about debugging this issue? The WARN message logged above is not particularly helpful.

tslint-report.sarif.zip (51.1 KB)

Hey there.

I took the file you shared and had no trouble getting it to import

09:59:51.691 INFO  Sensor Import external issues report from SARIF file.
09:59:51.795 WARN  Unable to detect rules severity for issue detected by tool ESLint, falling back to default rule severity: MEDIUM
09:59:51.804 INFO  File tslint-report.sarif: 1 run(s) successfully imported (10 vulnerabilities in total).
09:59:51.804 INFO  Sensor Import external issues report from SARIF file. (done) | time=113ms

The only way I can reproduce the error message you get is to delete or rename the file… you’re sure you have it right, and it’s tslint-report.sarif in the filesystem and not tslint.sarif like you mention later?

Thanks, Colin. Sure enough, it was a file location issue. :person_facepalming:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.