Eslint-bridge is unresponsive when analyzing JS project

Hey Guys,

None of the above solution worked for me.

using sonarqube 8.5 , nodejs>=10, language javascript,scanner version 4.5.0.2216

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).
ERROR: Failure during analysis, Node.js command to start eslint-bridge was: /opt/node-v12.18.3-linux-x64/bin/node --max-old-space-size=12288 /home/jenkins/repo/.scannerwork/.sonartmp/eslint-bridge-bundle/package/bin/server 27741 127.0.0.1 /home/jenkins/repo/.scannerwork true

sonar.properties file has the below contents

sonar.projectBaseDir=.
sonar.projectKey=repo
sonar.projectName=repo
sonar.sources=src/app/modulename
sonar.projectVersion=1.0
sonar.sourceEncoding=UTF-8
sonar.host.url=http://sonarqube-url.com
sonar.nodejs.executable=/opt/node-v12.18.3-linux-x64/bin/node
sonar.javascript.node.maxspace=12288

There is enough RAM is server for both scanner and nodejs task!

Any more suggestion is much appreciated!!!

Hi @Nishwal_Shetty ,

Can you post a new thread with your entire set of scanner logs (add -X to your sonar-scanner command) so we can assist you separate from this thread?

Joe

Hello @Joe

thanks for the reply, attaching the log here.

Please note scan is succesful when size of source files to be analyzed is small (less than 1000 js files)

debug-log.txt (47.6 KB)

Hello @Nishwal_Shetty,

Indeed looking at the logs it seems that analysis of first file is not finished after (hardcoded) timeout of 1 minute. It could be that this file is just big and 1 minute is not enough. Could you confirm the size of src/app/atePac/atePacA6/commons/mainGenerics/PatientScheduleOnPerformStep.js file?

Note that In the latest version of SQ (8.9) this timeout is increased to 5 minutes, so updating could theoretically fix your problem.

Regards,
Elena

Hello @Lena ,

if that is causing the issue , is there a way to increase the timeout ?
file size is 9KB, 270 Lines of Code

Moving to 8.9 currently is not an option for us!

Regards,
Nishwal

Hello @Joe @Lena ,

Any updates on this issue ?

Hey @Nishwal_Shetty

SonarQube v8.5 is no longer a supported version of SonarQube – and the best path forwards is to start preparing your upgrade to v8.9 LTS (you can even stand up a test instance to see if it resolves your issue).

Hey @Colin

i have tested with sonar 8.9 , facing the same issue again.

@Colin

Guys do we have an option to disable eslint bridge from analysis part ?

Sharing eslint bridge console errors below and i have als shared the full debug log with @Lena

