Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Importing ESlint reports shouldn't spam output with errors if no report found #1986

Closed
Bouke opened this issue Apr 15, 2020 · 12 comments · Fixed by #4622
Closed

Importing ESlint reports shouldn't spam output with errors if no report found #1986

Bouke opened this issue Apr 15, 2020 · 12 comments · Fixed by #4622
Assignees
Labels
nice-to-have topic: plugin triage Investigate validity of issue and label it
Milestone

Comments

@Bouke
Copy link

Bouke commented Apr 15, 2020

Issue:

I have a solution (MSBuild) that builds 62 projects. Only 3 of those projects contain JavaScript / TypeScript. I want to import Eslint reports into SonarQube, to have a unified way of code quality reporting. However I'm blocked in doing so as SonarScanner will report 59 errors while scanning. It tries to import eslint's report for all projects, even though most projects don't emit eslint reports. This produces a lot of errors, which makes it hard to find any real errors within the pile of errors generated by SonarScanner.

Expected result: don't print errors if no report is found

Actual result: output is littered with "errors"

My version:

SonarScanner for MSBuild 4.9
INFO: SonarScanner 4.3.0.2102

Build: MSBuild on Azure Devops

Configuration:

sonar.eslint.reportPaths=eslint.json

Logs:

image

2020-06-29T14:17:47.2683996Z ##[error]ERROR: No issues information will be saved as the report file can't be read.
java.io.FileNotFoundException: D:\a\1\s\Source\SOME_PROJECT\eslint.json (The system cannot find the file specified)
2020-06-29T14:17:47.2685764Z ERROR: No issues information will be saved as the report file can't be read.
2020-06-29T14:17:47.2686612Z java.io.FileNotFoundException: D:\a\1\s\Source\SOME_PROJECT\eslint.json (The system cannot find the file specified)
2020-06-29T14:17:47.2696101Z ##[error]at java.base/java.io.FileInputStream.open0(Native Method)
	at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
	at org.sonar.plugins.javascript.external.EslintReportSensor.importReport(EslintReportSensor.java:61)
	at org.sonar.plugins.javascript.external.AbstractExternalIssuesSensor.lambda$execute$1(AbstractExternalIssuesSensor.java:54)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1540)
	at org.sonar.plugins.javascript.external.AbstractExternalIssuesSensor.execute(AbstractExternalIssuesSensor.java:54)
	at org.sonar.plugins.javascript.external.EslintReportSensor.execute(EslintReportSensor.java:43)
	at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:34)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:78)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:51)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:69)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:51)
	at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:68)
2020-06-29T14:17:47.2701444Z 	at java.base/java.io.FileInputStream.open0(Native Method)
2020-06-29T14:17:47.2702066Z 	at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
2020-06-29T14:17:47.2702736Z 	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
2020-06-29T14:17:47.2703531Z 	at org.sonar.plugins.javascript.external.EslintReportSensor.importReport(EslintReportSensor.java:61)

2020-06-29T14:17:47.8092726Z ##[error]ERROR: No issues information will be saved as the report file can't be read.
java.io.FileNotFoundException: D:\a\1\s\Source\SOME_PROJECT\eslint.json (The system cannot find the file specified)
	at java.base/java.io.FileInputStream.open0(Native Method)
	at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
	at org.sonar.plugins.javascript.external.EslintReportSensor.importReport(EslintReportSensor.java:61)
	at org.sonar.plugins.javascript.external.AbstractExternalIssuesSensor.lambda$execute$1(AbstractExternalIssuesSensor.java:54)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1540)
	at org.sonar.plugins.javascript.external.AbstractExternalIssuesSensor.execute(AbstractExternalIssuesSensor.java:54)
	at org.sonar.plugins.javascript.external.EslintReportSensor.execute(EslintReportSensor.java:43)
	at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:34)
