EthioDeploy
DocsPricingDomainsBlogToolsChangelog

Blog/Fix deploy errors

Container killed with exit code 137: OOM or SIGKILL?

BS
Brook SolomonPublished November 24, 2026
Share on XShare on LinkedIn
exit 137

THE SHORT ANSWER

Exit code 137 is 128 + 9: the process was killed with SIGKILL. In a container that usually means it went over its memory limit and the kernel's OOM killer stopped it, but docker kill and a docker stop that ran out of patience give 137 too. Check with docker inspect: State.OOMKilled is true only for a memory kill. Then make the app fit: cap Node's heap below the container limit with --max-old-space-size, run fewer Python workers or recycle them with max_requests, stream large data instead of loading it, and give the build its own memory budget, separate from the running app.

What does exit code 137 mean?

When a process dies from a signal, the shell reports 128 plus the signal number. Bash's manual: “Bash uses the value 128+N as the exit status.” SIGKILL is signal 9, so 128 + 9 = 137. SIGKILL can't be caught or handled, which is why the app logs nothing before it dies. You may see only Killed, or nothing at all.

Three things send SIGKILL to a container:

CauseExit codeOOMKilled
Over the --memory limit, kernel OOM killer137true
docker kill137false
docker stop when the app ignores SIGTERM for 10 seconds137false

Those are real results from Docker 29 with node:22-alpine. A slow shutdown on every deploy is the usual case of the third row: docker stop sends SIGTERM, waits (10 seconds on Linux by default), then sends SIGKILL. Handle SIGTERM and exit, and those 137s stop.

How do you tell an OOM kill from a manual kill?

Ask Docker:

$ docker inspect my-app --format 'ExitCode={{.State.ExitCode}} OOMKilled={{.State.OOMKilled}}'
ExitCode=137 OOMKilled=true

Two catches. First, the flag describes the last exit only: a container with a restart policy starts again and you may read the new state. Second, the exit code can mislead when the killed process isn't the container's main process. The same memory hog run under npm start gave this:

npm error command failed
npm error signal SIGKILL

$ docker inspect ... 
ExitCode=1 OOMKilled=true

npm survived and exited with 1, so there's no 137 anywhere, yet it was a memory kill. Docker's event stream records every OOM kill in the container, whichever process it hit, so it's the more reliable check:

$ docker events --since 1h --until 0s --filter event=oom \
    --format '{{.Time}} {{.Action}} {{.Actor.Attributes.name}}'
1795539974 oom my-app

Node.js: --max-old-space-size vs the container limit

There are two limits, and they fail differently. V8's heap limit is inside Node: hitting it prints FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory, and OOMKilled stays false. The container's --memory limit is the kernel's: hitting it is a silent SIGKILL and exit 137.

You want V8 to hit its own limit first, because it garbage-collects hard as it gets close. So set the heap below the container limit, leaving room for everything outside the heap: code, buffers, native modules like sharp. Node's docs suggest 1536 MiB on a 2 GiB machine.

# 512 MB container
NODE_OPTIONS=--max-old-space-size=384 node server.js

# or in package.json
"start": "node --max-old-space-size=384 server.js"

Buffers, image processing and native addons live outside the heap, so a small heap limit doesn't stop them. If the app is killed while the heap is small, look for large files read into memory, image resizing, or a cache with no size limit.

Don't carry a build-sized heap into the runtime. An NODE_OPTIONS value set for next build applies to the server too; the heap error during builds is covered in JavaScript heap out of memory during next build.

Python: workers that get killed

A Python app usually keeps running when it hits the limit, because the kernel kills one worker, not the master. Gunicorn logs it like this, starts a new worker, and the request that was in flight gets no response:

[ERROR] Worker (pid:12) was sent SIGKILL! Perhaps out of memory?
[INFO] Booting worker with pid: 13