11:24:31.534 DEBUG: Deploying bundle
11:24:31.534 DEBUG: Deploying eslint-bridge into /home/jenkins/workspace/Ops/sonar8/.scannerwork/.sonartmp/eslint-bridge-bundle
11:24:42.010 DEBUG: Deploying bundle (done) | time=10476ms
11:24:42.011 DEBUG: Starting server
11:24:42.024 DEBUG: Using default Node.js executable: ‘node’.
11:24:42.024 DEBUG: Checking Node.js version
11:24:42.027 DEBUG: Launching command node -v
11:24:42.039 DEBUG: Using Node.js v12.18.3.
11:24:42.039 DEBUG: Starting Node.js process to start eslint-bridge server at port 9870
11:24:42.039 DEBUG: Launching command node --max-old-space-size=8192 /home/jenkins/workspace/Ops/sonar8/.scannerwork/.sonartmp/eslint-bridge-bundle/package/bin/server 9870 127.0.0.1 /home/jenkins/workspace/Ops/sonar8/.scannerwork true false
11:24:48.583 DEBUG: starting eslint-bridge server at port 9870
11:24:48.610 DEBUG: eslint-bridge server is running at port 9870
11:24:48.667 DEBUG: Starting server (done) | time=6656ms
11:24:49.031 DEBUG: Using generated tsconfig.json file /home/jenkins/workspace/Ops/sonar8/.scannerwork/.sonartmp/7138699270215573057.tmp
11:24:49.125 INFO: 58318 source files to be analyzed
11:24:49.204 DEBUG: initializing linter with hashing,for-loop-increment-sign,accessor-pairs,no-globals-shadowing,no-undefined-assignment,null-dereference,unverified-hostname,line-comment-position,sonar-max-lines-per-function,no-extra-arguments,too-many-break-or-continue-in-loop,nested-control-flow,no-redeclare,constructor-for-side-effects,switch-without-default,post-message,cookie-no-httponly,weak-ssl,no-useless-increment,no-throw-literal,pseudo-random,no-use-of-empty-return-value,session-regeneration,no-associative-arrays,no-weak-keys,confidential-information-logging,no-ip-forward,dns-prefetching,arguments-order,inconsistent-function-call,certificate-transparency,file-uploads,no-inverted-boolean-check,variable-name,no-nested-switch,eol-last,todo-tag,fixme-tag,no-trailing-spaces,no-continue,no-mixed-content,frame-ancestors,array-callback-without-return,prefer-default-last,no-mime-sniff,elseif-without-else,declarations-in-global-scope,no-commented-code,no-gratuitous-expressions,no-empty-pattern,no-referrer-policy,sonar-no-fallthrough,file-name-differ-from-class,max-statements-per-line,curly,strict-transport-security,no-unsafe-finally,prefer-while,sonar-no-unused-vars,index-of-compare-to-positive-number,argument-type,in-operator-type-error,no-template-curly-in-string,prefer-promise-shorthand,prefer-immediate-return,no-intrusive-permissions,disabled-resource-integrity,content-security-policy,no-labels,no-shadow,no-extra-semi,no-redundant-parentheses,no-unenclosed-multiline-block,call-argument-line,generator-without-yield,no-ignored-return,no-caller,no-require-or-define,csrf,cognitive-complexity,use-isnan,no-nested-template-literals,max-switch-cases,no-wildcard-import,production-debug,unused-import,prefer-single-boolean-return,no-redundant-boolean,no-nested-assignment,no-unsafe-unzip,non-number-in-arithmetic-expression,updated-loop-counter,no-setter-return,no-incorrect-string-concat,different-types-comparison,arrow-function-convention,class-prototype,no-case-label-in-switch,no-in-misuse,no-misleading-array-reverse,no-redundant-assignments,file-header,prefer-template,os-command,no-built-in-override,arguments-usage,destructuring-assignment-syntax,operation-returning-nan,radix,no-invariant-returns,values-not-convertible-to-numbers,prefer-object-literal,no-parameter-reassignment,brace-style,no-accessor-field-mismatch,cors,no-collection-size-mischeck,eqeqeq,unverified-certificate,quotes,no-empty-collection,disabled-auto-escaping,updated-const-var,no-duplicate-imports,no-unthrown-error,no-var,no-redundant-jump,no-octal,no-hardcoded-ip,no-identical-functions,no-element-overwrite,no-same-line-conditional,conditional-indentation,super-invocation,no-try-promise,void-use,semi,comma-or-logical-or-case,label-position,no-with,insecure-cookie,no-unused-collection,no-sequences,sql-queries,no-global-this,no-array-delete,no-alphabetical-sort,cyclomatic-complexity,no-for-in-iterable,prefer-for-of,xml-parser-xxe,enforce-trailing-comma,default-param-last,non-existent-operator,new-operator-misuse,no-sparse-arrays,content-length,no-clear-text-protocols,no-invalid-await,no-equals-in-for-termination,no-infinite-loop,no-hardcoded-credentials,no-function-declaration-in-block,no-ternary,no-primitive-wrappers,no-dupe-keys,no-nested-incdec,no-self-assign,for-in,no-new-symbol,no-dupe-args,comma-dangle,strict,no-small-switch,publicly-writable-directories,x-powered-by,no-unreachable,no-identical-expressions,code-eval,file-permissions,no-variable-usage-before-declaration,no-useless-catch,future-reserved-words,array-constructor,no-reference-error,bitwise-operators,hidden-files,no-unused-expressions,no-empty,max-params,object-shorthand,no-magic-numbers,no-duplicated-branches,shorthand-property-grouping,sonar-max-lines,no-one-iteration-loop,max-len,misplaced-loop-counter,no-console,deprecation,no-tab,no-unsafe-negation,function-name,function-inside-loop,no-multi-str,class-name,sonar-block-scoped-var,no-delete-var,encryption-secure-mode,strings-comparison,no-weak-cipher,no-identical-conditions,function-return-type,no-inconsistent-returns,no-all-duplicated-branches,no-unused-function-argument,no-duplicate-string,prefer-const,no-return-await,no-nested-conditional,insecure-jwt-token,no-dead-store,no-implicit-global,expression-complexity,no-collapsible-if,no-empty-function
11:24:59.126 INFO: 0/58318 files analyzed, current file: src/app/corCon/corConF1/controllers/events/ContratoEventoWDBP.js
11:25:09.126 INFO: 0/58318 files analyzed, current file: src/app/corCon/corConF1/controllers/events/ContratoEventoWDBP.js
11:25:19.126 INFO: 0/58318 files analyzed, current file: src/app/corCon/corConF1/controllers/events/ContratoEventoWDBP.js
11:25:29.127 INFO: 0/58318 files analyzed, current file: src/app/corCon/corConF1/controllers/events/ContratoEventoWDBP.js
11:25:39.127 INFO: 0/58318 files analyzed, current file: src/app/corCon/corConF1/controllers/events/ContratoEventoWDBP.js
11:25:49.128 INFO: 0/58318 files analyzed, current file: src/app/corCon/corConF1/controllers/events/ContratoEventoWDBP.js
11:25:59.128 INFO: 0/58318 files analyzed, current file: src/app/corCon/corConF1/controllers/events/ContratoEventoWDBP.js
11:26:09.128 INFO: 0/58318 files analyzed, current file: src/app/corCon/corConF1/controllers/events/ContratoEventoWDBP.js
11:26:19.129 INFO: 0/58318 files analyzed, current file: src/app/corCon/corConF1/controllers/events/ContratoEventoWDBP.js
11:26:29.129 INFO: 0/58318 files analyzed, current file: src/app/corCon/corConF1/controllers/events/ContratoEventoWDBP.js
11:26:39.129 INFO: 0/58318 files analyzed, current file: src/app/corCon/corConF1/controllers/events/ContratoEventoWDBP.js
11:26:49.130 INFO: 0/58318 files analyzed, current file: src/app/corCon/corConF1/controllers/events/ContratoEventoWDBP.js
11:26:59.130 INFO: 0/58318 files analyzed, current file: src/app/corCon/corConF1/controllers/events/ContratoEventoWDBP.js
11:27:09.130 INFO: 0/58318 files analyzed, current file: src/app/corCon/corConF1/controllers/events/ContratoEventoWDBP.js
11:27:19.131 INFO: 0/58318 files analyzed, current file: src/app/corCon/corConF1/controllers/events/ContratoEventoWDBP.js
11:27:29.131 INFO: 0/58318 files analyzed, current file: src/app/corCon/corConF1/controllers/events/ContratoEventoWDBP.js
11:27:39.132 INFO: 0/58318 files analyzed, current file: src/app/corCon/corConF1/controllers/events/ContratoEventoWDBP.js
11:27:49.132 INFO: 0/58318 files analyzed, current file: src/app/corCon/corConF1/controllers/events/ContratoEventoWDBP.js
11:27:59.132 INFO: 0/58318 files analyzed, current file: src/app/corCon/corConF1/controllers/events/ContratoEventoWDBP.js
11:28:09.133 INFO: 0/58318 files analyzed, current file: src/app/corCon/corConF1/controllers/events/ContratoEventoWDBP.js
11:28:19.133 INFO: 0/58318 files analyzed, current file: src/app/corCon/corConF1/controllers/events/ContratoEventoWDBP.js
11:28:29.133 INFO: 0/58318 files analyzed, current file: src/app/corCon/corConF1/controllers/events/ContratoEventoWDBP.js
11:28:39.135 INFO: 0/58318 files analyzed, current file: src/app/corCon/corConF1/controllers/events/ContratoEventoWDBP.js
11:28:49.135 INFO: 0/58318 files analyzed, current file: src/app/corCon/corConF1/controllers/events/ContratoEventoWDBP.js
11:28:59.135 INFO: 0/58318 files analyzed, current file: src/app/corCon/corConF1/controllers/events/ContratoEventoWDBP.js
11:29:09.136 INFO: 0/58318 files analyzed, current file: src/app/corCon/corConF1/controllers/events/ContratoEventoWDBP.js
11:29:19.136 INFO: 0/58318 files analyzed, current file: src/app/corCon/corConF1/controllers/events/ContratoEventoWDBP.js
11:29:29.136 INFO: 0/58318 files analyzed, current file: src/app/corCon/corConF1/controllers/events/ContratoEventoWDBP.js
11:29:39.136 INFO: 0/58318 files analyzed, current file: src/app/corCon/corConF1/controllers/events/ContratoEventoWDBP.js
11:29:49.137 INFO: 0/58318 files analyzed, current file: src/app/corCon/corConF1/controllers/events/ContratoEventoWDBP.js
11:29:49.232 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).
11:29:49.239 ERROR: Failure during analysis, Node.js command to start eslint-bridge was: node --max-old-space-size=8192 /home/jenkins/workspace/Ops/sonar8/.scannerwork/.sonartmp/eslint-bridge-bundle/package/bin/server 9870 127.0.0.1 /home/jenkins/workspace/Ops/sonar8/.scannerwork true false
java.lang.IllegalStateException: eslint-bridge is unresponsive
at org.sonar.plugins.javascript.eslint.EslintBridgeServerImpl.request(EslintBridgeServerImpl.java:233)
at org.sonar.plugins.javascript.eslint.EslintBridgeServerImpl.analyzeJavaScript(EslintBridgeServerImpl.java:211)
at org.sonar.plugins.javascript.eslint.JavaScriptEslintBasedSensor.analyze(JavaScriptEslintBasedSensor.java:132)
at org.sonar.plugins.javascript.eslint.JavaScriptEslintBasedSensor.runEslintAnalysis(JavaScriptEslintBasedSensor.java:112)
at org.sonar.plugins.javascript.eslint.JavaScriptEslintBasedSensor.analyzeFiles(JavaScriptEslintBasedSensor.java:81)
at org.sonar.plugins.javascript.eslint.AbstractEslintSensor.execute(AbstractEslintSensor.java:120)
at org.sonar.plugins.javascript.eslint.JavaScriptEslintBasedSensor.execute(JavaScriptEslintBasedSensor.java:52)
at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:48)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:85)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:59)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:77)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:59)
at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:82)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:392)
at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:388)
at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:357)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:150)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
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.io.InterruptedIOException: timeout
at okhttp3.RealCall.timeoutExit(RealCall.java:108)
at okhttp3.RealCall.execute(RealCall.java:97)
at org.sonar.plugins.javascript.eslint.EslintBridgeServerImpl.request(EslintBridgeServerImpl.java:226)
… 36 common frames omitted
Caused by: java.net.SocketTimeoutException: timeout
at okio.Okio$4.newTimeoutException(Okio.java:232)
at okio.AsyncTimeout.exit(AsyncTimeout.java:286)
at okio.AsyncTimeout$2.read(AsyncTimeout.java:241)
at okio.RealBufferedSource.indexOf(RealBufferedSource.java:358)
at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:230)
at okhttp3.internal.http1.Http1Codec.readHeaderLine(Http1Codec.java:226)
at okhttp3.internal.http1.Http1Codec.readResponseHeaders(Http1Codec.java:202)
at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.java:101)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:45)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:94)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:125)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:264)
at okhttp3.RealCall.execute(RealCall.java:93)
… 37 common frames omitted
Caused by: java.net.SocketException: Socket closed
at java.base/java.net.SocketInputStream.read(Unknown Source)
at java.base/java.net.SocketInputStream.read(Unknown Source)
at okio.Okio$2.read(Okio.java:140)
at okio.AsyncTimeout$2.read(AsyncTimeout.java:237)
… 56 common frames omitted

