Rollback asks for a database restore

The Rollback dialog warns that code alone can break the site, or a restore did not finish. Restore the database, roll back code only, or use Undo restore.

Symptom

The Rollback dialog shows this warning next to a version, with the checkbox Roll back the code anyway.

Versions after this one changed the database, so rolling back the code alone can break the site.

A version the dialog does not offer shows its reason. One reason is this.

Recovery point expired

The recovery point this rollback would restore is older than <days> days.

A rollback or a restore that ran can end with one of these messages.

Cloudflare refused this rollback because a resource the version used no longer exists. Deploy the site again, or open the site page to Recreate its resources or Unlink it.

The recovery point of this restore expired, so the database was not restored. Open the site page and select Rollback again to see the options.

A resource this site needs no longer exists, so Fleet changed nothing. Deploy the site again, or open the site page to Recreate its resources or Unlink it.

The database may have changed after you chose this rollback, so rolling back the code alone can break the site. Select Rollback again to see the options.

Fleet could not confirm the restore, so your previous version is live again. Check your content. Undo restore returns the database to how it was before the restore started.

The restore ran, but Fleet could not put your version live and check it, so the site may still show the maintenance page. Retry puts your version live. It does not restore the database again.

Cause

A rollback changes code and bindings only. The database, R2 and KV are not rolled back. When EmDash applied migrations after the version you chose, the older code can fail against the newer database, so Fleet warns you and offers a database restore.

  • Recovery point expired. A restore needs a recovery point that Fleet recorded before a deploy. It lasts 30 days on Workers Paid and 7 days on Workers Free, and this one is older.
  • Cloudflare refused. A resource the version used, such as an R2 bucket, a KV namespace or a queue, was deleted after that version.
  • Restore stopped. The recovery point expired before the restore ran, so Fleet did not restore the database. Running the restore again cannot change that.
  • Rollback no longer offered. The database may have changed between your choice and the run.
  • Restore not confirmed or not finished. The restore stopped part of the way. Fleet put your previous version live again, or the restored version could not be put live and checked.

Fix

Rolling back needs the Developer role or above. The database restore needs the restore permission, which Owners and Admins hold. Without it the restore option is disabled, and you can roll back the code only. A restore asks you to sign in again when your last sign-in is older than 30 minutes.

  1. Open the site page and select Rollback.
  2. To restore the database too, choose the option with the database restore. Fleet states that content created since the recovery point will be lost.
  3. Type the site name to confirm.
  4. To keep the database, select Roll back the code anyway. The site can break.
  5. If a version shows Recovery point expired, roll back the code only when the dialog offers it. Otherwise choose another version.
  6. If Cloudflare refused the rollback, deploy the site again, or select Recreate on the site page to provision its resources again, or Unlink the site.
  7. If a restore stopped because its recovery point expired, select Rollback again to see the options.

After a restore:

  • Fleet could not confirm it. Check your content. Undo restore returns the database to how it was before the restore started, for 7 days after the restore.
  • Your version could not be put live. Select Retry. It puts your version live and does not restore the database again.

See Roll back a site and Restore a database.

Prevent

Roll back soon after a bad deploy, while the recovery point is inside its window of 30 days on Workers Paid or 7 days on Workers Free. Rollback covers the last 10 versions of a site. See Versions and rollback.

Report a problem with this page