rancher: [BUG] Restoring Rancher to a previously installed version of Rancher causes Rancher to become inaccessible
Rancher Server Setup
- Rancher version:
v2.12.0-alpha17 - Installation option (Docker install/Helm Chart): Helm
- If Helm Chart, Kubernetes Cluster and version (RKE1, RKE2, k3s, EKS, etc): RKE2
- Proxy/Cert Details:
Information about the Cluster
- Kubernetes version:
v1.32.5+rke2r1 - 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) Admin
- If custom, define the set of permissions:
Describe the bug
When attempting to restore a Rancher backup from an upgraded Rancher, I am unable to access Rancher. Specifically, the rancher deployment witnesses the following behavior in the Event Logs:
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal ScalingReplicaSet 25m deployment-controller Scaled up replica set rancher-6b4589889b from 0 to 3
Normal ScalingReplicaSet 9m41s deployment-controller Scaled up replica set rancher-c7f457747 from 0 to 1
Normal ScalingReplicaSet 9m41s deployment-controller Scaled down replica set rancher-6b4589889b from 3 to 2
Normal ScalingReplicaSet 9m41s deployment-controller Scaled up replica set rancher-c7f457747 from 1 to 2
Normal ScalingReplicaSet 9m deployment-controller Scaled down replica set rancher-6b4589889b from 2 to 1
Normal ScalingReplicaSet 9m deployment-controller Scaled up replica set rancher-c7f457747 from 2 to 3
Normal ScalingReplicaSet 8m30s deployment-controller Scaled down replica set rancher-6b4589889b from 1 to 0
Normal ScalingReplicaSet 36s (x7 over 5m45s) deployment-controller Scaled down replica set rancher-c7f457747 from 3 to 0
Normal ScalingReplicaSet 36s (x6 over 4m55s) deployment-controller Scaled up replica set rancher-c7f457747 from 0 to 3
I would expect the replica sets to go down, but then to eventually come back up and Rancher is accessible and with the restore being successful.
To Reproduce
- Setup Rancher
v2.11.3. - Provision downstream clusters (I provisioned RKE2/K3s node driver with
v1.32.5). - Install the Rancher backup chart on the local cluster.
- Create a backup in the Rancher UI.
- Upgrade Rancher to
v2.12.0-alpha17(reproduced onheadas well) - Attempt to restore the backup in the Rancher UI; note that Rancher is inacessible.
To get around this, I had to kubectl delete restore <restore name>. Then, I was back at v2.12.0-alpha17 with my downstream clusters back in an Active state.
Result Restore does not work and Rancher is inaccessible.
Expected Result
Restore should work and Rancher should be accessible.
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 16 (16 by maintainers)
@jbiers I see, thanks for that! I will test again soon and see if all is well in that case.
I don’t think BRO should be backing up these resources @mallardduck. The builtin global roles are created every time on start up and aren’t allowed to be modified by users. I don’t see any reason they should be saved. I’m not sure if there’s a recent change that caused this to occur, but I think it would be safe to ignore any GlobalRole or RoleTemplate with the field
builtin: trueIt could be a bug in Rancher v2.12 related to BRO:
Some built-in global roles were modified in v2.12 - one of such PRs: https://github.com/rancher/rancher/pull/49075
Rancher-webhook is designed to reject any changes to built-in global roles, except for changes to the newUserDefault field. (code)
In a backup restore scenario, if the current cluster already has the updated v2.12 versions of these global roles, but the backup file contains older versions (with different field values), Rancher-webhook will block the restore operation due to the differences.
List of rejected global roles from the BRO logs:
Error message in BRO logs:
@markusewalker I actually think this is expected behavior. BRO doesn’t track the Rancher deployment and doesn’t include it in backups by design, so a Restore doesn’t really change Rancher version.
In the Rancher rollback documentation we see that after performing a Restore, you actually have to run
helm rollback rancher -n cattle-systemto get Rancher to the previous version, because of the way BRO is designed.@jbiers that is correct, the prune option was set to
truewhen I tried the full resourceset. I tried again to double-check and it was set totrue, but same result.@markusewalker the fix can now be found in the latest version of the rancher-backup chart 107.0.0+up8.0.0-rc.7
Retested on
headhttps://github.com/rancher/rancher/commit/cba4929a3943a8d25749abb25e66479f25eb35ee and using the rancher-backup chart version107.0.0+up8.0.0-rc.6. Please see below the test scenarios considered:In failing scenario 2, here was my workflow:
v2.11.3.107.0.0+up8.0.0-rc.6).headand even tried withv2.12.0-alpha17).v2.11.3.Upon doing that, I still get the same issue as reported. Initially, I thought this failure was due to my using the incorrect chart version. But even upon using the updated chart, I still hit this issue. So as of now, I still would consider this issue blocked.
good catch @markusewalker - i did the GitHub sin of saying that PR fixed this issue so it closed on my behalf lol. BTW the charts PR is in flight, so once merged QA should be able to test with the new version of BRO.