SonarCloud Bitbucket timing out

Hi,

I am facing an issue where my pipelines are timing out because of SonarCloud. The logs show a NodeJS exception. How can this issue be resolved? Details are below!

Greetings Niek

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:149)
	at org.sonar.plugins.javascript.eslint.EslintBridgeServerImpl.startServerLazily(EslintBridgeServerImpl.java:230)
	at org.sonar.plugins.javascript.eslint.AbstractEslintSensor.execute(AbstractEslintSensor.java:66)
	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:452)
	at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:448)
	at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:406)
	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:130)
	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: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(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	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)
  • ALM used: Bitbucket Cloud
  • CI system used: Bitbucket Cloud
  • Languages of the repository: Python

Full log available here:
pipelineLog-{54b5905d-9939-48ac-8a23-7cece0144dbb}.txt (17.2 KB)

Bitbucket pipeline config:
bitbucket-pipelines.txt (1.0 KB)

Hey there.

Thanks for the report.

This is an interesting case:

  • You’re using the python:3.9 image, where I don’t expect NodeJS to be installed
  • You only have JSON, Python, and YAML files indexed by the scanner
  • The timeout is at Sensor JavaScript inside YAML analysis [javascript] (recently we started analyzing Javascript inside YAML files)

What kind of YAML files are in your repository? Just pipeline configuration, Infrastructure as Code (IAC), or something else?

In any case, I’ll flag this thread for some expert attention. You could probably get past the timeout (and the sensor triggering at all) by adding -Dsonar.exclusions=**/*.yml,**/*.yaml

Hi!

Thanks for the quick response. This repo is pure Python with some JSON and YAML config files. I added an exclusion for indexing YAML files, will report back in a few days if this solves the issue!

PS: the .yaml file in question is a pre-commit-config.yaml file:

repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v4.2.0
    hooks:
      - id: check-docstring-first # Checks for a common error of placing code before the docstring.
      - id: double-quote-string-fixer # Replaces double quoted strings with single quoted strings.
      - id: end-of-file-fixer # Makes sure files end in a newline and only a newline.
  - repo: https://gitlab.com/pycqa/flake8
    rev: 3.9.2
    hooks:
      - id: flake8

Hello Niek,

We recently introduced the support of JavaScript code analysis inside YAML files for AWS. We will do the same for Python sometime in the future.

In any case, given the feedback you shared, it seems that we need to refine our detection of inline JavaScript code in AWS configuration files.

I created this ticket to address this issue as soon as possible. In the meantime, you can indeed apply the workaround suggested by Colin.

Hope this helps,
Yassin

1 Like

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