Bitbucket pipeline sonarqube-scan hangs with INFO: 429/516 files analyzed, current file:

We have implemented sonarqube-scan and sonarqube-quality-gate as part of a bitbucket pipeline and we regularly get an issue where it will get stuck analysing a single file, before eventually returning a memory issues.

The bitbucket pipeline step appears as per below:

    - step: &Sonarqube-Analysis
        name: Sonarqube - Analysis
        oidc: true
        size: 2x
        script:
          - pipe: sonarsource/sonarqube-scan:2.0.1
            variables:
              SONAR_HOST_URL: ${SONAR_HOST_URL}
              SONAR_TOKEN: ${SONAR_TOKEN}
          - pipe: sonarsource/sonarqube-quality-gate:1.1.0
            variables:
              SONAR_HOST_URL: ${SONAR_HOST_URL}
              SONAR_TOKEN: ${SONAR_TOKEN}
              SONAR_PROJECT_KEY: 'projectkey'

This does not ALWAYS happen but its often enough.

2.0.1: Pulling from sonarsource/sonarqube-scan
9398808236ff: Pulling fs layer
4f4fb700ef54: Pulling fs layer
9d74392e869e: Pulling fs layer
6183bd950e3f: Pulling fs layer
6615a4f3e258: Pulling fs layer
328e6fe4f73a: Pulling fs layer
6183bd950e3f: Waiting
6615a4f3e258: Waiting
328e6fe4f73a: Waiting
4f4fb700ef54: Download complete
9398808236ff: Verifying Checksum
9398808236ff: Download complete
6183bd950e3f: Download complete
9398808236ff: Pull complete
4f4fb700ef54: Pull complete
6615a4f3e258: Verifying Checksum
6615a4f3e258: Download complete
328e6fe4f73a: Verifying Checksum
328e6fe4f73a: Download complete
9d74392e869e: Verifying Checksum
9d74392e869e: Download complete
9d74392e869e: Pull complete
6183bd950e3f: Pull complete
6615a4f3e258: Pull complete
328e6fe4f73a: Pull complete
Digest: sha256:f559720fcbb3bc355b9599666525c3ad80d6b6ab25ecd53aabb029aa583139a7
Status: Downloaded newer image for sonarsource/sonarqube-scan:2.0.1
INFO: Scanner configuration file: /opt/sonar-scanner/conf/sonar-scanner.properties
INFO: Project root configuration file: /opt/atlassian/pipelines/agent/build/sonar-project.properties
INFO: SonarScanner 5.0.1.3006
INFO: Java 17.0.8 Alpine (64-bit)
INFO: Linux 5.15.0-1062-aws amd64
INFO: User cache: /opt/sonar-scanner/.sonar/cache
INFO: Analyzing on SonarQube server 9.9.5.90363
INFO: Default locale: "en_US", source code encoding: "UTF-8" (analysis is platform dependent)
INFO: Load global settings
INFO: Load global settings (done) | time=705ms
INFO: Server id: DA8B86E4-AYlzxk9nQvaG9V4U-XKO
INFO: User cache: /opt/sonar-scanner/.sonar/cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=162ms
INFO: Load/download plugins (done) | time=10576ms
INFO: Process project properties
INFO: Process project properties (done) | time=7ms
INFO: Execute project builders
INFO: Execute project builders (done) | time=1ms
INFO: Project key: projectkey
INFO: Base dir: /opt/atlassian/pipelines/agent/build
INFO: Working dir: /opt/atlassian/pipelines/agent/build/.scannerwork
INFO: Load project settings for component key: 'projectkey'
INFO: Load project settings for component key: 'projectkey' (done) | time=111ms
INFO: Auto-configuring with CI 'Bitbucket Pipelines'
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=163ms
INFO: Load active rules
INFO: Load active rules (done) | time=3663ms
INFO: Load analysis cache
INFO: Load analysis cache | time=160ms
INFO: Load project repositories
INFO: Load project repositories (done) | time=153ms
INFO: Indexing files...
INFO: Project configuration:
INFO:   Excluded sources: **/*.spec.ts, **/*.e2e-spec.ts
INFO:   Included tests: **/*.spec.ts, **/*.e2e-spec.ts
INFO:   Excluded sources for coverage: **/*.spec.ts, **/*.e2e-spec.ts, ./jest*.config.js
INFO: 516 files indexed
INFO: 606 files ignored because of inclusion/exclusion patterns
INFO: 0 files ignored because of scm ignore settings
INFO: Quality profile for ts: Sonar way
INFO: ------------- Run sensors on module projectkey
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=127ms
INFO: Sensor JaCoCo XML Report Importer [jacoco]
INFO: 'sonar.coverage.jacoco.xmlReportPaths' is not defined. Using default locations: target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
INFO: No report imported, no coverage information will be imported by JaCoCo XML Report Importer
INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=3ms
INFO: Sensor TypeScript analysis [javascript]
INFO: Found 1 tsconfig.json file(s): [/opt/atlassian/pipelines/agent/build/tsconfig.json]
INFO: Creating TypeScript program
INFO: TypeScript configuration file /opt/atlassian/pipelines/agent/build/tsconfig.json
INFO: 516 source files to be analyzed
INFO: Creating TypeScript program (done) | time=1174ms
INFO: Starting analysis with current program
........
INFO: 429/516 files analyzed, current file: /opt/atlassian/pipelines/agent/build/src/domain/invoices/invoice-default-handler-template/invoice-default-handler.context.spec.ts
INFO: 429/516 files analyzed, current file: /opt/atlassian/pipelines/agent/build/src/domain/invoices/invoice-default-handler-template/invoice-default-handler.context.spec.ts
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).
time="2024-06-24T05:16:50Z" level=error msg="error waiting for container: unexpected EOF"

It will eventually return a ‘Container ‘docker’ exceeded [memory limit]’ in bitbucket pipelines.

Hi,

Welcome to the community!

Would you be willing to provide that file? Privately if not publicly?

 
Thx,
Ann