Eslint-bridge is unresponsive - connection refused

Hi, we have similar problem, when using sonar scanner 4.7.0.2747, SonarQube Enterprise version 9.4.0.54424
Before this error in the log we recieve the following warning^

WARN: Dispose of component org.sonar.plugins.javascript.eslint.EslintBridgeServerImpl failed
java.lang.IllegalStateException: eslint-bridge is unresponsive
	at org.sonar.plugins.javascript.eslint.EslintBridgeServerImpl.request(EslintBridgeServerImpl.java:270)
	at org.sonar.plugins.javascript.eslint.EslintBridgeServerImpl.clean(EslintBridgeServerImpl.java:361)
	at org.sonar.plugins.javascript.eslint.EslintBridgeServerImpl.stop(EslintBridgeServerImpl.java:393)
	at org.sonar.core.platform.StartableBeanPostProcessor.postProcessBeforeDestruction(StartableBeanPostProcessor.java:48)
	at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:197)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:587)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:559)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingleton(DefaultListableBeanFactory.java:1161)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:520)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingletons(DefaultListableBeanFactory.java:1154)
	at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1106)
	at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1075)
	at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:1021)
	at org.sonar.core.platform.SpringComponentContainer.stopComponents(SpringComponentContainer.java:196)
	at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:172)
	at org.sonar.scanner.bootstrap.SpringGlobalContainer.doAfterStart(SpringGlobalContainer.java:134)
	at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
	at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
	at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72)
	at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:66)
	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
	at java.net.http/jdk.internal.net.http.HttpClientImpl.send(Unknown Source)
	at java.net.http/jdk.internal.net.http.HttpClientFacade.send(Unknown Source)
	at org.sonar.plugins.javascript.eslint.EslintBridgeServerImpl.request(EslintBridgeServerImpl.java:262)
	... 31 common frames omitted
Caused by: java.net.ConnectException: Connection refused
	at java.base/sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
	at java.base/sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source)
	at java.net.http/jdk.internal.net.http.PlainHttpConnection$ConnectEvent.handle(Unknown Source)
	at java.net.http/jdk.internal.net.http.HttpClientImpl$SelectorManager.handleEvent(Unknown Source)
	at java.net.http/jdk.internal.net.http.HttpClientImpl$SelectorManager.lambda$run$3(Unknown Source)
	at java.base/java.util.ArrayList.forEach(Unknown Source)
	at java.net.http/jdk.internal.net.http.HttpClientImpl$SelectorManager.run(Unknown Source)

Good day. Do you have any ideas?

Hey,

Does this problem happen every analysis?
Could you provide full debug logs?
Which version of Node are you using?

Hi, you mean run the scan in debug mode?

Does this problem happen every analysis?
Yes

Which version of Node are you using?
node12.16.1

Try to update Node to at least 12.22. Or better 14 or 16, 12 is deprecated now.

Hi, upgrade sonarqube to 9.5 and Node 16.15.1 solves the problem

2 Likes

Good day everyone,

I have faced with same issue, I tried with NodeJS 14 and 16, seems the issue still occurs.

I have integrated with bitbucket pipelines, and sonar scan has been stucked at scan typescript file:

Images used:
    build : docker.io/atlassian/default-image@sha256:d4b1cc074a5ac1ee5d9702a536b8a8456554732df70f4b55fd85515e4b106f8d
+ nvm install 16.15.1
Downloading and installing node v16.15.1...
Downloading https://nodejs.org/dist/v16.15.1/node-v16.15.1-linux-x64.tar.xz...

#######################################################################   99.2%
######################################################################## 100.0%
Computing checksum with sha256sum
Checksums matched!
Now using node v16.15.1 (npm v8.11.0)