11:29:49.239 INFO: Sensor JavaScript analysis [javascript] (done) | time=317706ms
11:29:49.239 INFO: Sensor TypeScript analysis [javascript]
11:34:49.243 DEBUG: Deploying bundle
11:34:49.244 DEBUG: Deploying eslint-bridge into /home/jenkins/workspace/Ops/sonar8/.scannerwork/.sonartmp/eslint-bridge-bundle
11:34:58.644 DEBUG: Deploying bundle (done) | time=9401ms
11:34:58.644 DEBUG: Starting server
11:34:58.644 DEBUG: Using default Node.js executable: ‘node’.
11:34:58.644 DEBUG: Checking Node.js version
11:34:58.645 DEBUG: Launching command node -v
11:34:58.659 DEBUG: Using Node.js v12.18.3.
11:34:58.659 DEBUG: Starting Node.js process to start eslint-bridge server at port 27800
11:34:58.659 DEBUG: Launching command node --max-old-space-size=8192 --max-old-space-size=8192 /home/jenkins/workspace/Ops/sonar8/.scannerwork/.sonartmp/eslint-bridge-bundle/package/bin/server 9870 127.0.0.1 /home/jenkins/workspace/Ops/sonar8/.scannerwork true false 27800 127.0.0.1 /home/jenkins/workspace/Ops/sonar8/.scannerwork true false
11:35:07.656 DEBUG: starting eslint-bridge server at port 9870
11:35:07.675 ERROR: events.js:292
11:35:07.675 ERROR: throw er; // Unhandled ‘error’ event
11:35:07.675 ERROR: ^
11:35:07.675 ERROR:
11:35:07.675 ERROR: Error: listen EADDRINUSE: address already in use 127.0.0.1:9870
11:35:07.675 ERROR: at Server.setupListenHandle [as _listen2] (net.js:1313:16)
11:35:07.675 ERROR: at listenInCluster (net.js:1361:12)
11:35:07.675 ERROR: at doListen (net.js:1498:7)
11:35:07.675 ERROR: at processTicksAndRejections (internal/process/task_queues.js:85:21)
11:35:07.675 ERROR: Emitted ‘error’ event on Server instance at:
11:35:07.675 ERROR: at emitErrorNT (net.js:1340:8)
11:35:07.675 ERROR: at processTicksAndRejections (internal/process/task_queues.js:84:21) {
11:35:07.675 ERROR: code: ‘EADDRINUSE’,
11:35:07.675 ERROR: errno: ‘EADDRINUSE’,
11:35:07.675 ERROR: syscall: ‘listen’,
11:35:07.675 ERROR: address: ‘127.0.0.1’,
11:35:07.675 ERROR: port: 9870
11:35:07.675 ERROR: }
11:39:58.692 ERROR: Failed to start server (300s timeout)
org.sonarsource.nodejs.NodeCommandException: Failed to start server (300s timeout)
at org.sonar.plugins.javascript.eslint.EslintBridgeServerImpl.startServer(EslintBridgeServerImpl.java:125)
at org.sonar.plugins.javascript.eslint.EslintBridgeServerImpl.startServerLazily(EslintBridgeServerImpl.java:191)
at org.sonar.plugins.javascript.eslint.AbstractEslintSensor.startBridge(AbstractEslintSensor.java:145)
at org.sonar.plugins.javascript.eslint.AbstractEslintSensor.execute(AbstractEslintSensor.java:119)
at org.sonar.plugins.javascript.eslint.TypeScriptSensor.execute(TypeScriptSensor.java:56)
at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:48)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:85)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:59)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:77)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:59)
at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:82)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:392)
at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:388)
at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:357)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:150)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
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)

