Initial scan - Exit code 137 or Failed build time limit of 120 minutes

Good day,

I’m trying to run initial Analyze a project with Bitbucket Pipelines and facing an issue where my pipelines are either timing out or fail with exit code = 137.

  • ALM used: Bitbucket Cloud
  • CI system used: Bitbucket Cloud
  • Languages of the repository: PHP
  • Error observed:
/usr/bin/ line 26:    11 Killed                  sonar-scanner "${ALL_ARGS[@]}" 2>&1
        12 Done                    | tee "${SCANNER_REPORT}"
INFO: 8533 files indexed...  (last one was common/modules/Sales/modules/TcpaConsent/components/TrustedForm/CertificateLinkDetailDto.php)✖ SonarCloud analysis failed. (exit code = 137)

SONAR_TOKEN is added to bitbucket project variables.

I already tried the solutions from similar topics:

  • increased docker memory up to 2G (see bitbucket-pipelines.txt below)
  • increased/decreased Xmx, Xms values

Full log:
bbcloud-build-log.txt (50.3 KB)
bbcloud-docker-log.txt (8.3 KB)
Pipeline config:
bitbucket-pipelines.txt (1.5 KB)

variables in project vars (used for EXTRA_ARGS, DEBUG, SONAR_SCANNER_OPTS values in pipeline config):

CI_CUSTOM_SCAN_EXTRA_ARGS: -Dsonar.exclusions=**/*.yml,**/*.yaml

How can this issue be resolved? Thanks.


Do you have any way of adding timestamps to the build log so we can see where the time is going? Because I wouldn’t expect an analysis that failed this early in the process to have taken 2 hours.


Hi G Ann Campbell,

I was trying to reproduce the timeout last two days, but right now, no matter what value for SONAR_SCANNER_OPTS i use, the pipelines fail only with ‘exit code 137’ error every time.
All logs related to this error are already attached in the 1st message.


Your job is failing pretty early in the analysis process. As far as it gets typically only takes a minute or so. So without timestamps on each log line, I’m going to have to refer you back to all the other things that happen in that log (and it looks like a lot) before analysis.

Sorry I can’t be more help.