I have had my docker host added to Rancher since a long time ago and everything has been working just fine for months. Suddenly, a few days ago, my docker host was marked as "Disconnected" in Rancher. When I check the status of the rancher-agent container I can see that it is restarting all the time:
•100% ➜ sudo docker ps -f name=rancher
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
0a12a18ca52c rancher/agent:v1.2.11 "/run.sh run" 21 hours ago Restarting (1) 54 seconds ago rancher-agent
In the log I see this:
•100% ➜ sudo docker container logs 0a12a18ca52c
time="2021-06-29T09:13:27Z" level=fatal msg="Failed to find container id:\n0::/\n"
time="2021-06-29T09:13:28Z" level=fatal msg="Failed to find container id:\n0::/\n"
time="2021-06-29T09:13:29Z" level=fatal msg="Failed to find container id:\n0::/\n"
time="2021-06-29T09:13:31Z" level=fatal msg="Failed to find container id:\n0::/\n"
time="2021-06-29T09:13:32Z" level=fatal msg="Failed to find container id:\n0::/\n"
time="2021-06-29T09:13:35Z" level=fatal msg="Failed to find container id:\n0::/\n"
time="2021-06-29T09:13:39Z" level=fatal msg="Failed to find container id:\n0::/\n"
I have tried searching the web for this but found nothing of interest. I have tried recreating the container. I have tried removing everything in /var/lib/rancher
and recreating the container. I have even tried to remove my environment in Rancher, stopped docker, removed all the docker data (data-root) on the docker host, again removed the files related to the rancher-agent and recreated the rancher-agent. Every time I recreate the rancher-agent I have used the command that the Rancher GUI gives you when you want to add a new host. I always end up with the same errors in the log.
I have the same version of docker installed on the host as it had when the host was last connected to Rancher. I use Rancher 1.6 (cannot change this) and docker 20.10.6 (also tried 20.10.7) on a machine running Manjaro.