11:39:58.692 INFO: Sensor TypeScript analysis [javascript] (done) | time=609453ms

To disable eslint bridge, you would have to disable scanning any JavaScript/TypeScript files. Is that what you want? You can exclude those files with sonar.exclusions property.

That seems like a lot of files. Can you exclude folders/files that you do not want scan? This will help relieve the pressure of memory required to scan all those files.

Hey @Joe

Thanks for the reply!

All 58318 source files are javascript files and i cant exclude them, We are still using sonarqube 6.5 and we have no issue wih analysis there, all 58k are analyzed without any issues!

Also my first scan with sonar 8.9 was successful, but after that analysis is getting stuck with eslint bridge becoming unresponsive from the go!

Can you show this portion of your log? Please rerun your analysis with -X to get debug logs when running sonar-scanner command.

Below is the debug log of eslint bridge
eslintbridge-error.txt (89.6 KB)

@Nishwal_Shetty : I see the error you are encountering now and your setting of sonar.javascript.node.maxspace=18000, which still did not help.

For the purposes of testing, please start with a smaller subset of code and slowly test addition of more folders/files until you notice where the Sonar analysis. You may have such a large code base that increasing sonar.javcript.node.maxspace memory is not enough anymore.

I know you mentioned you cannot exclude them, but you should look closely at your project exclusions to see if this can help your analysis complete. Once you understand how many files it takes to get analysis to completion, then you can try adding back those files/folders.

