Pages

Topics

Tools

↑↓navigate↵openescclose
Encoding & Security

Status & Exit Codes

Look up an HTTP status, a container or Kubernetes exit code, or a network errno and get the cause, the command to run next, and whether a retry can help.

Runs entirely in your browser — nothing you paste is uploaded.

Quick lookup
42 codesEvery entry lists the cause, the command to run next, and whether a retry helps.
  • 200OKRetry safeHTTP

    The request succeeded and the body carries the result. A 200 with an empty body usually means the API answered from a cache or a fallback branch.

    • curl -i https://example.com/api/health
    • curl -sS https://example.com/api/health | head -c 200
    • Safe to retry: the same request can be repeated as it is.
  • 201CreatedDo not retryHTTP

    The request created a resource. The Location header points at the new record, and its absence is the usual reason a client cannot follow up.

    • curl -i -X POST -H 'Content-Type: application/json' -d '{"name":"test"}' https://example.com/api/items
    • Do not retry: repeating the same request gives the same answer.
  • 204No ContentDo not retryHTTP

    The request succeeded and the response has no body. Code that always parses JSON fails here with an unexpected end of JSON input.

    • curl -i -X DELETE https://example.com/api/items/42
    • Do not retry: repeating the same request gives the same answer.
  • 301Moved PermanentlyRetry safeHTTP

    The URL moved for good and clients cache the redirect. Use it only when the old path never comes back; a temporary move belongs on 302 or 307.

    • curl -sSIL https://example.com/old-path
    • Safe to retry: the same request can be repeated as it is.
  • 302FoundRetry safeHTTP

    A temporary redirect, but clients may rewrite POST to GET. For an API that has to keep the method use 307 or 308 instead.

    • curl -sSIL https://example.com/login
    • Safe to retry: the same request can be repeated as it is.
  • 304Not ModifiedRetry safeHTTP

    The cached copy is still valid, so no body is sent. It only appears when the request carried If-None-Match or If-Modified-Since, and in a log it is not an error.

    • curl -i -H 'If-None-Match: "etag"' https://example.com/page
    • Safe to retry: the same request can be repeated as it is.
  • 307Temporary RedirectRetry safeHTTP

    A temporary redirect that keeps the method and the body, which is what a POST redirect needs. The client repeats the request at the new URL.

    • curl -sSIL -X POST https://example.com/api/old
    • Safe to retry: the same request can be repeated as it is.
  • 308Permanent RedirectRetry safeHTTP

    A permanent redirect that keeps the method and the body. Browsers cache it, so a wrong target is hard to undo afterwards.

    • curl -sSIL https://example.com/old
    • Safe to retry: the same request can be repeated as it is.
  • 400Bad RequestRetry after a fixHTTP

    The server could not read the request: broken JSON, a missing required field, or a body sent with the wrong content type. Most frameworks name the offending field in the response body.

    • curl -i -X POST -H 'Content-Type: application/json' -d '{"name":"test"}' https://example.com/api/items
    • echo '{"name":"test"}' | python3 -m json.tool
    • Retry after the cause is fixed; repeating it now changes nothing.
  • 401UnauthorizedRetry after a fixHTTP

    Authentication is missing or invalid: no Authorization header, an expired token, or a key sent under the wrong scheme. Read the WWW-Authenticate header to see what the server wants.

    • curl -i -H "Authorization: Bearer $TOKEN" https://example.com/api/me
    • curl -sSI https://example.com/api/me | grep -i www-authenticate
    • Retry after the cause is fixed; repeating it now changes nothing.
  • 403ForbiddenRetry after a fixHTTP

    The caller is authenticated but not allowed. Check the role or scope, a bucket or table policy, and an IP allowlist; a 403 after a successful login is a permission problem, not a token problem.

    • curl -i -H "Authorization: Bearer $TOKEN" https://example.com/api/admin
    • Retry after the cause is fixed; repeating it now changes nothing.
  • 404Not FoundDo not retryHTTP

    The path or the record does not exist. Check the route, a trailing slash, the base URL and the id; a reverse proxy that strips a path prefix gives the same answer.

    • curl -sSIL https://example.com/api/items/42
    • curl -sS http://localhost:3000/api
    • Do not retry: repeating the same request gives the same answer.
  • 405Method Not AllowedRetry after a fixHTTP

    The route exists but not for this method: a GET to a POST-only endpoint, or a proxy or form that rewrote the method. The Allow header lists what the route accepts.

    • curl -i -X GET https://example.com/api/items
    • Retry after the cause is fixed; repeating it now changes nothing.
  • 408Request TimeoutRetry safeHTTP

    The client did not send the whole request in time. Usually a slow upload on a weak link, or a proxy timeout set lower than the client needs.

    • curl -sS -o /dev/null -w '%{time_total}s\n' https://example.com/api/upload
    • Safe to retry: the same request can be repeated as it is.
  • 409ConflictRetry after a fixHTTP

    The request conflicts with the current state: a duplicate unique key, two writers on one row, or an optimistic-lock version mismatch. Usually worth retrying after a fresh read.

    • curl -i -X POST -H 'Content-Type: application/json' -d '{"email":"a@b.c"}' https://example.com/api/users
    • Retry after the cause is fixed; repeating it now changes nothing.
  • 413Payload Too LargeRetry after a fixHTTP

    The body exceeds a limit on the server or in front of it: nginx client_max_body_size, a serverless request cap, or a framework body limit. Compress or upload in parts.

    • du -h ./upload.zip
    • curl -i -F 'file=@upload.zip' https://example.com/api/upload
    • Retry after the cause is fixed; repeating it now changes nothing.
  • 415Unsupported Media TypeRetry after a fixHTTP

    The Content-Type is not what the endpoint accepts. A JSON body sent as form data is the usual case; set application/json and keep the JSON valid.

    • curl -i -X POST -H 'Content-Type: application/json' -d '{"a":1}' https://example.com/api/items
    • Retry after the cause is fixed; repeating it now changes nothing.
  • 422Unprocessable EntityRetry after a fixHTTP

    The request was well formed but the values failed validation. Frameworks such as FastAPI, Rails and Laravel return their field errors in the body, so read it before changing the request shape.

    • curl -i -X POST -H 'Content-Type: application/json' -d '{"email":"nope"}' https://example.com/api/users
    • Retry after the cause is fixed; repeating it now changes nothing.
  • 429Too Many RequestsRetry safeHTTP

    A rate limit or quota was hit. Read Retry-After, back off with jitter, and check which key is limited: an IP, an API key or a signed-in user.

    • curl -sSI https://example.com/api/items | grep -i retry-after
    • sleep 5 && curl -i https://example.com/api/items
    • Safe to retry: the same request can be repeated as it is.
  • 500Internal Server ErrorRetry safeHTTP

    The server threw an error it does not handle. The stack trace is in the server log; a 500 that appears on one route only points at that handler, not at the network.

    • curl -i https://example.com/api/items
    • docker compose logs -f --tail 50 api
    • Safe to retry: the same request can be repeated as it is.
  • 502Bad GatewayRetry safeHTTP

    The proxy reached the upstream but got no usable answer: the app crashed or restarted, listens on another port, or answers HTTP on a TLS port. The proxy log names the upstream it tried.

    • curl -sS -o /dev/null -w '%{http_code} %{time_total}s\n' https://example.com/
    • docker compose ps
    • Safe to retry: the same request can be repeated as it is.
  • 503Service UnavailableRetry safeHTTP

    The server is up but cannot serve: overload, maintenance mode, a failing dependency, or no healthy instance behind the load balancer. Retry-After says when to come back.

    • curl -sSI https://example.com/ | grep -i retry-after
    • docker compose ps
    • Safe to retry: the same request can be repeated as it is.
  • 504Gateway TimeoutRetry safeHTTP

    The proxy waited longer than its timeout for the upstream. Look at slow queries, a missing index, and proxy_read_timeout or the serverless function limit before the code itself.

    • curl -sS -o /dev/null -w '%{http_code} %{time_total}s\n' http://localhost:3000/api/slow
    • psql "$DATABASE_URL" -c 'EXPLAIN ANALYZE SELECT 1'
    • Safe to retry: the same request can be repeated as it is.
  • 0Exit 0 — successRetry safeContainer & Exit

    The process finished successfully. That is expected for a one-off job and wrong for a service that has to keep running, so check whether the entrypoint finishes its work and exits.

    • docker logs --tail 50 <container>
    • docker inspect --format '{{.State.ExitCode}}' <container>
    • Safe to retry: the same request can be repeated as it is.
  • 1Exit 1 — application errorRetry after a fixContainer & Exit

    The application itself failed: an uncaught exception, a failed assertion, a missing migration. The reason is in the last lines of the container log.

    • docker logs --tail 100 <container>
    • docker inspect --format '{{.State.ExitCode}}' <container>
    • Retry after the cause is fixed; repeating it now changes nothing.
  • 2Exit 2 — usage errorRetry after a fixContainer & Exit

    A shell builtin or the command line was wrong: a bad flag, a missing argument, or an unreadable file in the entrypoint script.

    • docker logs --tail 50 <container>
    • docker run --rm -it --entrypoint sh <image>
    • Retry after the cause is fixed; repeating it now changes nothing.
  • 126Exit 126 — cannot executeRetry after a fixContainer & Exit

    The command exists but cannot be executed: a missing execute bit, a Windows line ending in the shebang, or an interpreter that is not in the image.

    • docker run --rm -it --entrypoint sh <image> -c 'ls -l /entrypoint.sh'
    • file /path/to/entrypoint.sh
    • Retry after the cause is fixed; repeating it now changes nothing.
  • 127Exit 127 — command not foundRetry after a fixContainer & Exit

    The command was not found in the image PATH: a typo, a package that was never installed, or a binary that lives in another stage of a multi-stage build.

    • docker run --rm -it --entrypoint sh <image> -c 'command -v node'
    • docker run --rm -it --entrypoint sh <image> -c 'echo $PATH'
    • Retry after the cause is fixed; repeating it now changes nothing.
  • 130Exit 130 — SIGINTRetry safeContainer & Exit

    The process stopped on Ctrl-C, 128 plus signal 2. Normal for a container you interrupted by hand; suspicious when it happens without anyone at the terminal.

    • docker inspect --format '{{.State.ExitCode}}' <container>
    • Safe to retry: the same request can be repeated as it is.
  • 137Exit 137 — SIGKILL / OOMKilledRetry after a fixContainer & Exit

    The container was killed with 128 plus signal 9. In most cases the OOM killer took it, so compare the app's peak memory with its limit before raising the limit.

    • docker inspect --format '{{.State.OOMKilled}}' <container>
    • docker stats --no-stream <container>
    • kubectl describe pod <pod> | grep -i -A2 'Last State'
    • Retry after the cause is fixed; repeating it now changes nothing.
  • 139Exit 139 — SIGSEGVRetry after a fixContainer & Exit

    The process crashed with a segmentation fault, 128 plus signal 11. Common with a native module built for another libc or a mismatched Node or Python ABI.

    • docker logs --tail 100 <container>
    • docker inspect --format '{{.Config.Image}}' <container>
    • Retry after the cause is fixed; repeating it now changes nothing.
  • 143Exit 143 — SIGTERMRetry safeContainer & Exit

    The container received SIGTERM, 128 plus signal 15, which is the normal stop request. If it keeps happening on its own, the app is not finishing its shutdown within the grace period.

    • docker inspect --format '{{.Config.StopTimeout}}' <container>
    • docker logs --tail 50 <container>
    • Safe to retry: the same request can be repeated as it is.
  • CrashLoopBackOffKubernetes CrashLoopBackOffRetry after a fixContainer & Exit

    Kubernetes restarts the container because it keeps exiting, and the wait between attempts grows. The previous attempt's output explains the exit.

    • kubectl logs <pod> --previous --tail 100
    • kubectl describe pod <pod> | grep -i -A5 'Last State'
    • Retry after the cause is fixed; repeating it now changes nothing.
  • ImagePullBackOffKubernetes ImagePullBackOffRetry after a fixContainer & Exit

    The image cannot be pulled: a tag that does not exist, a private registry without imagePullSecrets, or a registry that is rate limiting the node.

    • kubectl describe pod <pod> | sed -n '/Events/,$p'
    • kubectl get secret <secret> -o yaml
    • Retry after the cause is fixed; repeating it now changes nothing.
  • CreateContainerConfigErrorKubernetes CreateContainerConfigErrorRetry after a fixContainer & Exit

    The container cannot be created because something it references is missing: a Secret or ConfigMap, one of its keys, or the volume that carries it.

    • kubectl describe pod <pod> | sed -n '/Events/,$p'
    • kubectl get secret,configmap
    • Retry after the cause is fixed; repeating it now changes nothing.
  • EvictedKubernetes EvictedRetry after a fixContainer & Exit

    The pod was evicted because the node ran out of memory, disk or process ids. Requests and limits that do not match real use, and a node without free disk, are the usual causes.

    • kubectl get pod <pod> -o jsonpath='{.status.reason}{"\\n"}{.status.message}{"\\n"}'
    • kubectl describe node <node> | grep -i -A6 'Conditions'
    • Retry after the cause is fixed; repeating it now changes nothing.
  • ECONNREFUSEDECONNREFUSEDRetry safeNetwork Errno

    Nothing is listening on that host and port, or it listens on 127.0.0.1 only. Inside Docker the host is the service name, not localhost, and the port has to be the container's own port.

    • nc -vz localhost 3000
    • ss -ltnp | grep 3000
    • docker compose ps
    • Safe to retry: the same request can be repeated as it is.
  • ECONNRESETECONNRESETRetry safeNetwork Errno

    The other side closed the connection mid-request: the peer crashed or timed out, a proxy or load balancer dropped an idle connection, or HTTP was sent to a TLS port.

    • curl -v https://example.com/api/items
    • curl -v --http1.1 --keepalive-time 30 https://example.com/
    • Safe to retry: the same request can be repeated as it is.
  • ETIMEDOUTETIMEDOUTRetry safeNetwork Errno

    No answer arrived in time: routing, a firewall or security group, the wrong host, or a peer that is simply too slow. Test the port before changing code.

    • nc -vz -w 5 <host> 443
    • curl -sS -o /dev/null -w '%{time_connect}s %{time_total}s\n' https://example.com/
    • Safe to retry: the same request can be repeated as it is.
  • ENOTFOUNDENOTFOUNDRetry after a fixNetwork Errno

    The host name did not resolve: a typo, a missing search domain, a container without DNS, or a resolver that is rate limiting you.

    • getent hosts api.example.com
    • nslookup api.example.com 1.1.1.1
    • Retry after the cause is fixed; repeating it now changes nothing.
  • EADDRINUSEEADDRINUSERetry after a fixNetwork Errno

    The port is already taken on this machine: another process, or a previous instance of the same app that never exited.

    • lsof -i :3000
    • kill -15 $(lsof -t -i :3000)
    • Retry after the cause is fixed; repeating it now changes nothing.
  • EACCESEACCESRetry after a fixNetwork Errno

    Permission denied: a port below 1024 without the privilege, or a file or directory the process cannot write. In a container this is often a non-root user and a mounted volume owned by root.

    • id
    • ls -ld /var/lib/app
    • PORT=8080 node server.js
    • Retry after the cause is fixed; repeating it now changes nothing.

