Sonar-scanner cli failing to analyze CSS

I’m encountering errors when running the sonar-scanner. It appeared today and I haven’t found any topic discussing it yet.

Details:

  • runtime:
    • SonarScanner 4.5.0.2216
    • Java 11.0.6 AdoptOpenJDK (64-bit)
    • Linux 4.19.78-coreos amd64
    • Gitlab CI on gitlab.com

Error observed:

INFO: Sensor SonarCSS Rules [cssfamily]
ERROR: (node:47) ExperimentalWarning: The ESM module loader is experimental.
ERROR: internal/modules/run_main.js:54
ERROR:     internalBinding('errors').triggerUncaughtException(
ERROR:                               ^
ERROR: 
ERROR: TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension "" for /builds/gaspacchio/back-to-the-future/.scannerwork/css-bundle/bin/server
ERROR:     at Loader.defaultGetFormat [as _getFormat] (internal/modules/esm/get_format.js:65:15)
ERROR:     at Loader.getFormat (internal/modules/esm/loader.js:113:42)
ERROR:     at Loader.getModuleJob (internal/modules/esm/loader.js:244:31)
ERROR:     at processTicksAndRejections (internal/process/task_queues.js:97:5)
ERROR:     at async Loader.import (internal/modules/esm/loader.js:178:17) {
ERROR:   code: 'ERR_UNKNOWN_FILE_EXTENSION'
ERROR: }
ERROR: CSS rules were not executed. Failed to start server (60s timeout)
org.sonarsource.nodejs.NodeCommandException: Failed to start server (60s timeout)
	at org.sonar.css.plugin.server.CssAnalyzerBridgeServer.startServer(CssAnalyzerBridgeServer.java:110)
	at org.sonar.css.plugin.server.CssAnalyzerBridgeServer.startServerLazily(CssAnalyzerBridgeServer.java:173)
	at org.sonar.css.plugin.CssRuleSensor.execute(CssRuleSensor.java:99)
	at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:45)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:75)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:48)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:66)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:48)
	at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:68)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109)
	at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:438)
	at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:434)
	at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:392)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109)
	at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:126)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109)
	at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:58)
	at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:52)
	at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
	at com.sun.proxy.$Proxy0.execute(Unknown Source)
	at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
	at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
	at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
	at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
	at org.sonarsource.scanner.cli.Main.main(Main.java:61)
INFO: Sensor SonarCSS Rules [cssfamily] (done) | time=61472ms

(...)

WARN: Failed to close stylelint-bridge server
java.net.ConnectException: Failed to connect to /127.0.0.1:42541
	at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.java:265)
	at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:183)
	at okhttp3.internal.connection.ExchangeFinder.findConnection(ExchangeFinder.java:224)
	at okhttp3.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFinder.java:108)
	at okhttp3.internal.connection.ExchangeFinder.find(ExchangeFinder.java:88)
	at okhttp3.internal.connection.Transmitter.newExchange(Transmitter.java:169)
	at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:41)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
	at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:94)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
	at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
	at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:88)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
	at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:221)
	at okhttp3.RealCall.execute(RealCall.java:81)
	at org.sonar.css.plugin.server.CssAnalyzerBridgeServer.callClose(CssAnalyzerBridgeServer.java:271)
	at org.sonar.css.plugin.server.CssAnalyzerBridgeServer.clean(CssAnalyzerBridgeServer.java:260)
	at org.sonar.css.plugin.server.CssAnalyzerBridgeServer.stop(CssAnalyzerBridgeServer.java:255)
	at org.sonar.core.platform.StartableCloseableSafeLifecyleStrategy.stop(StartableCloseableSafeLifecyleStrategy.java:38)
	at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.stop(AbstractInjectionFactory.java:88)
	at org.picocontainer.behaviors.AbstractBehavior.stop(AbstractBehavior.java:179)
	at org.picocontainer.behaviors.Stored$RealComponentLifecycle.stop(Stored.java:141)
	at org.picocontainer.behaviors.Stored.stop(Stored.java:118)
	at org.picocontainer.DefaultPicoContainer.stopAdapters(DefaultPicoContainer.java:1048)
	at org.picocontainer.DefaultPicoContainer.stop(DefaultPicoContainer.java:803)
	at org.sonar.core.platform.ComponentContainer.stopComponents(ComponentContainer.java:152)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:111)
	at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:126)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109)
	at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:58)
	at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:52)
	at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
	at com.sun.proxy.$Proxy0.execute(Unknown Source)
	at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
	at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
	at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
	at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
	at org.sonarsource.scanner.cli.Main.main(Main.java:61)
Caused by: java.net.ConnectException: Connection refused (Connection refused)
	at java.base/java.net.PlainSocketImpl.socketConnect(Native Method)
	at java.base/java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
	at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
	at java.base/java.net.AbstractPlainSocketImpl.connect(Unknown Source)
	at java.base/java.net.SocksSocketImpl.connect(Unknown Source)
	at java.base/java.net.Socket.connect(Unknown Source)
	at okhttp3.internal.platform.Platform.connectSocket(Platform.java:130)
	at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.java:263)
	... 47 common frames omitted
INFO: Analysis total time: 1:40.702 s

You can see the full log here: https://gitlab.com/gaspacchio/back-to-the-future/-/jobs/897241732

Steps to reproduce

IDK

Potential workaround

Not found yet.

Hello @Gaspacchio,

which version of Node.JS is installed for the analysis?