rancher: [BUG] Restoring backup of Rancher using Rancher Backups stuck in a forever loop

Rancher Server Setup

  • Rancher version: 2.10.1
  • Installation option (Docker install/Helm Chart): Helm
    • If Helm Chart, Kubernetes Cluster and version (RKE1, RKE2, k3s, EKS, etc): RKE1
  • Proxy/Cert Details:

Information about the Cluster

  • Kubernetes version: 1.28.11
  • Cluster Type (Local/Downstream): Local
    • If downstream, what type of cluster? (Custom/Imported or specify provider for Hosted/Infrastructure Provider):

User Information

  • What is the role of the user logged in? (Admin/Cluster Owner/Cluster Member/Project Owner/Project Member/Custom)
    • If custom, define the set of permissions:

Describe the bug

I have an old install of Rancher on a RKE1 bootstrapped cluster, of 5-nodes in AWS EC2. I’m trying to replace this cluster with a new RKE2 bootstrapped version. I installed a fresh cluster with rke2-server which has Kubernetes v1.31.6+rke2r1. I took a backup of the old Rancher cluster using the Rancher Backups app after installing it following directions found here https://ranchermanager.docs.rancher.com/how-to-guides/new-user-guides/backup-restore-and-disaster-recovery/back-up-rancher. The backup completed without any issues. However, restore is now stuck running in a loop where it fails to restore an admission webhook, then requeues it, which then it fails again.

ERRO[2025/03/07 00:27:08] Error restoring cluster-scoped resources [error restoring local of type management.cattle.io/v3, Resource=clusters: restoreResource: err updating resource admission webhook "rancher.cattle.io.clusters.management.cattle.io" denied the request: metadata.annotations: Invalid value: "field.cattle.io/creatorId": annotation is immutable] 
ERRO[2025/03/07 00:27:08] error syncing 'restore-hr5gn': handler restore: error restoring cluster-scoped resources, check logs for exact error, requeuing

To Reproduce

Take a backup of an old Rancher cluster, I’m assuming it must have this problematic admission webhook. Then restore it to a new cluster using Rancher Backups.

Result Restore loops forever and never ends.

Expected Result

It should just deal with this particular annotation and move on and complete the restore.

Screenshots

Additional context

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 20 (9 by maintainers)

Most upvoted comments

@eroji - Happy to share that our teams are working on improving documentation around this topic. See a docs update here for a preview of those directions: https://github.com/rancher/rancher-docs/pull/1717

Hmm this is interesting. The secret exists without the namespace. I didn’t know that’s even possible. It’s also not letting me delete it…

> kubectl get secrets --all-namespaces | grep test-cred
p-vsqgf                                       test-cred                                                  kubernetes.io/dockerconfigjson        1      5y317d

Ok so maybe I completely misunderstood how this is supposed to work. I will reset the RKE2 cluster and try it again with just the app installed via chart.

Are you restoring the backup on the RKE2 cluster before or after Rancher installed and running?

This is a crucial aspect of the process - when you migrate a Rancher instance you must not have Rancher installed on the destination.

You only install Rancher Backup, then make the Restore CRD. After you see the backup operator Restore task complete, you can safely install the Rancher Helm chart to have Rancher running.