Memory is per worker, so the total is workers times the size of one. Gunicorn's default is 1 worker; many configs set 4 or more, which on a small container is often the whole problem. In order of effort:

  • Run fewer workers (--workers 2), and use threads if you need more concurrency.
  • Recycle workers that grow slowly: --max-requests 1000 --max-requests-jitter 100. The default max_requests is 0, which never restarts them.
  • Process large files and query results in chunks instead of reading them whole.

Is it the build or the running app?

Read where the 137 appears:

  • In the build log, during npm run build, pip install or a compile step: the build machine ran out. The app never started. Bundlers, TypeScript and native compiles often need more memory than the finished app.
  • After a successful deploy, in runtime logs or as restarts: the running app went over its limit. That depends on traffic, so it can take hours to show up.

They have different fixes. A build needs a bigger build machine or a lighter build (no source maps, type checking in CI). The running app needs a lower memory footprint or a bigger plan. Raising one does nothing for the other.

What happens on EthioDeploy?

Each app container has a hard memory limit set by your plan:

ContainerFreeProBusiness
App256 MB1 GB2 GB
Postgres256 MB512 MB1 GB
MySQL512 MB768 MB1 GB
Redis128 MB128 MB128 MB

When an app goes over, the kernel kills it and it restarts on its own. The project overview then shows a warning card, “Out of memory: stopped N times in the last 7 days”, with the newest kills listed by what was killed (the app, a branch deployment, or a database), the limit it hit and when. It also catches the case above where a child process was killed and the container exited 0 or 1, because it's built on Docker's oom events, not the exit code. For the app, the card says requests in flight during the restart fail, and lists common causes, such as resizing images on the server with Next.js next/image.

On the Free plan, the app container also gets --max-old-space-size=160 in NODE_OPTIONS, so Node collects garbage before it reaches the 256 MB limit. The deploy log says:

Capping the Node.js heap at 160MB of this container's 256MB (NODE_OPTIONS), so Node collects garbage before the memory limit is hit. Set your own --max-old-space-size in NODE_OPTIONS, or ETHIODEPLOY_NODE_HEAP=off, to change this.

Your own --max-old-space-size wins. Pro and Business don't get the cap, because Node already sizes its heap well below a 1 GB or 2 GB limit.

Builds run in a separate, memory-capped builder, not in your app's container, so the plan limits above don't apply to them, and a build that runs out of memory isn't counted on the overview card. It fails the deploy with the error in the build log, and the previous version keeps serving. Plan limits are on the pricing page.

Questions

The container's main process was killed with SIGKILL: 128 plus signal 9. Most often the container went over its memory limit and the kernel's OOM killer stopped it, but docker kill and a docker stop that timed out also give 137.

Run docker inspect --format '{{.State.OOMKilled}}' on the container. true means a memory kill. Because a restart resets that state and a killed child process may not give exit 137, docker events --filter event=oom is the more reliable record.

No. The heap error comes from Node when V8 reaches --max-old-space-size, and Node prints FATAL ERROR before exiting. Exit 137 comes from the kernel when the whole container passes its memory limit, with no message from Node. Set the heap limit below the container limit so you get the first one.

Gunicorn logs "Worker was sent SIGKILL! Perhaps out of memory?" when the kernel kills a worker, usually because workers times per-worker memory is over the container limit. Run fewer workers, recycle them with --max-requests, or process data in chunks.

Not necessarily. Builds often use more memory than the running app. Fix the build by lightening it or giving the build machine more memory, and size the app's runtime limit separately.

Sources

Checked on November 24, 2026:

  • GNU Bash manual: Exit status
  • Linux man pages: signal(7)
  • Docker: Resource constraints
  • Docker: docker container stop
  • Docker: docker system events
  • Docker: docker container inspect
  • Node.js: --max-old-space-size
  • Gunicorn: Settings

Push a repo. Get a URL.

  • Pricing and plan limits
  • Troubleshooting deploys
  • Deploy a Next.js app
  • Deploy a Django app
Start free

Join the EthioDeploy Telegram

Release notes as they ship, plus deploy help from the team and other developers.

