Browse the docs

Roll back an environment

Point a channel at an earlier release set. Every environment that follows the channel deploys that set, with the images, config and declarations it holds. You rebuild nothing.

What happens in the cloud

  1. putnami cloud channels set reads the head of the channel. It moves the channel only if the head is still the one it read.
  2. The move is a new accepted move. The channel counter (generation) rises by one, and the move opens its own deploy for each environment.
  3. The platform compares the older release set with what each environment runs, workload by workload.
  4. It deploys the workloads whose image, config or migrations differ. A workload that already runs those artifacts stays as it is.
  5. Each service rolls on its own. The current revision keeps serving until the older one is ready.

Do it

Find the release set to go back to

The CLI shows the head of a channel. It does not list the earlier heads.

The good set is… Read its id with
Still on another channel, such as stable putnami cloud channels status stable
The one that runs now (note it before your next move) putnami cloud channels status canary
The one that a deploy used putnami cloud env status prod --provenance --output=json, field trigger.release_set_id

The id is rs_ and 64 hex digits. The short form that env status prints (rs_8fa9d34e…) is not enough.

Move the channel

putnami cloud channels set canary --from rs_<id>

The command prints the channel, the release set and the new generation:

  canary -> rs_<id> (generation <n>)

Add --expected rs_<id> to move only if the channel still names that set.

To promote instead, point a channel at the head of another channel. The usual step is canary to stable:

putnami cloud channels set stable --from canary

To roll canary back to what stable holds, run the reverse:

putnami cloud channels set canary --from stable

Wait for the registries

Registries apply a move a few seconds after it. Without --wait, the command reads degraded while a registry is behind. With --wait, it polls until every registry applied the head:

putnami cloud channels status canary --wait 5m

Roll back a registry tag

For one image tag in the Putnami OCI registry, restore the target that the registry recorded before the last move of the tag:

putnami cloud packages revert <repo>:<tag>

Give a tag, never a digest. The command acts on the registry tag. To roll back an environment, move the channel as above.

What you see

Where What
putnami cloud env status prod The channel, its new generation and the workloads that deploy.
putnami cloud deploy status <cm_id> The deploy that the move opened, workload by workload.
putnami.app, change page, Release tab The release and deploy outcomes.

What does not go back

  • Migrations. The platform applies migrations forward only. A rollback runs the older image against the schema as it is now. Write the migration that undoes a change, and release it.
  • Data. Rows and files that the newer version wrote stay.
  • The next merge. A merge to main moves the channel forward again. Fix main, or the next merge undoes the rollback.

When it fails

You see Cause Fix
channel canary moved while this command ran Another move happened first. Read the head again. Run the command again.
--expected … is not a release-set id The id is short, or has a typo. Use the full rs_ id with 64 hex digits.
is not a portable channel name --from is not an rs_ id, and it is not a valid channel name. Pass an rs_ id or a channel name.
The environment deploys nothing, outcome converged Every workload already runs those artifacts. None.
The environment deploys nothing, outcome not_deployable The older set holds no image or config for a workload the environment declares, such as a workload you added later. No follower of the channel deploys. Pick a later set, or remove that workload from workloads in putnami.ci.json.
The environment deploys nothing, outcome no_follower No accepted environment follows this channel. Run putnami cloud env doctor <env>.
deploy status refuses the id It takes cm_… or rel_…, not rs_…. Use the deploy id from env status.

Next