rancher: [BUG] Rancher stuck on Waiting for cluster agent to connect after all control-plane VMs restarted
Rancher Server Setup
- Rancher version: v2.7.2-rc7
- Installation option (Docker install/Helm Chart): K3s install on a single VM
- Proxy/Cert Details: N/A
Information about the Cluster
- Kubernetes version: v1.24.10+k3s1
- Cluster Type (Local/Downstream): RKE2 cluster with the Harvester provisioner
User Information
- What is the role of the user logged in? Admin
Describe the bug
I had to reboot the underlying Harvester node which is running all the VMs which Rancher is maintaining. When all provisioned VMs got rebooted, Rancher is unable to get back to a working control plane:
Its stuck on:
configuring bootstrap node(s) home-control-panel-64fb95f768-vrlxf: waiting for cluster agent to connect
Whenever this happens, Iβm forced to completely delete the cluster and start fresh since Iβm unable to get into the control plane π¦
I noticed this error in the rancher-system-agent errors:
error syncing 'fleet-default/home-bootstrap-template-vfssj-machine-plan': handler secret-watch: the server could not find the requested resource (put secrets.meta.k8s.io home-bootstrap-template-vfssj-machine-plan), requeuing"
```
Logs on `home-control-panel-64fb95f768-vrlxf`:
```
May 10 12:01:38 home-control-panel-d5c1ddc9-8q5tf rancher-system-agent[63918]: time="2023-05-10T12:01:38Z" level=info msg="[Applyinator] Command sh [-c rke2 etcd-snapshot list --etcd-s3=false 2>/dev/null] finished with err: <nil> and exit code: 0"
May 10 12:01:43 home-control-panel-d5c1ddc9-8q5tf rancher-system-agent[63918]: time="2023-05-10T12:01:43Z" level=error msg="error syncing 'fleet-default/home-bootstrap-template-vfssj-machine-plan': handler secret-watch: the server could not find the requested resource (put secrets.meta.k8s.io home-bootstrap-template-vfssj-machine-plan), requeuing"
May 10 12:01:48 home-control-panel-d5c1ddc9-8q5tf rancher-system-agent[63918]: time="2023-05-10T12:01:48Z" level=info msg="[Applyinator] No image provided, creating empty working directory /var/lib/rancher/agent/work/20230510-120148/8d15054ffe8e5b367f1c42484faa83c3dbd756c78e981a70f99a00967f2a308d_0"
May 10 12:01:48 home-control-panel-d5c1ddc9-8q5tf rancher-system-agent[63918]: time="2023-05-10T12:01:48Z" level=info msg="[Applyinator] Running command: sh [-c rke2 etcd-snapshot list --etcd-s3=false 2>/dev/null]"
May 10 12:01:49 home-control-panel-d5c1ddc9-8q5tf rancher-system-agent[63918]: time="2023-05-10T12:01:49Z" level=info msg="[8d15054ffe8e5b367f1c42484faa83c3dbd756c78e981a70f99a00967f2a308d_0:stdout]: Name Location Size Created"
May 10 12:01:49 home-control-panel-d5c1ddc9-8q5tf rancher-system-agent[63918]: time="2023-05-10T12:01:49Z" level=info msg="[8d15054ffe8e5b367f1c42484faa83c3dbd756c78e981a70f99a00967f2a308d_0:stdout]: etcd-snapshot-home-control-panel-d5c1ddc9-8q5tf-1683608403 file:///var/lib/rancher/rke2/server/db/snapshots/etcd-snapshot-home-control-panel-d5c1ddc9-8q5tf-1683608403 98250784 2023-05-09T05:00:04Z"
May 10 12:01:49 home-control-panel-d5c1ddc9-8q5tf rancher-system-agent[63918]: time="2023-05-10T12:01:49Z" level=info msg="[8d15054ffe8e5b367f1c42484faa83c3dbd756c78e981a70f99a00967f2a308d_0:stdout]: etcd-snapshot-home-control-panel-d5c1ddc9-8q5tf-1683626400 file:///var/lib/rancher/rke2/server/db/snapshots/etcd-snapshot-home-control-panel-d5c1ddc9-8q5tf-1683626400 98250784 2023-05-09T10:00:01Z"
May 10 12:01:49 home-control-panel-d5c1ddc9-8q5tf rancher-system-agent[63918]: time="2023-05-10T12:01:49Z" level=info msg="[8d15054ffe8e5b367f1c42484faa83c3dbd756c78e981a70f99a00967f2a308d_0:stdout]: etcd-snapshot-home-control-panel-d5c1ddc9-8q5tf-1683644404 file:///var/lib/rancher/rke2/server/db/snapshots/etcd-snapshot-home-control-panel-d5c1ddc9-8q5tf-1683644404 98250784 2023-05-09T15:00:05Z"
May 10 12:01:49 home-control-panel-d5c1ddc9-8q5tf rancher-system-agent[63918]: time="2023-05-10T12:01:49Z" level=info msg="[8d15054ffe8e5b367f1c42484faa83c3dbd756c78e981a70f99a00967f2a308d_0:stdout]: etcd-snapshot-home-control-panel-d5c1ddc9-8q5tf-1683662401.part file:///var/lib/rancher/rke2/server/db/snapshots/etcd-snapshot-home-control-panel-d5c1ddc9-8q5tf-1683662401.part 13926400 2023-05-09T20:00:22Z"
May 10 12:01:49 home-control-panel-d5c1ddc9-8q5tf rancher-system-agent[63918]: time="2023-05-10T12:01:49Z" level=info msg="[8d15054ffe8e5b367f1c42484faa83c3dbd756c78e981a70f99a00967f2a308d_0:stdout]: etcd-snapshot--1683676800.part file:///var/lib/rancher/rke2/server/db/snapshots/etcd-snapshot--1683676800.part 0 2023-05-10T00:00:00Z"
May 10 12:01:49 home-control-panel-d5c1ddc9-8q5tf rancher-system-agent[63918]: time="2023-05-10T12:01:49Z" level=info msg="[8d15054ffe8e5b367f1c42484faa83c3dbd756c78e981a70f99a00967f2a308d_0:stdout]: etcd-snapshot-home-control-panel-d5c1ddc9-8q5tf-1683576000 file:///var/lib/rancher/rke2/server/db/snapshots/etcd-snapshot-home-control-panel-d5c1ddc9-8q5tf-1683576000 98250784 2023-05-08T20:00:01Z"
May 10 12:01:49 home-control-panel-d5c1ddc9-8q5tf rancher-system-agent[63918]: time="2023-05-10T12:01:49Z" level=info msg="[8d15054ffe8e5b367f1c42484faa83c3dbd756c78e981a70f99a00967f2a308d_0:stdout]: etcd-snapshot-home-control-panel-d5c1ddc9-8q5tf-1683590402 file:///var/lib/rancher/rke2/server/db/snapshots/etcd-snapshot-home-control-panel-d5c1ddc9-8q5tf-1683590402 98250784 2023-05-09T00:00:03Z"
May 10 12:01:50 home-control-panel-d5c1ddc9-8q5tf rancher-system-agent[63918]: time="2023-05-10T12:01:50Z" level=info msg="[Applyinator] Command sh [-c rke2 etcd-snapshot list --etcd-s3=false 2>/dev/null] finished with err: <nil> and exit code: 0"
May 10 12:01:55 home-control-panel-d5c1ddc9-8q5tf rancher-system-agent[63918]: time="2023-05-10T12:01:55Z" level=error msg="error syncing 'fleet-default/home-bootstrap-template-vfssj-machine-plan': handler secret-watch: the server could not find the requested resource (put secrets.meta.k8s.io home-bootstrap-template-vfssj-machine-plan), requeuing"
May 10 12:02:00 home-control-panel-d5c1ddc9-8q5tf rancher-system-agent[63918]: time="2023-05-10T12:02:00Z" level=info msg="[Applyinator] No image provided, creating empty working directory /var/lib/rancher/agent/work/20230510-120200/8d15054ffe8e5b367f1c42484faa83c3dbd756c78e981a70f99a00967f2a308d_0"
May 10 12:02:00 home-control-panel-d5c1ddc9-8q5tf rancher-system-agent[63918]: time="2023-05-10T12:02:00Z" level=info msg="[Applyinator] Running command: sh [-c rke2 etcd-snapshot list --etcd-s3=false 2>/dev/null]"
May 10 12:02:02 home-control-panel-d5c1ddc9-8q5tf rancher-system-agent[63918]: time="2023-05-10T12:02:02Z" level=info msg="[8d15054ffe8e5b367f1c42484faa83c3dbd756c78e981a70f99a00967f2a308d_0:stdout]: Name Location Size Created"
May 10 12:02:02 home-control-panel-d5c1ddc9-8q5tf rancher-system-agent[63918]: time="2023-05-10T12:02:02Z" level=info msg="[8d15054ffe8e5b367f1c42484faa83c3dbd756c78e981a70f99a00967f2a308d_0:stdout]: etcd-snapshot-home-control-panel-d5c1ddc9-8q5tf-1683590402 file:///var/lib/rancher/rke2/server/db/snapshots/etcd-snapshot-home-control-panel-d5c1ddc9-8q5tf-1683590402 98250784 2023-05-09T00:00:03Z"
May 10 12:02:02 home-control-panel-d5c1ddc9-8q5tf rancher-system-agent[63918]: time="2023-05-10T12:02:02Z" level=info msg="[8d15054ffe8e5b367f1c42484faa83c3dbd756c78e981a70f99a00967f2a308d_0:stdout]: etcd-snapshot-home-control-panel-d5c1ddc9-8q5tf-1683608403 file:///var/lib/rancher/rke2/server/db/snapshots/etcd-snapshot-home-control-panel-d5c1ddc9-8q5tf-1683608403 98250784 2023-05-09T05:00:04Z"
May 10 12:02:02 home-control-panel-d5c1ddc9-8q5tf rancher-system-agent[63918]: time="2023-05-10T12:02:02Z" level=info msg="[8d15054ffe8e5b367f1c42484faa83c3dbd756c78e981a70f99a00967f2a308d_0:stdout]: etcd-snapshot-home-control-panel-d5c1ddc9-8q5tf-1683626400 file:///var/lib/rancher/rke2/server/db/snapshots/etcd-snapshot-home-control-panel-d5c1ddc9-8q5tf-1683626400 98250784 2023-05-09T10:00:01Z"
May 10 12:02:02 home-control-panel-d5c1ddc9-8q5tf rancher-system-agent[63918]: time="2023-05-10T12:02:02Z" level=info msg="[8d15054ffe8e5b367f1c42484faa83c3dbd756c78e981a70f99a00967f2a308d_0:stdout]: etcd-snapshot-home-control-panel-d5c1ddc9-8q5tf-1683644404 file:///var/lib/rancher/rke2/server/db/snapshots/etcd-snapshot-home-control-panel-d5c1ddc9-8q5tf-1683644404 98250784 2023-05-09T15:00:05Z"
May 10 12:02:02 home-control-panel-d5c1ddc9-8q5tf rancher-system-agent[63918]: time="2023-05-10T12:02:02Z" level=info msg="[8d15054ffe8e5b367f1c42484faa83c3dbd756c78e981a70f99a00967f2a308d_0:stdout]: etcd-snapshot-home-control-panel-d5c1ddc9-8q5tf-1683662401.part file:///var/lib/rancher/rke2/server/db/snapshots/etcd-snapshot-home-control-panel-d5c1ddc9-8q5tf-1683662401.part 13926400 2023-05-09T20:00:22Z"
May 10 12:02:02 home-control-panel-d5c1ddc9-8q5tf rancher-system-agent[63918]: time="2023-05-10T12:02:02Z" level=info msg="[8d15054ffe8e5b367f1c42484faa83c3dbd756c78e981a70f99a00967f2a308d_0:stdout]: etcd-snapshot--1683676800.part file:///var/lib/rancher/rke2/server/db/snapshots/etcd-snapshot--1683676800.part 0 2023-05-10T00:00:00Z"
```
Rancher logs:
```
β 2023/05/13 01:33:35 [INFO] [planner] rkecluster fleet-default/home: waiting: configuring bootstrap node(s) home-control-panel-64fb95f768-vrlxf: waiting for cluster agent to connect β
β 2023/05/13 01:33:35 [INFO] [planner] rkecluster fleet-default/home: waiting: configuring bootstrap node(s) home-control-panel-64fb95f768-vrlxf: waiting for cluster agent to connect β
β 2023/05/13 01:33:36 [ERROR] [CAPI] Unable to retrieve Node status: failed to create cluster accessor: failed to get lock for cluster: cluster is locked already β
β 2023/05/13 01:33:36 [ERROR] [CAPI] Unable to retrieve Node status: failed to create cluster accessor: failed to get lock for cluster: cluster is locked already β
β 2023/05/13 01:33:36 [ERROR] [CAPI] Unable to retrieve Node status: failed to create cluster accessor: failed to get lock for cluster: cluster is locked already β
β 2023/05/13 01:33:40 [ERROR] [CAPI] Unable to retrieve Node status: failed to create cluster accessor: error creating dynamic rest mapper for remote cluster "fleet-default/home": Get "https://10.43.111.50/k8s/clusters/c-m-v9k6nzr4/api?timeout=10s": net/http: request canceled (Client.Timeout exceeded while awaiting headers) β
β 2023/05/13 01:33:40 [INFO] [planner] rkecluster fleet-default/home: waiting: configuring bootstrap node(s) home-control-panel-64fb95f768-vrlxf: waiting for cluster agent to connect β
β 2023/05/13 01:33:40 [INFO] [planner] rkecluster fleet-default/home: waiting: configuring bootstrap node(s) home-control-panel-64fb95f768-vrlxf: waiting for cluster agent to connect β
β 2023/05/13 01:33:45 [INFO] [planner] rkecluster fleet-default/home: waiting: configuring bootstrap node(s) home-control-panel-64fb95f768-vrlxf: waiting for cluster agent to connect β
β 2023/05/13 01:33:45 [INFO] [planner] rkecluster fleet-default/home: waiting: configuring bootstrap node(s) home-control-panel-64fb95f768-vrlxf: waiting for cluster agent to connect β
β 2023/05/13 01:33:50 [INFO] [planner] rkecluster fleet-default/home: waiting: configuring bootstrap node(s) home-control-panel-64fb95f768-vrlxf: waiting for cluster agent to connect β
β 2023/05/13 01:33:50 [INFO] [planner] rkecluster fleet-default/home: waiting: configuring bootstrap node(s) home-control-panel-64fb95f768-vrlxf: waiting for cluster agent to connect β
β 2023/05/13 01:33:51 [ERROR] [CAPI] Unable to retrieve Node status: failed to create cluster accessor: failed to get lock for cluster: cluster is locked already β
β 2023/05/13 01:33:51 [ERROR] [CAPI] Unable to retrieve Node status: failed to create cluster accessor: failed to get lock for cluster: cluster is locked already β
β 2023/05/13 01:33:51 [ERROR] [CAPI] Unable to retrieve Node status: failed to create cluster accessor: failed to get lock for cluster: cluster is locked already β
β 2023/05/13 01:33:51 [INFO] [planner] rkecluster fleet-default/home: waiting: configuring bootstrap node(s) home-control-panel-64fb95f768-vrlxf: waiting for cluster agent to connect β
β 2023/05/13 01:33:51 [INFO] [planner] rkecluster fleet-default/home: waiting: configuring bootstrap node(s) home-control-panel-64fb95f768-vrlxf: waiting for cluster agent to connect β
β 2023/05/13 01:33:55 [ERROR] [CAPI] Unable to retrieve Node status: failed to create cluster accessor: failed to get lock for cluster: cluster is locked already β
β 2023/05/13 01:33:56 [INFO] [planner] rkecluster fleet-default/home: waiting: configuring bootstrap node(s) home-control-panel-64fb95f768-vrlxf: waiting for cluster agent to connect β
β 2023/05/13 01:33:56 [INFO] [planner] rkecluster fleet-default/home: waiting: configuring bootstrap node(s) home-control-panel-64fb95f768-vrlxf: waiting for cluster agent to connect β
β 2023/05/13 01:33:58 [ERROR] [CAPI] Unable to retrieve Node status: failed to create cluster accessor: error creating dynamic rest mapper for remote cluster "fleet-default/home": Get "https://10.43.111.50/k8s/clusters/c-m-v9k6nzr4/api?timeout=10s": context deadline exceeded β
β 2023/05/13 01:34:01 [INFO] [planner] rkecluster fleet-default/home: waiting: configuring bootstrap node(s) home-control-panel-64fb95f768-vrlxf: waiting for cluster agent to connect β
β 2023/05/13 01:34:01 [INFO] [planner] rkecluster fleet-default/home: waiting: configuring bootstrap node(s) home-control-panel-64fb95f768-vrlxf: waiting for cluster agent to connect β
β 2023/05/13 01:34:06 [ERROR] [CAPI] Unable to retrieve Node status: failed to create cluster accessor: failed to get lock for cluster: cluster is locked already β
β 2023/05/13 01:34:06 [ERROR] [CAPI] Unable to retrieve Node status: failed to create cluster accessor: failed to get lock for cluster: cluster is locked already
```
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 4
- Comments: 34 (3 by maintainers)
Also having this issue v1.28.8+rke2r1
hahha - one person above says rebooted serveral times and it started working. Tried that as i had nothing to lose. And it did start working on the 4th reboot. Amazing
@sarahhenkens, as a workaround
Hey maartenschalekamp!
I am on Rancher 2.8.5 on Ubuntu at the moment so results may vary!
Does your DNS server have the CNAME of the Rancher UI ( for example rancher-burger.net)? The pods check /etc/resolve.conf for their DNS so if the CNAME does not exist they will fail. Putting it on the VMs /etc/hosts file will not work (I tried π )
Also, on the Ubuntu VM I had to install IPTables prior to installing Rancher or else rke2-ingress-nginx-controller would not come up. You can check if all the pods are running the below (assuming you have not changed the default location).
/var/lib/rancher/rke2/bin/kubectl --kubeconfig /etc/rancher/rke2/rke2.yaml get pods --all-namespacesAfter fixing the above Rancher finally came up.
My next issue was the .crt cert from Digicert was not being recognized as a full chain when creating my dev cluster. I had to export all 3 pieces of the cert and them remake the .crt file and then recreate the secret in Rancher. Once I did that my dev cluster came up.
Below was the error being seen:
`time=β2024-10-09T18:29:34Zβ level=fatal msg=βCertificate chain is not complete, please check if all needed intermediate certificates are included in the server certificate (in the correct order) and if the cacerts setting in Rancher either contains the correct CA certificate (in the case of using self signed certificates) or is empty (in the case of using a certificate signed by a recognized CA). Certificate information is displayed above. error: Get "https://YOURRANCHERURL": tls: failed to verify certificate: x509: certificate signed by unknown authorityβ
https://support.tools/post/how-to-change-rancher-2.x-server-cert/ https://ranchermanager.docs.rancher.com/getting-started/installation-and-upgrade/resources/update-rancher-certificate
Same issue on v1.28.9+rke2r1
I havenβt experienced the issue anymore
On Wed, Sep 6, 2023 at 2:12 PM Jake Hyde @.***> wrote:
@jakefhyde thank you for taking the time to look into this issue.
I am not observing the same issue on rancher v2.7.[4-6]