+ docker run --rm -e SONAR_HOST_URL="$SONAR_URL" -e SONAR_LOGIN="$SONAR_TOKEN" -v "$PWD:/usr/src" sonarsource/sonar-scanner-cli -Dsonar.projectKey=$SONAR_PROJECT -Dsonar.branch.name=$BITBUCKET_BRANCH
INFO: Scanner configuration file: /opt/sonar-scanner/conf/sonar-scanner.properties
INFO: Project root configuration file: /usr/src/sonar-project.properties
INFO: SonarScanner 5.0.1.3006
INFO: Java 17.0.8 Alpine (64-bit)
INFO: Linux 5.15.0-1055-aws amd64
INFO: User cache: /opt/sonar-scanner/.sonar/cache
INFO: Analyzing on SonarQube server 8.9.2
INFO: Default locale: "en_US", source code encoding: "UTF-8" (analysis is platform dependent)
INFO: Load global settings
INFO: Load global settings (done) | time=603ms
INFO: Server id: [server-id]
INFO: User cache: /opt/sonar-scanner/.sonar/cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=107ms
INFO: Load/download plugins (done) | time=6641ms
INFO: Process project properties
INFO: Process project properties (done) | time=0ms
INFO: Execute project builders
INFO: Execute project builders (done) | time=4ms
INFO: Project key: tag-consumer-fe
INFO: Base dir: /usr/src
INFO: Working dir: /usr/src/.scannerwork
INFO: Load project settings for component key: '[project-key]'
INFO: Load project settings for component key: '[project-key]' (done) | time=95ms
INFO: Load project branches
INFO: Load project branches (done) | time=91ms
INFO: Load project pull requests
INFO: Load project pull requests (done) | time=295ms
INFO: Load branch configuration
INFO: Load branch configuration (done) | time=4ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=124ms
INFO: Load active rules
INFO: Load active rules (done) | time=1850ms
INFO: Branch name: [branch-name]
INFO: Indexing files...
INFO: Project configuration:
INFO:   Excluded sources: **/mapData/**/*, **/mapData.ts, **/svgIcons/**/*, **/assets/**/*, **/*.json
INFO:   Excluded sources for coverage: **/mapData.ts, **/mapData/**/*, **/*.json, **/assets/**/*, **/svgIcons/**/*
INFO: Load project repositories
INFO: Load project repositories (done) | time=116ms
INFO: 864 files indexed
INFO: 113 files ignored because of inclusion/exclusion patterns
INFO: 0 files ignored because of scm ignore settings
INFO: Quality profile for css: Sonar way
INFO: Quality profile for js: Sonar way
INFO: Quality profile for ts: Sonar way for FE
INFO: Quality profile for web: Sonar way
INFO: ------------- Run sensors on module [project-key]
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=84ms
INFO: Sensor CSS Metrics [cssfamily]
INFO: Sensor CSS Metrics [cssfamily] (done) | time=99ms
INFO: Sensor CSS Rules [cssfamily]
INFO: 2 source files to be analyzed
INFO: 2/2 source files have been analyzed
INFO: Sensor CSS Rules [cssfamily] (done) | time=2197ms
INFO: Sensor JaCoCo XML Report Importer [jacoco]
INFO: 'sonar.coverage.jacoco.xmlReportPaths' is not defined. Using default locations: target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
INFO: No report imported, no coverage information will be imported by JaCoCo XML Report Importer
INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=15ms
INFO: Sensor JavaScript analysis [javascript]
WARN: Node.js version 18 is not supported, you might experience issues. Please use a supported version of Node.js [10, 12, 14, 15]
INFO: 12 source files to be analyzed
ERROR: Browserslist: caniuse-lite is outdated. Please run:
ERROR: npx browserslist@latest --update-db
ERROR: 
ERROR: Why you should do it regularly:
ERROR: https://github.com/browserslist/browserslist#browsers-data-updating
INFO: 12/12 source files have been analyzed
INFO: Sensor JavaScript analysis [javascript] (done) | time=6869ms
INFO: Sensor TypeScript analysis [javascript]
INFO: Found 1 https://bitbucket.org/org-id/project-id/src/b0e32c0a4752c01b2aa36a0f6dcb319ad53a5ca3/tsconfig.json file(s): [/usr/src/tsconfig.json]
INFO: Analyzing 817 files using tsconfig: /usr/src/tsconfig.json
INFO: 828 source files to be analyzed
INFO: 0/828 files analyzed, current file: https://bitbucket.org/org-id/project-id/src/b0e32c0a4752c01b2aa36a0f6dcb319ad53a5ca3/src/fileName.tsx
INFO: 0/828 files analyzed, current file: https://bitbucket.org/org-id/project-id/src/b0e32c0a4752c01b2aa36a0f6dcb319ad53a5ca3/src/fileName.tsx
INFO: 0/828 files analyzed, current file: https://bitbucket.org/org-id/project-id/src/b0e32c0a4752c01b2aa36a0f6dcb319ad53a5ca3/src/fileName.tsx
INFO: 0/828 files analyzed, current file: https://bitbucket.org/org-id/project-id/src/b0e32c0a4752c01b2aa36a0f6dcb319ad53a5ca3/src/fileName.tsx
INFO: 0/828 files analyzed, current file: https://bitbucket.org/org-id/project-id/src/b0e32c0a4752c01b2aa36a0f6dcb319ad53a5ca3/src/fileName.tsx
INFO: 0/828 files analyzed, current file: https://bitbucket.org/org-id/project-id/src/b0e32c0a4752c01b2aa36a0f6dcb319ad53a5ca3/src/fileName.tsx
ERROR: Failed to get response while analyzing https://bitbucket.org/org-id/project-id/src/b0e32c0a4752c01b2aa36a0f6dcb319ad53a5ca3/src/fileName.tsx
java.net.ConnectException: Failed to connect to /127.0.0.1:40293

any solutions to help me overcome this?

Thank you very much.

Hi,

Your version is past EOL. You should upgrade to either the latest version or the current LTA (long-term active version) at your earliest convenience. Your upgrade path is:

8.9.2 → 9.9.4 → 10.4 (last step optional)

You may find these resources helpful:

If you have questions about upgrading, feel free to open a new thread for that here.

If your error persists after upgrade, please come back to us.

Thanks Colin for your comment.

I will try to upgrade my sonarqube server.

And I am concerned about why I am able to run locally without any issues, and also other projects with the same configuration are running very smoothly, except for this project, which always gets stuck.