Dashboard

Build and deploy

Roll back a deployment

Return a project to an earlier release without rebuilding it.

A rollback puts an earlier successful release of your app back in place. Nothing is rebuilt: HCode runs the image it saved when that deployment succeeded. HCode keeps the images of your most recent successful deployments only, so you can roll back to those and not to older ones.

Roll back

  1. Open the project's Deployments tab.
  2. Click the successful deployment you want to go back to. It must be one HCode still keeps.
  3. Click Rollback to this version.

A new deployment appears at the top of the list, started by a rollback, and goes through the same rollout and checks as a normal deploy (see Deployments). The rolled-back release starts before the current one stops, so the app stays up, unless the two releases use different runtime ports. A rollback doesn't wait for a build slot, and it cancels any deploy that is still running on the project.

What a rollback reuses

Reused from the old deployment Taken from the project as it is now
The built image Environment variables
The runtime port it ran on Databases and their data

Because the current environment variables are used, a rollback won't undo a bad variable. Fix the variable under Settings and restart instead (see Environment variables).

A rollback only changes the app. Your databases keep their current data, including any schema changes the newer release made, so check that the older code still works with them before you roll back.

Your branch is not changed either. The next push or Deploy builds from the branch again and replaces the rolled-back release.

When you can't roll back

  • Only deployments with the status Success can be rolled back to.
  • Your plan sets how many successful deployments HCode keeps. An older one has no button and says "Only your last (number) successful deployments are kept, so this one can no longer be rolled back to."
  • A deployment with no recorded commit has the button disabled, with "This deployment can't be rolled back because its commit wasn't recorded."
  • If your plan doesn't include rollback, the button is disabled with "Rollback is available on paid plans." and an Upgrade to unlock rollback link.
  • Rollbacks are refused while new work is paused for storage or bandwidth use. See Usage and limits.
  • Viewers can't roll back. Owners, admins and members can.

A rollback that is refused before it starts tells you why in the same words as a refused deploy. If HCode can't say more, you get "The rollback didn't start. Try again in a minute, and contact support if it keeps happening."

If a rollback fails

A rollback that fails on HCode's side says so, starting with "This one is on us", and nothing about your project needs changing. The most common ones:

The message continues with What to do
"something went wrong on our side while rolling back your app" Try the rollback again in a few minutes.
"the version you rolled back to did not come up properly on our side" Try the rollback again in a few minutes.
"we could not reach the saved copy of that version, so nothing was changed" Try the rollback again in a few minutes.
"the saved copy of that version is gone, so we could not roll back to it" Deploy that version again from your code.

If the older release itself fails the check, the deployment shows why, the same way a failed deploy does. See App won't start.