2020-06-29T14:17:47.8102925Z ERROR: No issues information will be saved as the report file can't be read.
2020-06-29T14:17:47.8105366Z java.io.FileNotFoundException: D:\a\1\s\Source\SOME_PROJECT\eslint.json (The system cannot find the file specified)
2020-06-29T14:17:47.8106614Z 	at java.base/java.io.FileInputStream.open0(Native Method)
2020-06-29T14:17:47.8107654Z 	at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
2020-06-29T14:17:47.8108740Z 	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
2020-06-29T14:17:47.8109965Z 	at org.sonar.plugins.javascript.external.EslintReportSensor.importReport(EslintReportSensor.java:61)
2020-06-29T14:17:47.8111978Z 	at org.sonar.plugins.javascript.external.AbstractExternalIssuesSensor.lambda$execute$1(AbstractExternalIssuesSensor.java:54)
2020-06-29T14:17:47.8113258Z 	at java.base/java.util.ArrayList.forEach(ArrayList.java:1540)
2020-06-29T14:17:47.8114502Z 	at org.sonar.plugins.javascript.external.AbstractExternalIssuesSensor.execute(AbstractExternalIssuesSensor.java:54)
2020-06-29T14:17:47.8122574Z 	at org.sonar.plugins.javascript.external.EslintReportSensor.execute(EslintReportSensor.java:43)
2020-06-29T14:17:47.8123946Z 	at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:34)

2020-06-29T14:17:48.0631350Z ##[error]ERROR: No issues information will be saved as the report file can't be read.
java.io.FileNotFoundException: D:\a\1\s\Source\SOME_PROJECT\eslint.json (The system cannot find the file specified)
	at java.base/java.io.FileInputStream.open0(Native Method)
	at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
	at org.sonar.plugins.javascript.external.EslintReportSensor.importReport(EslintReportSensor.java:61)
	at org.sonar.plugins.javascript.external.AbstractExternalIssuesSensor.lambda$execute$1(AbstractExternalIssuesSensor.java:54)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1540)
	at org.sonar.plugins.javascript.external.AbstractExternalIssuesSensor.execute(AbstractExternalIssuesSensor.java:54)
	at org.sonar.plugins.javascript.external.EslintReportSensor.execute(EslintReportSensor.java:43)
	at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:34)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:78)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:51)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:69)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:51)
	at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:68)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:122)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:108)
	at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:418)
	at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:414)
	at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:411)
	at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:372)

2020-06-29T14:17:48.2414789Z ##[error]ERROR: No issues information will be saved as the report file can't be read.
2020-06-29T14:17:48.2422728Z ERROR: No issues information will be saved as the report file can't be read.
2020-06-29T14:17:48.2431455Z ##[error]java.io.FileNotFoundException: D:\a\1\s\Source\SOME_PROJECT\eslint.json (The system cannot find the file specified)
	at java.base/java.io.FileInputStream.open0(Native Method)
	at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
	at org.sonar.plugins.javascript.external.EslintReportSensor.importReport(EslintReportSensor.java:61)
	at org.sonar.plugins.javascript.external.AbstractExternalIssuesSensor.lambda$execute$1(AbstractExternalIssuesSensor.java:54)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1540)
	at org.sonar.plugins.javascript.external.AbstractExternalIssuesSensor.execute(AbstractExternalIssuesSensor.java:54)
	at org.sonar.plugins.javascript.external.EslintReportSensor.execute(EslintReportSensor.java:43)
	at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:34)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:78)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:51)
2020-06-29T14:17:48.2437396Z java.io.FileNotFoundException: D:\a\1\s\Source\SOME_PROJECT\eslint.json (The system cannot find the file specified)
2020-06-29T14:17:48.2438629Z 	at java.base/java.io.FileInputStream.open0(Native Method)
2020-06-29T14:17:48.2439646Z 	at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
2020-06-29T14:17:48.2441025Z 	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
2020-06-29T14:17:48.2442271Z 	at org.sonar.plugins.javascript.external.EslintReportSensor.importReport(EslintReportSensor.java:61)
2020-06-29T14:17:48.2443686Z 	at org.sonar.plugins.javascript.external.AbstractExternalIssuesSensor.lambda$execute$1(AbstractExternalIssuesSensor.java:54)
2020-06-29T14:17:48.2444946Z 	at java.base/java.util.ArrayList.forEach(ArrayList.java:1540)
2020-06-29T14:17:48.2446306Z 	at org.sonar.plugins.javascript.external.AbstractExternalIssuesSensor.execute(AbstractExternalIssuesSensor.java:54)

2020-06-29T14:17:48.4933718Z ##[error]ERROR: No issues information will be saved as the report file can't be read.
2020-06-29T14:17:48.4938964Z ERROR: No issues information will be saved as the report file can't be read.
2020-06-29T14:17:48.4943125Z ##[error]java.io.FileNotFoundException: D:\a\1\s\Source\SOME_PROJECT\eslint.json (The system cannot find the file specified)
	at java.base/java.io.FileInputStream.open0(Native Method)
	at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
