Skip to content

CD deployed old code

2 min read · main part only; folded sections are optional

After this you can answer: The deploy finished but users still see the old version. How do you prove what is running?

Diagnostic scenario: users still see old behavior. The workflow’s revision check may report “ECS rolled the deploy back (deployment circuit breaker): the new tasks did not become healthy.” That is a source-defined error, not a newly observed incident.

The CD script reports that ECS is running a different task definition from the expected one. ECS being stable means its tasks have settled; they could belong to the previous release. Start with release state. Reach, Allowed or Password errors may explain a failed new task, but the old UI alone proves none of them.

flowchart TB
A[Old behavior after deploy] --> B{Intended tag selected?}
B -->|No| C[Check rollback input and run SHA]
B -->|Yes| D{Phase B reached?}
D -->|No| E[Inspect earlier failed step]
D -->|Yes| F{Running revision matches?}
F -->|No| G[Read task failures and rollback]
F -->|Yes| H[Check DNS and cache layers]

Ranked by the evidence to inspect first, not measured frequency:

  1. New tasks failed health checks and ECS restored the previous completed deployment.
  2. Migration or another earlier step stopped deployment before phase B, or manual image_tag deliberately selected older images.
  3. Tasks are correct, but the browser sees cached data or public DNS still reaches another ALB.

Repository → Actions → CD → run → Summary: compare chosen tag and each phase result. ECS → Clusters → minitickets-dev → Services → api/web service: compare task definition revisions, tasks and Events. ECR → Repositories → Private → repository → Images: compare immutable tag and digest. Check public DNS separately; ALB-only smoke tests bypass it.

Fix the new task’s actual failure, then deploy a reviewed release. For a deliberate app rollback, select a compatible existing image with main’s current infrastructure. Check DNS if the public address differs from the smoke test target.

Keep the revision comparison in .github/workflows/cd.yml. An SSM image tag is desired release state, not proof of running code. Preserve immutable tags and verify responses after checking tasks.

Advanced: Why a release record can lead the rollout

CD writes the image tag before phase B applies the service change. A later failure can leave SSM naming a version that is not running. The separate deployed-commit record can also include a partial infrastructure apply; it is a stale-deploy boundary, not a success certificate. AWS describes circuit-breaker rollback to a previous completed deployment.

Read this book online: https://book.theversehub.in/