Writing · CI/CD · Reliability

Why the pipeline passed and production still failed

A green pipeline tells you the code built and the tests passed. It does not tell you the environment it is about to land in matches the one you tested against.

November 12, 2026 · 5 min read

Most deployment failures I have run into, or reproduced in my own labs, come from that gap. The usual suspects are familiar: missing secrets, expired credentials, environment drift, IAM permission problems, and health checks that fail only after the deploy. The application code is rarely the problem. Here are three cases where it was not.

1. The container that died without an error

I ran the same Java image in a 256 MB container with two heap settings. With a fixed -Xmx512m, bigger than the container, the container was killed with OOMKilled=true and exit code 137. The application logs contained no OutOfMemoryError at all, because the process was killed from outside before it could report anything.

The fix was to size the heap as a percentage of the container limit, -XX:MaxRAMPercentage=75, so it scales with whatever limit the container has. The lesson is where to look first: when the logs say nothing, check the container status.

2. The plan that worked and the apply that did not

In an Azure Terraform pipeline, the plan step signed in fine. The apply step failed with AADSTS700213: No matching federated identity record found. The apply job runs in a protected prod environment, which changes the identity GitHub presents to Azure, and no credential matched it.

I fixed it by adding a federated credential for the environment, and then found that the real subject included the account and repository ID numbers as well as their names. Credentials written from the documentation did not match. I now copy the subject straight from the error message instead of writing it from memory.

3. A deploy that failed because of configuration, not code

I rolled out a new version of a service while a client called it five times a second. Same code, same image, same cluster. The only change was whether the Helm chart's probes and preStop pause were turned on.

Chart settingRequestsFailed
Probes and preStop on2890
Probes and preStop off11418 (about 1 in 6)

Without probes, traffic reached pods before Java had finished starting, and old pods stopped while requests were still arriving. A pipeline that only checked whether the new pod eventually came up would have called every one of those deploys a success.

What I do about it

  • Deploy what you tested. The pipeline publishes one image per commit, tagged with the commit ID, and only from the main branch. What was tested is what gets deployed.
  • Change settings without rebuilding. Port and messages come from environment variables, so environments differ in configuration, not in the artifact.
  • Test the failure paths. I break things on purpose, such as memory limits, rollouts without probes, and mismatched identities, and write down what each one looks like from the outside.
  • Make rollbacks automatic. helm upgrade --install --atomic rolls back by itself if the new version never becomes ready.

The pipeline is not the goal. A reliable deployment is, and the gap between the two is usually the environment.

Related