Eslint-bridge is unresponsive despite high maxspace

Hello,

I’ve been trying to get js-scan via Jenkins to work for the past few days. There are several topics on this, but none of the solutions there helped me yet…

  • which versions are you using: SonarQube 10.1
  • how is SonarQube deployed: zip
  • what are you trying to achieve: Checking javascript / nodejs / vue via Jenkins (2.40) scanner plugin (2.15)
  • what have you tried so far to achieve this: Increased maxspace to 16k, switchet nodjs versions, excluded js libraries from scans.

Also attached:
tsconfig.sonar.json (702 Bytes)
Jenkinsfile.txt (1.3 KB)

Log with -X (removed linter stuff to avoid massive amounts of text)

08:24:58.935 INFO: Sensor JavaScript/TypeScript analysis [javascript]
08:24:58.957 DEBUG: Deploying bundle
08:24:58.957 DEBUG: Deploying eslint-bridge into /var/lib/jenkins/workspace/SonarQube_Test/.scannerwork/.s
onartmp/eslint-bridge-bundle
08:25:06.296 DEBUG: Deploying bundle (done) | time=7339ms
08:25:06.300 DEBUG: Starting server
08:25:06.326 DEBUG: Using default Node.js executable: 'node'.
08:25:06.326 DEBUG: Checking Node.js version
08:25:06.328 DEBUG: Launching command node -v
08:25:06.474 DEBUG: Using Node.js v16.20.2.
08:25:06.474 DEBUG: Starting Node.js process to start eslint-bridge server at port 35598
08:25:06.475 DEBUG: Launching command node --max-old-space-size=16384 /var/lib/jenkins/workspace/SonarQube_Test/.scannerwork/.sonartmp/eslint-bridge-bundle/package/bin/server 35598 127.0.0.1 /var/lib/jenkins/workspace/SonarQube_Test/.scannerwork true false 
08:25:13.407 DEBUG: Context set with {"workDir":"/var/lib/jenkins/workspace/SonarQube_Test/.scannerwork","shouldUseTypeScriptParserForJS":true,"sonarlint":false,"bundles":[]}
08:25:13.408 DEBUG: starting eslint-bridge server at port 35598
08:25:13.442 DEBUG: eslint-bridge server is running at port 35598
08:25:13.695 DEBUG: Starting server (done) | time=7395ms
08:25:13.706 INFO: 613 source files to be analyzed
08:25:13.734 DEBUG: Analysis of unchanged files will not be skipped (current analysis requires all files to be analyzed)
08:25:13.736 INFO: Resolving TSConfig files using 'tsconfig.sonar.json' from property sonar.typescript.tsconfigPaths
08:25:13.736 DEBUG: Using 'tsconfig.sonar.json' to resolve TSConfig file(s)
08:25:13.748 INFO: Found 1 TSConfig file(s): [/var/lib/jenkins/workspace/SonarQube_Test/tsconfig.sonar.json]
08:25:13.954 DEBUG: Creating linter config
08:25:14.150 DEBUG: Cache strategy set to 'WRITE_ONLY' for file 'src/main/webapp/v4user/static/jquery/plugins/jquery-validate/lib/jquery.metadata.js' as current analysis requires all files to be analyzed
08:25:14.161 DEBUG: Analyzing file: file:///var/lib/jenkins/workspace/SonarQube_Test/src/main/webapp/v4user/static/jquery/plugins/jquery-validate/lib/jquery.metadata.js
08:25:14.193 DEBUG: Analyzing file "/var/lib/jenkins/workspace/SonarQube_Test/src/main/webapp/v4user/static/jquery/plugins/jquery-validate/lib/jquery.metadata.js" with linterId "default"
08:25:23.707 INFO: 1/613 file analyzed, current file: /var/lib/jenkins/workspace/SonarQube_Test/src/main/webapp/v4user/static/jquery/plugins/jquery-validate/lib/jquery.metadata.js
08:25:33.744 INFO: 1/613 file analyzed, current file: /var/lib/jenkins/workspace/SonarQube_Test/src/main/webapp/v4user/static/jquery/plugins/jquery-validate/lib/jquery.metadata.js
08:25:38.125 ERROR: eslint-bridge Node.js process is unresponsive. This is most likely caused by process running out of memory. Consider setting sonar.javascript.node.maxspace to higher value (e.g. 4096).
08:25:38.200 ERROR: Failed to get response while analyzing file:///var/lib/jenkins/workspace/SonarQube_Test/src/main/webapp/v4user/static/jquery/plugins/jquery-validate/lib/jquery.metadata.js
java.lang.IllegalStateException: eslint-bridge is unresponsive
	at org.sonar.plugins.javascript.eslint.EslintBridgeServerImpl.request(EslintBridgeServerImpl.java:386)
	at org.sonar.plugins.javascript.eslint.EslintBridgeServerImpl.analyzeJavaScript(EslintBridgeServerImpl.java:340)
	at org.sonar.plugins.javascript.eslint.JsTsSensor.analyze(JsTsSensor.java:152)

