GitLab: "ERROR: Job failed: exit code 137"
The message gives only the exit code of the failed command. No GitLab documentation page explains the message itself. Two documentation pages treat 137 as the exit code of an out-of-memory kill: the GitLab Zoekt troubleshooting page, which says to look for OOMKilled in the Last State section with a non-zero Exit Code "(typically 137)", and the CI/CD YAML reference, which uses 137 in its examples for retrying and allowing failure (GitLab: Zoekt troubleshooting and CI/CD YAML syntax reference, checked November 22, 2026).
ERROR: Job failed: exit code 137
What the public reports show
A GitLab Runner issue with this exact title describes the Docker executor, with three runners on one Linux machine (Runner 10.8.0, Docker 18.09.6, 15.52 GiB of memory). The reporter writes that the job finishes about 90% of its work and then fails with the message. The issue page shows no reply and no named cause, so the page of the issue does not confirm that memory was the reason there.
To see why a job failed, right next to the job: Pipelines and Jobs Inbox for GitLab CI, a plugin for JetBrains IDEs, shows next to a failed job its status, how long it ran and the message GitLab gives for the failure, and opens the job's log in a console viewer at the bottom of the IDE.
Check whether it was an out-of-memory kill
- Kubernetes: describe the pod and look for
OOMKilledin theLast Statesection and anExit Code, "typically 137" (GitLab: Zoekt troubleshooting, which is written for that component, not for the runner). - A VM or bare metal host: the same page checks the system journal for OOM events with this command.
sudo journalctl -k | grep -i "oom\|killed process"
The Zoekt page applies these checks to its own pods and hosts.
Docker executor memory settings
In the [runners.docker] section of the runner config.toml, GitLab documents these keys (GitLab: GitLab Runner advanced configuration):
memory(example"128m"): the memory limit, a string.memory_swap(example"256m"): the total memory limit, a string.memory_reservation(example"64m"): the memory soft limit, a string.oom_kill_disable: if an out-of-memory error occurs, do not terminate processes in a container.oom_score_adjust: OOM score adjustment; positive means terminate the processes earlier.
The values in the list are the examples of the table, not defaults.
Retry or allow only exit code 137
retry:exit_codes with retry:max (0, 1 or 2) retries a job for specific failure cases only. allow_failure:exit_codes makes the job allow_failure: true for the listed exit codes and not for any other code. Both take a single exit code or an array (GitLab: CI/CD YAML syntax reference).
test_job_1:
script:
- ./run-tests.sh
retry:
max: 2
exit_codes: 137
test_job_2:
script:
- ./run-tests.sh
allow_failure:
exit_codes:
- 137
- 255
The two blocks are separate jobs: the first is retried up to twice when the exit code is 137, the second is allowed to fail with 137 or 255. ./run-tests.sh stands for the command of the job.
GitLab jobs in IntelliJ IDEA
Pipelines and Jobs Inbox for GitLab CI, a plugin by Lesstep for JetBrains IDEs 2024.1 or later, lists the pipelines of your GitLab projects with their jobs by stage. Next to a failed job it shows the status, how long the job ran and the message GitLab gives for the failure, such as the ones above (GitLab gives none for a script that failed), and it opens the log of a job in a console viewer at the bottom of the IDE. Reading is free; retrying, cancelling and running are Pro (US$1.50 a month, with a 30-day trial).
Get it on JetBrains Marketplace
GITLAB is a trademark of GitLab Inc.; IntelliJ IDEA is a trademark of JetBrains s.r.o. This page is not affiliated with or endorsed by GitLab Inc. or JetBrains.
More: GitLab job dropped as stuck or over its timeout · GitLab failed to pull image · GitLab "Job's log exceeded limit of 4194304 bytes" · GitLab job log refused or empty · GitLab "Argument list too long" · GitLab job waiting for resource · GitLab pipeline or job refused (400, 403, 409, 429) · GitLab pipeline plugins for IntelliJ IDEA, compared · 日本語