cloudflare / cloudflare/containers

Completed rollout never replaces a DO-addressed container instance; it keeps serving the old image (single-instance app)

Open
#233 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
270
Forks
42
Avg merge
1d 5h
Merged PRs (30d)
4

Description

**Setup:** One Worker fronting a container app via `@cloudflare/containers` (^0.3.7): `class extends Container`, a single DO addressed with `getByName`, `sleepAfter: "15m"`, `instance_type: basic`, `max_instances: 2`. Deploys via `wrangler containers push` + `wrangler deploy` with the config's `image` pinned to the pushed registry tag. Wrangler 4.107.0.

**Observed (2026-07-09, UTC):** After `wrangler deploy` updated `configuration.image`, the rollouts API reported the rollout **completed** (both the default two-step 50%/100% and a later `--containers-rollout=immediate` single 100% step; `rollout_active_grace_period: 0`). The running instance kept serving the **old image for over an hour**: a route that exists only in the new image kept 404ing, both through the Worker and via workers.dev directly.

- An 18-minute zero-traffic window (> `sleepAfter`) followed by a cold start (~3-4s first response) *still* served the old image.
- `wrangler containers instances` later showed a **fresh instance record** (new `created`, `version: null`); its cold start also served the old image — so even re-provisioning bound back to the old spec.
- `wrangler containers list` showed `LIVE INSTANCES: 2` while application health reported `{active: 1, healthy: 1}`, consistent with the rollout satisfying itself with a new-image instance the DO never routed to.

**Expected:** a completed rollout (especially `--containers-rollout=immediate`) means requests are served by the configured image — or the rollout does not report completed.

**Workaround that resolved it:** `wrangler containers delete ` + `wrangler deploy` (per workers-sdk #12988's "delete and redeploy"). New application ID; the first request provisioned the configured image; correct behavior since — a subsequent image rollout on the recreated application replaced the serving instance within ~35 seconds, so the stale binding appears to have been specific to the original application.

Happy to provide rollout IDs and timestamps privately if useful.

Contributor guide

Open the contributing guide

Research direction

Start with the single Durable Object addressed through getByName and reproduce the flow using `wrangler containers push`, `wrangler deploy`, and the rollout options described. Inspect `wrangler containers instances` and `wrangler containers list` after a completed rollout and a cold start. Done means the serving instance uses the configured new image, or the rollout does not report completion when it does not.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, typescript
Domain
backend, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.