Join on Telegram
BS
WRITTEN BYBrook SolomonFounder, EthioDeploy

Brook Solomon founded EthioDeploy and builds its deploy pipeline, build servers and AI coding agent. The posts here come from errors seen in real deploys on the platform.

All posts by Brook →
On this page
  • What does exit code 137 mean?
  • How do you tell an OOM kill from a manual kill?
  • Node.js: --max-old-space-size vs the container limit
  • Python: workers that get killed
  • Is it the build or the running app?
  • What happens on EthioDeploy?
  • Questions
  • Sources
0% read

Keep reading

  • engines.node

    Fix deploy errorsNov 24, 2026

    "The engine node is incompatible": fix Node version mismatches on deploy

    The error means the Node version running your install is outside a range in engines.node, either your own package.json or a dependency's. Yarn 1 stops on it by default; npm only warns unless engine-strict is on; pnpm warns for your project and fails for dependencies when engine-strict is set. Fix it by choosing the Node version on the build machine; loosening the check only hides the problem. Set engines.node to a bounded range such as "24.x", and check how your host reads it. Heroku and Vercel read engines.node, Render reads NODE_VERSION, .node-version and .nvmrc before it, and nixpacks reads NIXPACKS_NODE_VERSION before everything else and only knows whole majors. Run node -v in your build command to see what you actually got.

  • ERR_TOO_MANY_REDIRECTS

    Fix deploy errorsNov 24, 2026

    ERR_TOO_MANY_REDIRECTS behind a proxy: causes and fixes

    ERR_TOO_MANY_REDIRECTS behind a proxy almost always means your app thinks an HTTPS request is HTTP and redirects it to HTTPS, forever. The proxy ended TLS and forwarded plain HTTP with an X-Forwarded-Proto: https header the app ignores. Tell the framework to trust its proxy: app.set("trust proxy", 1) in Express, SECURE_PROXY_SSL_HEADER in Django, trustProxies in Laravel, config.assume_ssl in Rails, AUTH_TRUST_HOST for Auth.js. If Cloudflare sits in front with SSL set to Flexible, change it to Full (strict). The other common loop is two layers redirecting in opposite directions, such as www to apex in one and apex to www in the other.

  • service_role

    Fix deploy errorsNov 24, 2026

    Leaked Supabase service_role key: what to do now

    A leaked service_role key gives anyone full access to your database, because it bypasses Row Level Security. Act in this order: create a new secret key (sb_secret_) and move your server code to it, switch browser code to a publishable key, deactivate the legacy anon and service_role keys under Settings > API Keys, then revoke the legacy JWT secret, since that secret is what makes the old key valid. Read your logs before they expire (one day on the Free plan), turn on RLS for every exposed table, and move the code that needed the key to a server so it never reaches the bundle again. Removing it from git history comes last and doesn't undo the leak.

EthioDeploy

Agentic first development and deployment, started in Ethiopia, built for developers everywhere.

Telegram community
Product
PricingAI coding agentAgent mode docsDomainsCLIFree backend hostingHosting in EthiopiaChangelog
Deploy guides
Next.jsNode.jsPythonSvelteKitTanStack StartAstroNuxtReact RouterHonoStrapiPayload CMSDjangoFastAPIFlaskStreamlitExpressNestJSLaravelRailsGoSpring BootASP.NET CoreTelegram botDiscord botWhatsApp botLovableBoltReplitv0Google AI StudioBase44Firebase StudioClaude Code & Cursor
Compare
vs Herokuvs Vercelvs Rendervs Railwayvs Fly.iovs Netlifyvs KoyebHeroku alternativesVercel alternativesNetlify alternativesRender alternativesRailway alternativesFly.io alternativesReplit alternativesPythonAnywhere alternativesDigitalOcean App Platform alternativesGlitch alternatives
Resources
DocsBlogFree toolsAboutSupportContactllms.txt
© 2026 EthioDeployPay by card in USD or bank transfer in ETBTermsPrivacy