2020-06-29T14:17:48.4945835Z java.io.FileNotFoundException: D:\a\1\s\Source\SOME_PROJECT\eslint.json (The system cannot find the file specified)
2020-06-29T14:17:48.4946946Z 	at java.base/java.io.FileInputStream.open0(Native Method)
2020-06-29T14:17:48.4947880Z 	at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
2020-06-29T14:17:48.4948913Z 	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
2020-06-29T14:17:48.4955870Z ##[error]at org.sonar.plugins.javascript.external.EslintReportSensor.importReport(EslintReportSensor.java:61)
	at org.sonar.plugins.javascript.external.AbstractExternalIssuesSensor.lambda$execute$1(AbstractExternalIssuesSensor.java:54)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1540)
2020-06-29T14:17:48.4958562Z 	at org.sonar.plugins.javascript.external.EslintReportSensor.importReport(EslintReportSensor.java:61)
2020-06-29T14:17:48.4959989Z 	at org.sonar.plugins.javascript.external.AbstractExternalIssuesSensor.lambda$execute$1(AbstractExternalIssuesSensor.java:54)
2020-06-29T14:17:48.4961618Z 	at java.base/java.util.ArrayList.forEach(ArrayList.java:1540)
2020-06-29T14:17:48.4964970Z ##[error]at org.sonar.plugins.javascript.external.AbstractExternalIssuesSensor.execute(AbstractExternalIssuesSensor.java:54)
	at org.sonar.plugins.javascript.external.EslintReportSensor.execute(EslintReportSensor.java:43)
2020-06-29T14:17:48.4967367Z 	at org.sonar.plugins.javascript.external.AbstractExternalIssuesSensor.execute(AbstractExternalIssuesSensor.java:54)
2020-06-29T14:17:48.4968730Z 	at org.sonar.plugins.javascript.external.EslintReportSensor.execute(EslintReportSensor.java:43)
2020-06-29T14:17:48.4975322Z ##[error]at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:34)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:78)

2020-06-29T14:17:48.7285508Z ##[error]ERROR: No issues information will be saved as the report file can't be read.
java.io.FileNotFoundException: D:\a\1\s\Source\SOME_PROJECT\eslint.json (The system cannot find the file specified)
	at java.base/java.io.FileInputStream.open0(Native Method)
	at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
	at org.sonar.plugins.javascript.external.EslintReportSensor.importReport(EslintReportSensor.java:61)
	at org.sonar.plugins.javascript.external.AbstractExternalIssuesSensor.lambda$execute$1(AbstractExternalIssuesSensor.java:54)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1540)
	at org.sonar.plugins.javascript.external.AbstractExternalIssuesSensor.execute(AbstractExternalIssuesSensor.java:54)
	at org.sonar.plugins.javascript.external.EslintReportSensor.execute(EslintReportSensor.java:43)
2020-06-29T14:17:48.7293393Z ERROR: No issues information will be saved as the report file can't be read.
2020-06-29T14:17:48.7294775Z java.io.FileNotFoundException: D:\a\1\s\Source\SOME_PROJECT\eslint.json (The system cannot find the file specified)
2020-06-29T14:17:48.7295848Z 	at java.base/java.io.FileInputStream.open0(Native Method)
2020-06-29T14:17:48.7296882Z 	at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
2020-06-29T14:17:48.7300174Z 	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
2020-06-29T14:17:48.7301349Z 	at org.sonar.plugins.javascript.external.EslintReportSensor.importReport(EslintReportSensor.java:61)
2020-06-29T14:17:48.7322542Z 	at org.sonar.plugins.javascript.external.AbstractExternalIssuesSensor.lambda$execute$1(AbstractExternalIssuesSensor.java:54)
2020-06-29T14:17:48.7323846Z 	at java.base/java.util.ArrayList.forEach(ArrayList.java:1540)
2020-06-29T14:17:48.7325031Z 	at org.sonar.plugins.javascript.external.AbstractExternalIssuesSensor.execute(AbstractExternalIssuesSensor.java:54)
2020-06-29T14:17:48.7326374Z 	at org.sonar.plugins.javascript.external.EslintReportSensor.execute(EslintReportSensor.java:43)
2020-06-29T14:17:48.7346898Z ##[error]at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:34)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:78)