@Joe i have done a lot of testing on this by using subset of code, it is an intermittent issue, sometime it works for all the 58K javascript files and sometime it doesnt , with subset of code lets say 5000 files to be analyzed it gets choked and eslint bridge becomes unresponsive!

Just listing out some of observation from the scans so far.

1 . we had run full scan analysis(all 58K) files 15 times on the same server with node.maxspace set to be 20GB , scan was succesful 4 times!
2. Tested with subset of code with maximum js files to be anlayzed was 5K in this case analysis does complete 8 out of 10 times but we still see an failure sometimes!

It is a very stange issue related to stability of javascript analysis with newer versions, i agree that we have huge code base but sonarqube 6.5 is still working for us and breaking down the codebase and creating projects for sub set and maintaining it is not an ideal soltuion for us!

Currently when we analyze the first file it is that the semantic for the entire project is build, and if the project is a big one (like yours), timeout of 5 minutes (which is definitely should be enough for one file) is not enough.
We are not happy with this, and are already considering some options to improve this behaviour. Until it is done there is one thing you could do: set sonar.javascript.allowTsParserJsFiles=false. Note it might impact the results of the analysis (some issues will disappear as we have less data), but probably that is good as a temporary solution until we improve this long project build process.

Thanks Elena for the reply

setting sonar.javascript.allowTsParserJsFiles=false will not work for us as we see many files have parsing issue and in our case most of the functions,classes in files were not analyzed.

Please let us know when you have a permanent fix for this

Regards,
Nishwal

Posting here the ticket to fix the analysis of big projects: Allow analysing big projects with TypeScript parser · Issue #2688 · SonarSource/SonarJS · GitHub

@Nishwal_Shetty feel free to post (better in a new thread) those parsing errors.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.