Exit Code 137 / Never finishes javascript/typescript scan

  • ALM: Bitbucket cloud
  • CI system: bitbucket cloud
  • Scanner command: EXTRA_ARGS="-Dsonar.organization=org -Dsonar.projectKey=project -Dsonar.sources=." /usr/bin/run-scanner
  • Error observed
    Bitbucket cloud: 7GB of memory allocated (i think it runs out of memory, bitbucket does not tell me this)
INFO: Running symbolic analysis for 'JS'
/usr/bin/run-scanner.sh: line 26:    11 Killed                  sonar-scanner "${ALL_ARGS[@]}" 2>&1
        12 Done                    | tee "${SCANNER_REPORT}"
✖ SonarCloud analysis failed. (exit code = 137)

Local in Docker (12gb of memory) this has been running for 12+ hours

INFO: CPD Executor CPD calculation finished (done) | time=19458ms
INFO: Analysis report generated in 486814ms, dir size=15 MB

This is a javascript/typescript repo with 2220 files in it. At this point completely unable to get this to scan successfully. Not sure what the next step is here to troubleshoot. Any help would be greatly appreciated.

Hey there.

I have seen with some users of Bitbucket Pipelines the need to explicitly set SONAR_SCANNER_OPTS to take advantage of more memory being allocated.

For example - SONAR_SCANNER_OPTS=Xms6G -Xmx6G. Could you give this a try and see if your pipeline gets further?