Hey there.

  • Can you try upgrading to SonarQube v10.2?
  • It looks like these javascript files are in a /lib/ folder and likely not user controlled code. I would encourrage adding an exclusion such as **/static/**/* or **/jquery/**/*.

Alright, updated to 10.2 and added the exclude, still doesn’t work.

13:48:53.679 INFO: Analyzing 557 files using tsconfig: /var/lib/jenkins/workspace/SonarQube_Test/tsconfig.sonar.json
13:48:53.685 INFO: 557 source files to be analyzed
13:48:53.703 DEBUG: Cache strategy set to 'WRITE_ONLY' for file 'front_end/src/mixins/fields/MultiSelectField.js' as current analysis requires all files to be analyzed
13:48:53.704 DEBUG: Analyzing file: file:///var/lib/jenkins/workspace/SonarQube_Test/front_end/src/mixins/fields/MultiSelectField.js
13:48:53.715 DEBUG: Analyzing file "/var/lib/jenkins/workspace/SonarQube_Test/front_end/src/mixins/fields/MultiSelectField.js" with linterId "default"
13:49:03.721 INFO: 0/557 files analyzed, current file: /var/lib/jenkins/workspace/SonarQube_Test/front_end/src/mixins/fields/MultiSelectField.js
13:49:13.871 INFO: 0/557 files analyzed, current file: /var/lib/jenkins/workspace/SonarQube_Test/front_end/src/mixins/fields/MultiSelectField.js
13:49:14.746 ERROR: the bridge Node.js process is unresponsive. This is most likely caused by process running out of memory. Consider setting sonar.javascript.node.maxspace to higher value (e.g. 4096).
13:49:14.795 ERROR: Failure during analysis, Node.js command to start the bridge was: node --max-old-space-size=16384 /var/lib/jenkins/workspace/SonarQube_Test/.scannerwork/.sonartmp/bridge-bundle/package/bin/server 46552 127.0.0.1 /var/lib/jenkins/workspace/SonarQube_Test/.scannerwork true false 
java.lang.IllegalStateException: the bridge is unresponsive
	at org.sonar.plugins.javascript.eslint.BridgeServerImpl.request(BridgeServerImpl.java:392)
	at org.sonar.plugins.javascript.eslint.BridgeServerImpl.analyzeJavaScript(BridgeServerImpl.java:341)
	at org.sonar.plugins.javascript.eslint.AnalysisWithWatchProgram.analyze(AnalysisWithWatchProgram.java:152)

I also changed module + target to ESNext - i initially assumed I had to specify the name of my module there, but the error-log (and IntelliJ) pointed out the available options.

Hi @Sirax,

Are you using sonar.exclusions or just the tsconfig exclude attribute? Can you add sonar.exclusions as a scanner parameter?

sonar.exclusions=

Is is possible for you to share the project tree and point to what folders you would like to have excluded?

Cheers,
Victor

Exclusions aren’t the problem here, they work (I just use the tsconfig), or do you think the way I do them causes this?

The file in my last post (MultiSelectField.js) was indeed a file that I wanted checked, however node seems to crash with the very first file checked… so clearly something is wrong, I just can’t figure out what.

I’ve added the entire Stacktrace:
stacktrace.txt (7.0 KB)

Hi @Sirax,

can you send me the full debug logs? I’m writing you privately so you can share them with me.