Skip to content
Latchkey

Docker container "exited with code 137" (OOM) in CI

A running container received SIGKILL and exited 137. On memory-limited CI hosts this is overwhelmingly the OOM killer reclaiming memory from the heaviest process.

What this error means

A service container in a job (a database, a test target, an app under test) dies with exited with code 137, often taking dependent steps down with it.

docker
my-service exited with code 137
Error: Process completed with exit code 137.

Common causes

Container exceeded its memory limit

A --memory cap or the host ceiling was exceeded, so the cgroup OOM killer terminated the process.

Runner ran out of memory overall

Multiple containers plus the build competing for limited runner RAM trip the OOM killer.

How to fix it

Raise memory or lower usage

  1. Increase or remove the container memory limit.
  2. Run on a larger runner, or reduce concurrent containers.
Terminal
docker run -m 2g my-service

Confirm it was OOM

  1. Inspect the container exit reason for OOMKilled.
Terminal
docker inspect <id> --format '{{.State.OOMKilled}} {{.State.ExitCode}}'

How to prevent it

  • Size memory limits and runners for the services a job runs. Latchkey managed runners auto-retry transient OOM kills and can reschedule onto larger runners, so an occasional memory spike does not fail the run.

Frequently asked questions

What causes ""exited with code 137""?
A --memory cap or the host ceiling was exceeded, so the cgroup OOM killer terminated the process.
How do I fix "exited with code 137"?
Raise memory or lower usage

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card