2020-06-29T14:17:48.9451546Z ##[error]ERROR: No issues information will be saved as the report file can't be read.
java.io.FileNotFoundException: D:\a\1\s\Source\SOME_PROJECT\eslint.json (The system cannot find the file specified)
	at java.base/java.io.FileInputStream.open0(Native Method)
	at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
	at org.sonar.plugins.javascript.external.EslintReportSensor.importReport(EslintReportSensor.java:61)
2020-06-29T14:17:48.9454882Z ERROR: No issues information will be saved as the report file can't be read.
2020-06-29T14:17:48.9456090Z java.io.FileNotFoundException: D:\a\1\s\Source\SOME_PROJECT\eslint.json (The system cannot find the file specified)
2020-06-29T14:17:48.9458209Z 	at java.base/java.io.FileInputStream.open0(Native Method)
2020-06-29T14:17:48.9459219Z 	at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
2020-06-29T14:17:48.9460791Z 	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
2020-06-29T14:17:48.9462013Z 	at org.sonar.plugins.javascript.external.EslintReportSensor.importReport(EslintReportSensor.java:61)
2020-06-29T14:17:48.9463159Z INFO: Sensor Import of ESLint issues [javascript] (done) | time=2ms
2020-06-29T14:17:48.9464907Z INFO: Sensor ThymeLeaf template sensor [securityjavafrontend]
2020-06-29T14:17:48.9491704Z ##[error]at org.sonar.plugins.javascript.external.AbstractExternalIssuesSensor.lambda$execute$1(AbstractExternalIssuesSensor.java:54)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1540)
	at org.sonar.plugins.javascript.external.AbstractExternalIssuesSensor.execute(AbstractExternalIssuesSensor.java:54)
	at org.sonar.plugins.javascript.external.EslintReportSensor.execute(EslintReportSensor.java:43)
	at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:34)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:78)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:51)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:69)

2020-06-29T14:17:49.3467769Z ##[error]ERROR: No issues information will be saved as the report file can't be read.
java.io.FileNotFoundException: D:\a\1\s\Source\SOME_PROJECT\eslint.json (The system cannot find the file specified)
	at java.base/java.io.FileInputStream.open0(Native Method)
	at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
	at org.sonar.plugins.javascript.external.EslintReportSensor.importReport(EslintReportSensor.java:61)
	at org.sonar.plugins.javascript.external.AbstractExternalIssuesSensor.lambda$execute$1(AbstractExternalIssuesSensor.java:54)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1540)
	at org.sonar.plugins.javascript.external.AbstractExternalIssuesSensor.execute(AbstractExternalIssuesSensor.java:54)
	at org.sonar.plugins.javascript.external.EslintReportSensor.execute(EslintReportSensor.java:43)
	at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:34)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:78)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:51)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:69)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:51)
	at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:68)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:122)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:108)
	at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:418)
	at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:414)
	at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:411)
	at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:372)

2020-06-29T14:17:49.5618380Z ##[error]ERROR: No issues information will be saved as the report file can't be read.
2020-06-29T14:17:49.5620064Z ERROR: No issues information will be saved as the report file can't be read.
2020-06-29T14:17:49.5629096Z ##[error]java.io.FileNotFoundException: D:\a\1\s\Source\SOME_PROJECT\eslint.json (The system cannot find the file specified)
	at java.base/java.io.FileInputStream.open0(Native Method)
	at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
	at org.sonar.plugins.javascript.external.EslintReportSensor.importReport(EslintReportSensor.java:61)
	at org.sonar.plugins.javascript.external.AbstractExternalIssuesSensor.lambda$execute$1(AbstractExternalIssuesSensor.java:54)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1540)
	at org.sonar.plugins.javascript.external.AbstractExternalIssuesSensor.execute(AbstractExternalIssuesSensor.java:54)
