Skip to main content
All of the catalog
Injectable fault

CrashLoop: a bad config value takes the app down

go-api went down minutes after a config change rolled out. Every request now fails. Every go-api pod starts, dies within a second and starts again (CrashLoopBackOff), and no old pod is left to serve.

WorkloadHigh severitygo-api/go-api
Definition on GitHub

Which app it breaks

go-api by default. Pass --app to break another app in your lab instead.

The hint ladder

Each hint narrows the search a little further. They are collapsed on purpose: open one only when you are properly stuck, because working out the next command yourself is the whole exercise.

Hint 1

Users get errors on every request, so start from what should be answering them: kubectl get pods -n go-api and read the STATUS and RESTARTS columns. In Grafana, Pod Resources shows the same thing over time: Container restarts and Containers not running, by reason. Is anything left serving?

Hint 2

CrashLoopBackOff only says the container keeps exiting, not why. A container that crashed already wrote its last words: read them with kubectl logs -n go-api <crashing-pod> --previous, and check Last State and Exit Code in kubectl describe pod. What does the error complain about?

Hint 3

The error names a setting the app reads when it starts. Settings like that come from the pod template, not the pod: kubectl get deploy go-api -n go-api -o yaml and read the container's env. Compare it with the containerPort a few lines above. Fix the Deployment, not the pod: a deleted pod comes back from the same template and crashes the same way.

Further reading

Get updates

New scenarios and faults, release notes, and news about hosted labs if and when there is some. A few emails a month at most.

We'll email you about new releases, new lab content and paid offerings such as hosted labs, courses and workshops. Unsubscribe any time.