Server failures - mine or sonarcloud?

We have a new account (team-evergreen) and I am trying to get it configured for our mono-repo. WE consistently get the two errors below. There is also a warning in the banner on our dashboard page: JavaScript and/or TypeScript rules were not executed. Failed to start server (60s timeout)

Looking for help interpreting the errors and suggestions for solving.

Thanks

  • ALM
    Gitlab
  • CI
    Gitlab
  • Scanner command used
    sonar-scanner
  • Languages of the repository
    typescript/javascript
  • Error observed
ERROR: Error requesting server status. Server is probably dead.
 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.isAlive(EslintBridgeServerImpl.java:224)
 	at org.sonar.plugins.javascript.eslint.EslintBridgeServerImpl.startServerLazily(EslintBridgeServerImpl.java:163)
 	at org.sonar.plugins.javascript.eslint.AbstractEslintSensor.execute(AbstractEslintSensor.java:106)
 	at org.sonar.plugins.javascript.eslint.TypeScriptSensor.execute(TypeScriptSensor.java:53)
 	at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:34)
 	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:71)
 	at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:45)
 	at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:63)
 	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:45)
 	at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:68)
 	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:122)
 	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:108)
 	at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:400)
 	at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:396)
 	at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:393)
 	at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:354)
 	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:122)
 	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:108)
 	at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:127)
 	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:122)
 	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:108)
 	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.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)
 	... 35 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)
 	... 54 common frames omitted
 INFO: Using TypeScript at: '/builds/team-evergreen/evergreen-serverless/packages/locator/node_modules'
 ERROR: events.js:174
 ERROR:       throw er; // Unhandled 'error' event
 ERROR:       ^
 ERROR: 
 ERROR: Error: listen EADDRINUSE: address already in use :::37133
 ERROR:     at Server.setupListenHandle [as _listen2] (net.js:1279:14)
 ERROR:     at listenInCluster (net.js:1327:12)
 ERROR:     at Server.listen (net.js:1414:7)
 ERROR:     at Function.listen (/builds/team-evergreen/evergreen-serverless/.scannerwork/.sonartmp/eslint-bridge-bundle/package/node_modules/express/lib/application.js:618:24)
 ERROR:     at resolve (/builds/team-evergreen/evergreen-serverless/.scannerwork/.sonartmp/eslint-bridge-bundle/package/lib/server.js:44:22)
 ERROR:     at new Promise (<anonymous>)
 ERROR:     at startServer (/builds/team-evergreen/evergreen-serverless/.scannerwork/.sonartmp/eslint-bridge-bundle/package/lib/server.js:15:12)
 ERROR:     at Object.start (/builds/team-evergreen/evergreen-serverless/.scannerwork/.sonartmp/eslint-bridge-bundle/package/lib/server.js:10:12)
 ERROR:     at Object.<anonymous> (/builds/team-evergreen/evergreen-serverless/.scannerwork/.sonartmp/eslint-bridge-bundle/package/bin/server:4:8)
 ERROR:     at Module._compile (internal/modules/cjs/loader.js:778:30)
 ERROR: Emitted 'error' event at:
 ERROR:     at emitErrorNT (net.js:1306:8)
 ERROR:     at process._tickCallback (internal/process/next_tick.js:63:19)
 ERROR:     at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)
 ERROR:     at startup (internal/bootstrap/node.js:283:19)
 ERROR:     at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
 ERROR: Failed to start server (60s timeout)
 org.sonarsource.nodejs.NodeCommandException: Failed to start server (60s timeout)
 	at org.sonar.plugins.javascript.eslint.EslintBridgeServerImpl.startServer(EslintBridgeServerImpl.java:112)
 	at org.sonar.plugins.javascript.eslint.EslintBridgeServerImpl.startServerLazily(EslintBridgeServerImpl.java:168)
 	at org.sonar.plugins.javascript.eslint.AbstractEslintSensor.execute(AbstractEslintSensor.java:106)
 	at org.sonar.plugins.javascript.eslint.TypeScriptSensor.execute(TypeScriptSensor.java:53)
 	at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:34)
 	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:71)
 	at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:45)
 	at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:63)
 	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:45)
 	at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:68)
 	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:122)
 	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:108)
 	at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:400)
 	at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:396)
 	at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:393)
 	at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:354)
 	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:122)
 	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:108)
 	at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:127)
 	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:122)
 	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:108)
 	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 TypeScript analysis [javascript] (done) | time=161770ms

and

INFO: Analysis report uploaded in 9425ms
 INFO: ANALYSIS SUCCESSFUL, you can find the results at: https://sonarcloud.io/dashboard?id=team-evergreen_evergreen-serverless&branch=master
 INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
 INFO: More about the report processing at https://sonarcloud.io/api/ce/task?id=AXEroVsWf-jtfSi2V0qj
 WARN: Failed to close server
 java.net.ConnectException: Failed to connect to localhost/0:0:0:0:0:0:0:1:38775
 	at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.java:249)

Hey there!

To analyze Javascript/Typescript and a few other languages, the SonarQube scanner starts up a node subprocess that runs a local NodeJS server for the scanner to communicate with. Here it seems this subprocess is failing to start. Can you share the version of Node.js you have on your machine?

Are you aware of anything special on your computer that could block this subprocess? (antivirus/firewall software maybe?)

The service is running in gitlab using a docker container based on an alpine image for node 10.19

    FROM node:10.19.0-alpine

    RUN apk update \
        && apk add openjdk8-jre git python jq curl openssh-client \
        && curl -O https://bootstrap.pypa.io/get-pip.py \
        && python get-pip.py \
        && pip install awscli \
        && mkdir -p ~/.ssh && chmod 700 ~/.ssh \
        && npm install -g serverless@1.42.2

no antivirus, I assume minimal firewall?

Thanks for the further info. Can you share the full logs of your analysis? (or at least, everything between:

INFO: Sensor JavaScript analysis [javascript]
INFO: Sensor TypeScript analysis [javascript] (done)

I put it on GDocs:

Any feedback?

Correction on the image used. It runs in sonarsource/sonar-scanner-cli:latest

I hate to be a pain, but can you please provide .txt or .log format logs? A PDF is really difficult to sift through.

The problem has been resolved. I had an issue with how I had projectDir configured for modules. I don’t know how or if that impacted the connection issue, or if that resolved itself for some other reason, but I have it working now. Thanks

I spoke prematurely - the problem is NOT resolved. Sonar Run issues

Trying to run sonar in gitlab using the sonar docker image: sonarsource/sonar-scanner-cli:latest

I am still not able to get complete results. I see the following error in the attached log:

Line 138: WARN: locking FileBasedConfig[/home/scanner-cli/.config/jgit/config] failed after 5 retries

Line 198-202: WARNING: An illegal reflective access operation has occurred

Line 408-413: 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).

Line 500: ERROR: Error requesting server status. Server is probably dead.

Line579+: ERROR: Error: listen EADDRINUSE: address already in use :::42381

Line 731: WARN: Failed to close server

Our trial period is running out and I would really like to get this working before it does so my manager will approve the subscription.

Full output at https://www.dropbox.com/s/wlm31yqdk33mptf/sonar-job.txt?dl=0

It’s helpful to know that sometimes Typescript analysis is succeeding!

INFO: Sensor TypeScript analysis [javascript]
INFO: Using /builds/team-evergreen/evergreen-serverless/packages/shortener/tsconfig.json from sonar.typescript.tsconfigPath property
INFO: 14 source files to be analyzed
INFO: Analyzing 14 files using tsconfig: /builds/team-evergreen/evergreen-serverless/packages/shortener/tsconfig.json
INFO: 0/14 files analyzed, current file: shortener/src/function/shorten.ts
INFO: 14/14 source files have been analyzed
INFO: Sensor TypeScript analysis [javascript] (done) | time=15755ms

The error message is pretty presccriptive:

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).

Have you tried this? How much memory is available in the context of where your analysis is running?

Sorry, I meant to be proactive in communicating that: sonar.javascript.node.maxspace=4096
**>>**How much memory is available in the context of where your analysis is running?<< Not sure how to answer that except to say it is running in the sonar docker image?


I get the same error at 6144MB