2020-06-29T14:17:49.5635213Z java.io.FileNotFoundException: D:\a\1\s\Source\SOME_PROJECT\eslint.json (The system cannot find the file specified)
2020-06-29T14:17:49.5636369Z 	at java.base/java.io.FileInputStream.open0(Native Method)
2020-06-29T14:17:49.5639061Z 	at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
2020-06-29T14:17:49.5640122Z 	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
2020-06-29T14:17:49.5641680Z 	at org.sonar.plugins.javascript.external.EslintReportSensor.importReport(EslintReportSensor.java:61)
2020-06-29T14:17:49.5642982Z 	at org.sonar.plugins.javascript.external.AbstractExternalIssuesSensor.lambda$execute$1(AbstractExternalIssuesSensor.java:54)
2020-06-29T14:17:49.5644097Z 	at java.base/java.util.ArrayList.forEach(ArrayList.java:1540)
2020-06-29T14:17:49.5645198Z 	at org.sonar.plugins.javascript.external.AbstractExternalIssuesSensor.execute(AbstractExternalIssuesSensor.java:54)
2020-06-29T14:17:49.5649714Z ##[error]at org.sonar.plugins.javascript.external.EslintReportSensor.execute(EslintReportSensor.java:43)
	at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:34)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:78)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:51)

2020-06-29T14:17:49.7736994Z ##[error]ERROR: No issues information will be saved as the report file can't be read.
java.io.FileNotFoundException: D:\a\1\s\Source\SOME_PROJECT\eslint.json (The system cannot find the file specified)
	at java.base/java.io.FileInputStream.open0(Native Method)
	at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
	at org.sonar.plugins.javascript.external.EslintReportSensor.importReport(EslintReportSensor.java:61)
	at org.sonar.plugins.javascript.external.AbstractExternalIssuesSensor.lambda$execute$1(AbstractExternalIssuesSensor.java:54)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1540)
	at org.sonar.plugins.javascript.external.AbstractExternalIssuesSensor.execute(AbstractExternalIssuesSensor.java:54)
	at org.sonar.plugins.javascript.external.EslintReportSensor.execute(EslintReportSensor.java:43)
	at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:34)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:78)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:51)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:69)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:51)
	at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:68)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:122)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:108)
	at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:418)
	at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:414)
	at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:411)
	at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:372)

2020-06-29T14:17:49.9505679Z ##[error]ERROR: No issues information will be saved as the report file can't be read.
java.io.FileNotFoundException: D:\a\1\s\Source\SOME_PROJECT\eslint.json (The system cannot find the file specified)
2020-06-29T14:17:49.9510963Z ERROR: No issues information will be saved as the report file can't be read.
2020-06-29T14:17:49.9512333Z java.io.FileNotFoundException: D:\a\1\s\Source\SOME_PROJECT\eslint.json (The system cannot find the file specified)
2020-06-29T14:17:49.9518100Z ##[error]at java.base/java.io.FileInputStream.open0(Native Method)
	at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
	at org.sonar.plugins.javascript.external.EslintReportSensor.importReport(EslintReportSensor.java:61)
2020-06-29T14:17:49.9520521Z 	at java.base/java.io.FileInputStream.open0(Native Method)
2020-06-29T14:17:49.9522408Z 	at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
2020-06-29T14:17:49.9523511Z 	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
2020-06-29T14:17:49.9524806Z 	at org.sonar.plugins.javascript.external.EslintReportSensor.importReport(EslintReportSensor.java:61)
2020-06-29T14:17:49.9528048Z ##[error]at org.sonar.plugins.javascript.external.AbstractExternalIssuesSensor.lambda$execute$1(AbstractExternalIssuesSensor.java:54)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1540)
	at org.sonar.plugins.javascript.external.AbstractExternalIssuesSensor.execute(AbstractExternalIssuesSensor.java:54)
2020-06-29T14:17:49.9531058Z 	at org.sonar.plugins.javascript.external.AbstractExternalIssuesSensor.lambda$execute$1(AbstractExternalIssuesSensor.java:54)
2020-06-29T14:17:49.9532449Z 	at java.base/java.util.ArrayList.forEach(ArrayList.java:1540)
2020-06-29T14:17:49.9533666Z 	at org.sonar.plugins.javascript.external.AbstractExternalIssuesSensor.execute(AbstractExternalIssuesSensor.java:54)
2020-06-29T14:17:49.9536242Z ##[error]at org.sonar.plugins.javascript.external.EslintReportSensor.execute(EslintReportSensor.java:43)
	at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:34)
2020-06-29T14:17:49.9538922Z 	at org.sonar.plugins.javascript.external.EslintReportSensor.execute(EslintReportSensor.java:43)
2020-06-29T14:17:49.9540234Z 	at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:34)

