Failed to get Node.js version. No CSS files will be analyzed

sonarcloud
vsts

(Peter Connor) #1

Good morning,

Our CI builds seem to be erroring with CSS files today. The analysis step still passes, but the following errors are thrown. We are using SonarCloud and VSTS:

> 2018-09-17T09:33:11.4743585Z ##[error]ERROR: Failed to get Node.js version. No CSS files will be analyzed.
> 2018-09-17T09:33:11.4747319Z ERROR: Failed to get Node.js version. No CSS files will be analyzed.
> 2018-09-17T09:33:11.4747622Z INFO: Sensor C# Properties [csharp] (done) | time=0ms
> 2018-09-17T09:33:11.4749495Z ##[error]java.io.IOException: Cannot run program "node": CreateProcess error=2, The system cannot find the file specified
> 	at java.lang.ProcessBuilder.start(Unknown Source)
> 	at java.lang.Runtime.exec(Unknown Source)
> 	at java.lang.Runtime.exec(Unknown Source)
> 	at java.lang.Runtime.exec(Unknown Source)
> 	at org.sonar.css.plugin.CssRuleSensor.checkCompatibleNodeVersion(CssRuleSensor.java:115)
> 	at org.sonar.css.plugin.CssRuleSensor.execute(CssRuleSensor.java:80)
> 	at org.sonar.scanner.sensor.SensorWrapper.analyse(SensorWrapper.java:45)
> 	at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:88)
> 	at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:62)
> 	at org.sonar.scanner.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:74)
> 	at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:166)
> 	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
> 	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
> 	at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:315)
> 2018-09-17T09:33:11.4751086Z java.io.IOException: Cannot run program "node": CreateProcess error=2, The system cannot find the file specified
> 2018-09-17T09:33:11.4751325Z 	at java.lang.ProcessBuilder.start(Unknown Source)
> 2018-09-17T09:33:11.4751517Z 	at java.lang.Runtime.exec(Unknown Source)
> 2018-09-17T09:33:11.4751688Z 	at java.lang.Runtime.exec(Unknown Source)
> 2018-09-17T09:33:11.4751871Z 	at java.lang.Runtime.exec(Unknown Source)
> 2018-09-17T09:33:11.4752072Z 	at org.sonar.css.plugin.CssRuleSensor.checkCompatibleNodeVersion(CssRuleSensor.java:115)
> 2018-09-17T09:33:11.4752302Z 	at org.sonar.css.plugin.CssRuleSensor.execute(CssRuleSensor.java:80)
> 2018-09-17T09:33:11.4752528Z 	at org.sonar.scanner.sensor.SensorWrapper.analyse(SensorWrapper.java:45)
> 2018-09-17T09:33:11.4752742Z 	at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:88)
> 2018-09-17T09:33:11.4752963Z 	at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:62)
> 2018-09-17T09:33:11.4753181Z 	at org.sonar.scanner.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:74)
> 2018-09-17T09:33:11.4753416Z 	at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:166)
> 2018-09-17T09:33:11.4753646Z 	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
> 2018-09-17T09:33:11.4753877Z 	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
> 2018-09-17T09:33:11.4754098Z 	at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:315)
> 2018-09-17T09:33:11.4754299Z INFO: Sensor SonarJavaXmlFileSensor [java]
> 2018-09-17T09:33:11.4755144Z ##[error]at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:310)
> 	at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:308)
> 	at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:284)
> 	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
> 2018-09-17T09:33:11.4755775Z 	at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:310)
> 2018-09-17T09:33:11.4756023Z 	at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:308)
> 2018-09-17T09:33:11.4756270Z 	at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:284)
> 2018-09-17T09:33:11.4756509Z 	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
> 2018-09-17T09:33:11.4757047Z ##[error]at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
> 	at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:48)
> 2018-09-17T09:33:11.4758301Z 	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
> 2018-09-17T09:33:11.4758536Z 	at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:48)
> 2018-09-17T09:33:11.4759099Z ##[error]at org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:82)
> 	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
> 2018-09-17T09:33:11.4759590Z 	at org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:82)
> 2018-09-17T09:33:11.4759829Z 	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
> 2018-09-17T09:33:11.4760366Z ##[error]at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
> 	at org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:131)
> 2018-09-17T09:33:11.4761057Z 	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
> 2018-09-17T09:33:11.4761301Z 	at org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:131)
> 2018-09-17T09:33:11.4761813Z ##[error]at org.sonar.batch.bootstrapper.Batch.doExecuteTask(Batch.java:116)
> 	at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:71)
> 2018-09-17T09:33:11.4762363Z 	at org.sonar.batch.bootstrapper.Batch.doExecuteTask(Batch.java:116)
> 2018-09-17T09:33:11.4762576Z 	at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:71)
> 2018-09-17T09:33:11.4763122Z ##[error]at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 2018-09-17T09:33:11.4763694Z 	at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
> 2018-09-17T09:33:11.4763950Z 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 2018-09-17T09:33:11.4764462Z ##[error]at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> 2018-09-17T09:33:11.4764983Z 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> 2018-09-17T09:33:11.4765209Z 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> 2018-09-17T09:33:11.4765721Z ##[error]at java.lang.reflect.Method.invoke(Unknown Source)
> 	at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
> 2018-09-17T09:33:11.4766237Z 	at java.lang.reflect.Method.invoke(Unknown Source)
> 2018-09-17T09:33:11.4766463Z 	at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
> 2018-09-17T09:33:11.4766967Z ##[error]at com.sun.proxy.$Proxy0.execute(Unknown Source)
> 	at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:171)
> 2018-09-17T09:33:11.4767500Z 	at com.sun.proxy.$Proxy0.execute(Unknown Source)
> 2018-09-17T09:33:11.4767718Z 	at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:171)
> 2018-09-17T09:33:11.4768238Z ##[error]at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:128)
> 	at org.sonarsource.scanner.cli.Main.execute(Main.java:111)
> 2018-09-17T09:33:11.4768789Z 	at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:128)
> 2018-09-17T09:33:11.4769002Z 	at org.sonarsource.scanner.cli.Main.execute(Main.java:111)
> 2018-09-17T09:33:11.4769390Z ##[error]at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
> 2018-09-17T09:33:11.4769855Z 	at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
> 2018-09-17T09:33:11.4770367Z ##[error]at org.sonarsource.scanner.cli.Main.main(Main.java:61)
> Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
> 2018-09-17T09:33:11.4770905Z 	at org.sonarsource.scanner.cli.Main.main(Main.java:61)
> 2018-09-17T09:33:11.4771140Z Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
> 2018-09-17T09:33:11.4771839Z INFO: Sensor SonarJavaXmlFileSensor [java] (done) | time=15ms
> 2018-09-17T09:33:11.4772019Z INFO: Sensor Web [web]
> 2018-09-17T09:33:11.4772582Z ##[error]at java.lang.ProcessImpl.create(Native Method)
> 	at java.lang.ProcessImpl.<init>(Unknown Source)
> 	at java.lang.ProcessImpl.start(Unknown Source)
> 	... 38 common frames omitted

Has anything changed your end?

Thanks,
Pete


(Alexandre Frigout) #2

Hello Peter,

As you can read in the SonarCSS documentation Node.js >= 6 is a pre-requisite for this plugin.

Greetings,
Alex.


(Peter Connor) #3

Yes sorry, we moved our agents to a new box, which obviously didn’t have this installed. This thread can be closed / deleted now.

Thanks.