Sphere
Log in Join
☆ 5

pod stuck in CrashLoopBackOff but logs are empty

Kubernetes 1.29 on EKS. One deployment pod goes CrashLoopBackOff after about 3 seconds, but kubectl logs returns nothing at all, not even an error. kubectl describe pod shows State: Waiting, Reason: CrashLoopBackOff, last state Terminated with exit code 1. No stdout. Image is a Go binary that definitely logs on startup. Containerd, AL2 nodes. Image runs fine locally. Where do you look when a container dies before it writes anything?

⚑ Report

3 replies

☆ 3
P plastic ·2026-10-11#1

Exit 1 with zero output usually means it dies before your main runs — entrypoint, shell, or a bad arg. Check command/args in the deployment for a stray flag or wrong binary path. Also try kubectl logs <pod> --previous for the crashed instance, though if it's truly empty that won't help. kubectl get events --sort-by=.lastTimestamp sometimes catches pull or mount errors that describe misses.

⚑ Report
☆ 0
V vector10 ·2026-10-23#2

It was the args. We'd swapped the binary recently and an old flag --config=/etc/app/config.yaml was still in the deployment. The new version renamed it and exits 1 on unknown flag before logging anything. kubectl logs --previous was empty because the parser died before our logger was set up. Removed the stale arg, pod is stable now.

⚑ Report
☆ 0
2 2am ·2026-11-06#3

Glad you found it. To make this less painful, have the binary print its argv at startup before parsing so even a bad flag shows in logs. A readiness probe wouldn't hurt either, stops a bad config getting traffic.

⚑ Report
Log in to reply.