2020-06-29T14:17:50.0825503Z ##[error]ERROR: No issues information will be saved as the report file can't be read.
2020-06-29T14:17:50.0827423Z ERROR: No issues information will be saved as the report file can't be read.
2020-06-29T14:17:50.0832549Z ##[error]java.io.FileNotFoundException: D:\a\1\s\Source\SOME_PROJECT\eslint.json (The system cannot find the file specified)
	at java.base/java.io.FileInputStream.open0(Native Method)
	at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
2020-06-29T14:17:50.0835987Z java.io.FileNotFoundException: D:\a\1\s\Source\SOME_PROJECT\eslint.json (The system cannot find the file specified)
2020-06-29T14:17:50.0843499Z 	at java.base/java.io.FileInputStream.open0(Native Method)
2020-06-29T14:17:50.0844558Z 	at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
2020-06-29T14:17:50.0849197Z 	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
2020-06-29T14:17:50.0853462Z ##[error]at org.sonar.plugins.javascript.external.EslintReportSensor.importReport(EslintReportSensor.java:61)
	at org.sonar.plugins.javascript.external.AbstractExternalIssuesSensor.lambda$execute$1(AbstractExternalIssuesSensor.java:54)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1540)
2020-06-29T14:17:50.0856670Z 	at org.sonar.plugins.javascript.external.EslintReportSensor.importReport(EslintReportSensor.java:61)
2020-06-29T14:17:50.0858532Z 	at org.sonar.plugins.javascript.external.AbstractExternalIssuesSensor.lambda$execute$1(AbstractExternalIssuesSensor.java:54)
2020-06-29T14:17:50.0859836Z 	at java.base/java.util.ArrayList.forEach(ArrayList.java:1540)
2020-06-29T14:17:50.0867547Z ##[error]at org.sonar.plugins.javascript.external.AbstractExternalIssuesSensor.execute(AbstractExternalIssuesSensor.java:54)
	at org.sonar.plugins.javascript.external.EslintReportSensor.execute(EslintReportSensor.java:43)
2020-06-29T14:17:50.0889989Z 	at org.sonar.plugins.javascript.external.AbstractExternalIssuesSensor.execute(AbstractExternalIssuesSensor.java:54)
2020-06-29T14:17:50.0891658Z 	at org.sonar.plugins.javascript.external.EslintReportSensor.execute(EslintReportSensor.java:43)
2020-06-29T14:17:50.0894191Z ##[error]at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:34)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:78)

2020-06-29T14:17:50.2850854Z ##[error]ERROR: No issues information will be saved as the report file can't be read.
java.io.FileNotFoundException: D:\a\1\s\Source\SOME_PROJECT\eslint.json (The system cannot find the file specified)
2020-06-29T14:17:50.2853275Z ERROR: No issues information will be saved as the report file can't be read.
2020-06-29T14:17:50.2854425Z java.io.FileNotFoundException: D:\a\1\s\Source\SOME_PROJECT\eslint.json (The system cannot find the file specified)
2020-06-29T14:17:50.2856885Z ##[error]at java.base/java.io.FileInputStream.open0(Native Method)
	at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
2020-06-29T14:17:50.2858763Z 	at java.base/java.io.FileInputStream.open0(Native Method)
2020-06-29T14:17:50.2859680Z 	at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
2020-06-29T14:17:50.2860925Z 	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
2020-06-29T14:17:50.2864395Z ##[error]at org.sonar.plugins.javascript.external.EslintReportSensor.importReport(EslintReportSensor.java:61)
	at org.sonar.plugins.javascript.external.AbstractExternalIssuesSensor.lambda$execute$1(AbstractExternalIssuesSensor.java:54)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1540)
2020-06-29T14:17:50.2866857Z 	at org.sonar.plugins.javascript.external.EslintReportSensor.importReport(EslintReportSensor.java:61)
2020-06-29T14:17:50.2868511Z 	at org.sonar.plugins.javascript.external.AbstractExternalIssuesSensor.lambda$execute$1(AbstractExternalIssuesSensor.java:54)
2020-06-29T14:17:50.2869707Z 	at java.base/java.util.ArrayList.forEach(ArrayList.java:1540)
2020-06-29T14:17:50.2873152Z ##[error]at org.sonar.plugins.javascript.external.AbstractExternalIssuesSensor.execute(AbstractExternalIssuesSensor.java:54)
	at org.sonar.plugins.javascript.external.EslintReportSensor.execute(EslintReportSensor.java:43)
	at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:34)
