Issue with SonarCloud and Bitbucket Pipelines: Unable to Process .tsx Files

Hi there!
I’m currently experiencing an issue with SonarCloud and Bitbucket Pipelines:

Details:

  • CI system used: Bitbucket Pipelines
  • Languages in the repository: Python & TypeScript

Error Observed:

Since yesterday, my pipeline has stopped processing .tsx files properly. It gets stuck on a random .tsx file and eventually fails. Here’s an example of the error message:

ERROR Failed to get response while analyzing file:///opt/atlassian/pipelines/agent/build/project-react/src/views/global/layout/MainLayout.tsx

The issue happens with different .tsx files each time, making it unpredictable.

Pipeline Log:

I’ve attached a pipeline log for reference:
pipelineLog-{89d61eff-4b27-4a00-83bf-daccfc03d7bd}.txt (36.3 KB)

Current Pipeline Configuration:

    - sonarcloud: &sonarcloud
        name: SonarCloud
        script:
          - sed -i "s|<source></source>|<source>/opt/atlassian/pipelines/agent/build/project</source>|g" project/coverage.xml
          - pipe: sonarsource/sonarcloud-scan:2.0.0
            variables:
              SONAR_SCANNER_OPTS: -Xmx1024m
              EXTRA_ARGS: -Dsonar.python.coverage.reportPaths=\"project/coverage.xml\" -Dsonar.python.version=\"3.11.6\"
              SONAR_TOKEN: ${SONAR_TOKEN}
          - pipe: sonarsource/sonarcloud-quality-gate:0.1.6

What I’ve Tried So Far:

  1. Changed SONAR_SCANNER_OPTS to -Xmx2048m.
  2. Upgraded sonarsource/sonarcloud-scan to version 3.1.0.
  3. Upgraded sonarsource/sonarcloud-quality-gate to version 0.2.0.
  4. Added the following to EXTRA_ARGS:
-Dsonar.python.coverage.reportPaths=manager/coverage.xml
-Dsonar.python.version=3.11
-Dsonar.javascript.node.maxspace=4096
-Dsonar.scanner.socketTimeout=1200

Unfortunately, none of these changes have resolved the issue.

Help Needed:

  • Has anyone encountered a similar issue where .tsx files fail randomly?
  • Is there any additional configuration or debugging step I can try to resolve this?

Thank you in advance for your support!

I am still experiencing the same issue.
I’m sharing a pipeline log in debug mode for further analysis:
pipelineLog-debug.txt (4.2 MB)

Thank you in advance for your support!

Hello Eduardo,

Thank you for the feedback. You should also increase the memory of the container. You can do this by adding the following in the pipelines.yml:

  services:
    docker-with-large-memory:
      memory: 6144
      type: docker

See this similar post for reference.

The pipeline is working again!
Thanks!!