A release passed every test in staging but broke in production. How do you investigate?
IntermediateScenarioDeployments and releases
Answer
Situation read → "Worked in staging" means staging differs from prod somewhere. The job is to find the difference fast, after mitigating.
What I'd do →
- Roll back or toggle off the feature flag to stop the impact.
- Diff the environments systematically:
helm get values api -n staging > stg.yaml
helm get values api -n prod > prd.yaml
diff stg.yaml prd.yaml
kubectl get cm,secret -n prod -l app=api -o yaml | grep -v resourceVersion
- Check the usual suspects: data volume (a query fine on 10k rows dies on 50M), real traffic patterns, config and feature flags, IAM permissions only granted in staging, network policies, and third-party endpoints pointing at sandboxes.
- Pull prod logs and traces for the failing requests and compare with staging.
- Add the missing coverage: a prod-like dataset in staging, or a canary step in prod.
Why → Most "prod-only" bugs are config, data scale or permissions, not code.
Interview tip → Admit staging will never equal prod, which is why canaries and feature flags exist.
More on Deployments and releases
A deploy went out and p99 latency doubled. Walk me through it.IntermediateYou deployed a new version and half the pods are in CrashLoopBackOff. What do you do?BeginnerHow would you design a zero-downtime deployment for a stateless API on Kubernetes?BeginnerEvery deploy causes a short spike of 502 errors from the ALB. Why, and how do you fix it?IntermediateHow would you set up a canary release, and what decides whether it gets promoted?IntermediateBlue-green or canary? How do you choose for a specific service?Beginner