2020-06-29T14:17:50.2877389Z 	at org.sonar.plugins.javascript.external.AbstractExternalIssuesSensor.execute(AbstractExternalIssuesSensor.java:54)
2020-06-29T14:17:50.2878676Z 	at org.sonar.plugins.javascript.external.EslintReportSensor.execute(EslintReportSensor.java:43)
2020-06-29T14:17:50.2879849Z 	at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:34)

(and on it goes for 1360 lines...)
@vilchik-elena
Copy link
Contributor

hi,

I'm not expert in Azure DevOps (to put it mildly), from JavaScript analyzer side I have zero idea what could cause such behaviour. We certainly use report path as relative to project dir or absolute.

I would suggest you to create a thread in https://community.sonarsource.com/, there is much more chance you will get the help there.

thanks!

@saberduck
Copy link
Contributor

saberduck commented May 20, 2020

sorry, I mixed the issues, this comment was meant for #1985

@saberduck saberduck added the type: bug Exceptions and blocking issues during analysis label May 20, 2020
@saberduck saberduck added this to the 6.3 milestone May 20, 2020
@saberduck saberduck removed the type: bug Exceptions and blocking issues during analysis label May 20, 2020
@saberduck saberduck removed this from the 6.3 milestone May 20, 2020
@Bouke
Copy link
Author

Bouke commented Jun 24, 2020

I'm not sure how Azure DevOps is really related to this? I've specified absolute paths in my config (e.g. /A/eslint.json) and from the logs it looks like this scanner is prefixing that path with some directories it finds in my source folder. How can I instruct this scanner to only import very specific files?

@vilchik-elena
Copy link
Contributor

@Bouke /A/eslint.json is not absolute path

@Bouke
Copy link
Author

Bouke commented Jun 29, 2020

@vilchik-elena Well on linux it is, and on Windows the path separator would be \. Regardless. How can I specify a path relative to the root of my project?

@vilchik-elena
Copy link
Contributor

tbh I'm hesitating to give you any advices as I have no idea what is going on in your logs. Theoretically we should simply iterate ONCE the list of paths set in the property. For each path we check if it's absolute (then we use it as it is), if relative we concatenate it with root of the project (code doing that).

I don't understand why you have it repeated for different directories. That's why it might make sense to report it in https://community.sonarsource.com/

@Bouke Bouke changed the title Import ESLint reports relative to repository root, don't spam output with errors Importing ESlint reports shouldn't spam output with errors if no report found Jun 29, 2020
@Bouke
Copy link
Author

Bouke commented Jun 29, 2020

Thanks to your suggestion about relative paths, I've tried again using eslint.json and for the projects containing such a file the reports got loaded.

However the original problem with spamming the logs is still present. I've updated my initial description to make it clearer what the problem is. Out of 62 projects in my build, only 3 emit eslint.json. SonarScanner will try to import eslint.json for the other 59 projects (so far OK), but will output errors if those files could not be found (NOT OK). It should simply log an INFO message (also not a warning) when the file could not be found. No reason to be so loud about this.

@Bouke
Copy link
Author

Bouke commented Jan 25, 2021

Any updates on this? @vilchik-elena

@vilchik-elena vilchik-elena added feedback triage Investigate validity of issue and label it labels Aug 20, 2021
@rfelgent
Copy link

Same here. Spaming the output is pretty annyoing/misleading

@ilia-kebets-sonarsource ilia-kebets-sonarsource added the mmf-2928 https://sonarsource.atlassian.net/browse/MMF-2928 label Aug 14, 2023
@ilia-kebets-sonarsource
Copy link
Contributor

we have added many rules from core eslint and some plugins, is this still a problem?

@Bouke
Copy link
Author

Bouke commented Oct 29, 2023 via email

@m-schutte-ohra-nl
Copy link

The log severity has indeed been dropped from error to warn, but we still get a stacktrace as can also be seen in the original poster's logs. Please remove this stacktrace.
The same problem occurs with the tflint, please also reduce log severity to warn and remove the stacktrace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
nice-to-have topic: plugin triage Investigate validity of issue and label it
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants