SonarCloud - java.lang.IllegalStateException: The bridge server is unresponsive

Hi, I am trying to scan my code which is a frontend app that is react.js with a bunch a lot of files to scan. But when applying it to the pipelines, it gets stuck at certain count of files and won’t continue. My backend repositories scans seems fine (but with less line of code)

Context: running the pipeline through bitbucket pipelines with image sonarsource/sonarcloud-scan:2.0.0

The errors looks like this.

ERROR: Failure during analysis
java.lang.IllegalStateException: The bridge server is unresponsive
	at org.sonar.plugins.javascript.bridge.BridgeServerImpl.request(BridgeServerImpl.java:403)
	at org.sonar.plugins.javascript.bridge.BridgeServerImpl.analyzeJavaScript(BridgeServerImpl.java:361)
	at org.sonar.plugins.javascript.bridge.AnalysisWithProgram.analyze(AnalysisWithProgram.java:162)
	at org.sonar.plugins.javascript.bridge.AnalysisWithProgram.analyzeProgram(AnalysisWithProgram.java:133)
	at org.sonar.plugins.javascript.bridge.AnalysisWithProgram.analyzeFiles(AnalysisWithProgram.java:94)
	at org.sonar.plugins.javascript.bridge.JsTsSensor.analyzeFiles(JsTsSensor.java:132)
	at org.sonar.plugins.javascript.bridge.AbstractBridgeSensor.execute(AbstractBridgeSensor.java:76)
	at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:62)
	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:64)
	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:180)
	at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:176)
	at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:147)
	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.ScannerContainer.doAfterStart(ScannerContainer.java:399)
	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:127)
	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:57)
	at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:51)
	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(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
	at jdk.proxy1/jdk.proxy1.$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:126)
	at org.sonarsource.scanner.cli.Main.execute(Main.java:81)
	at org.sonarsource.scanner.cli.Main.main(Main.java:62)
Caused by: java.net.http.HttpTimeoutException: request timed out
	at java.net.http/jdk.internal.net.http.HttpClientImpl.send(HttpClientImpl.java:571)
	at java.net.http/jdk.internal.net.http.HttpClientFacade.send(HttpClientFacade.java:123)
	at org.sonar.plugins.javascript.bridge.BridgeServerImpl.request(BridgeServerImpl.java:398)
	... 39 common frames omitted```

I was wondering if this due to the lines of code being too much?

Hey there.

We should be able to handle a large amount of files. If it can’t – let’s figure out why.

  • Can you share your full Bitbucket Pipelines YAML?
  • Can you also share the logs preceding the failure?
1 Like

I am having the exact same issue.
here’s the relevant part of my pipelines yaml:

image: node:13.14.0

options:
  size: 2x

pipelines:
  branches:
    '{master,v*.*.hotfix}':
	- step:
		size: 2x
		clone:
		  depth: full
		script:
		  - pipe: sonarsource/sonarcloud-scan:2.0.0
		  # - pipe: sonarsource/sonarcloud-quality-gate:0.1.6
		services:
		  - docker
definitions:
  services:
    docker:
      memory: 2048

and the log
pipelineLog-{7a8f37fc-2cd6-4934-a575-6af0fe3796bb}.txt (27.1 KB)

1 Like

Sure, heres the bitbucket pipelines file

image: feeni/node-chrome:latest

clone:
  depth: full              # SonarCloud scanner needs the full history to assign issues properly

definitions:
  caches:
    sonar: ~/.sonar/cache  # Caching SonarCloud artifacts will speed up your build

pipelines:
  branches:
    master:
      - step:
          name: SonarCloud Analysis (Branch)
          image: sonarsource/sonar-scanner-cli:latest
          caches:
            - node
            - sonar
          script:
            - pipe: sonarsource/sonarcloud-scan:2.0.0
              variables:
                SONAR_TOKEN: ${SONAR_TOKEN}
            - pipe: sonarsource/sonarcloud-quality-gate:0.1.6

pipelineLog-{ac7a518d-f557-4516-adaf-c1817bc585f9}.txt (29.0 KB)

Thanks, before.

I’m having the same exact issue today.
Failing randomly after a while:


The number of files analyzed is always varying for the same exact code.

Are there any updates on this? This is blocking our pipeline.

2 Likes

We are having the same issue now. When we set up sonar cloud initially we got this error but it was fixed by removing node_modules. Now this is happening again? Why is this so unstable?

Hey y’all.

Normally this issue should be addressed by granting more memory to the pipeline. It’s an issue that’s been discussed extensively in this thread:

And some users have had to fiddle with the exact memory

2 Likes