Status and exit code reference

quick reference
4xx vs 5xx
A 4xx is the client's request to fix, a 5xx is the server's failure; a 502 or 504 on one route usually comes from the upstream behind the proxy.
128 + signal
A shell reports a process killed by a signal as 128 plus the signal number: 137 is 128+9 (SIGKILL), 143 is 128+15 (SIGTERM), 139 is 128+11 (SIGSEGV).
OOMKilled
Exit 137 with OOMKilled true in docker inspect means the memory limit was reached; a limit below the app's peak restarts it the same way.
CrashLoopBackOff
Kubernetes restarts the container because it keeps exiting; kubectl logs --previous shows the attempt that failed.
ECONNREFUSED
Nothing listens on that host and port; inside Docker the host is the service name, not localhost, and the port is the container's own port.
Retry-After
The header a 429 or 503 sends to say when to come back; back off with jitter instead of retrying in a tight loop.

Frequently asked questions

answered below the tool
Why did my container exit with 137?

137 is 128 + 9, SIGKILL: either the out-of-memory killer or docker stop. docker inspect shows OOMKilled to tell the two apart.

What does CrashLoopBackOff mean?

Kubernetes keeps restarting the container because it exits; kubectl logs --previous shows why the last attempt died.

Is it safe to retry a 503?

Yes, with backoff: it is usually a temporary upstream or capacity problem, and Retry-After says how long to wait.

All Linux guides