Interview Prep/DevOps Fundamentals/Real-world scenarios

A service works in staging but fails in production. How do you debug it?

IntermediateScenarioReal-world scenarios
Answer

In one line: Something is different between the two environments, so systematically compare them — version, configuration, secrets, infrastructure, data, traffic and permissions — using the error messages to guide you.

Step 1 — Get the exact error

  • Logs, traces and metrics from production: what fails, for which requests, since when?

Step 2 — Confirm you're running the same thing

  • Is it the same image/artifact (compare tags and digests)? If production was built separately, that alone could be the cause.

Step 3 — Compare the common differences

  1. Configuration — environment variables, feature flags, ConfigMaps, Helm values per environment.
  2. Secrets and credentials — missing or wrong secret, expired certificate, different API keys.
  3. Permissions — IAM roles/policies, Kubernetes RBAC, database user rights that exist in staging but not in production.
  4. Network — security groups, NetworkPolicies, firewall rules, DNS records, private endpoints, egress proxies.
  5. Infrastructure versions — Kubernetes version, database engine version, instance types, OS/base image.
  6. Data — production has much more data, unusual records or edge cases (nulls, special characters, very large values) not present in test data.
  7. Scale and traffic — concurrency and load expose race conditions, connection pool limits and timeouts.
  8. External integrations — production uses real third-party endpoints (payments, email) with different behaviour or rate limits.

Step 4 — Tools to compare

  • helm get values for both environments; kubectl diff; Terraform plans; comparing Argo CD app manifests.
  • Config drift detection.

Step 5 — Fix and prevent

  • Fix the difference through code/config (not a manual production change).
  • Reduce differences: same IaC modules for every environment, "build once, deploy many", configuration validated in the pipeline, production-like data volumes in staging (masked), and load testing.

Example: a service failed in production with "AccessDenied" when writing to S3. Staging used a broad IAM role; production's role was scoped to a different bucket name. Fixing the Terraform variable and adding a post-deploy smoke test that writes a test object prevented a repeat.

Tip for interviews: list the categories (artifact, config, secrets, permissions, network, data, scale) — that structure shows experience.

All DevOps Fundamentals questions

More on Real-world scenarios