After upgrading from Rancher 1.2.0 to 1.2.2 yesterday.
Today, I discovered that Rancher shows the host as ‘Disconnected’. I couldn’t figure out why this was happening, so I tried to re-register the host with a new Rancher Agent. However, the Rancher Agent is showing some sort of problem when trying to re-register itself. What could cause this problem?
I start the Rancher Agent, and it exits fairly quickly. I see that the rancher-agent bootstrap container doesn’t fire off any new containers from the rancher/agent image:
[root@docker01 ~]# docker run -d --privileged -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/rancher:/var/lib/rancher rancher/agent:v1.1.2 https://rancher01.example.org/v1/scripts/blahblah1:12345blah:blahblah
[root@rancher01 ~]# docker ps -a |grep agent
2a9688d0073a rancher/agent:v1.1.2 "/run.sh https://ranc" 3 seconds ago Up 2 seconds gloomy_swirles
The logs make it seem that the container could connect to the Rancher Server at https://rancher01.example.org , but then fail due to a missing URL?
[root@rancher01 ~]# docker logs --tail -f 2a9688d0073a
Updating certificates in /etc/ssl/certs...
WARNING: rancherAddedCA.pem does not contain a certificate or CRL: skipping
1 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...
done.
INFO: Running Agent Registration Process, CATTLE_URL=https://rancher01.example.org/v1
INFO: Attempting to connect to: https://rancher01.example.org/v1
INFO: https://rancher01.example.org/v1 is accessible
Traceback (most recent call last):
File "./resolve_url.py", line 9, in <module>
r = requests.get(url)
File "/usr/local/lib/python2.7/dist-packages/requests/api.py", line 70, in get
return request('get', url, params=params, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/api.py", line 56, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 488, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 609, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/adapters.py", line 497, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: unknown error (_ssl.c:2831)
curl: no URL specified!
curl: try 'curl --help' or 'curl --manual' for more information
ERROR: returned
ERROR: --- START ---
ERROR: --- END ---
ERROR: Failed to load registration env from CATTLE_URL=https://rancher01.example.org/v1 ENV_URL= ERROR: Please ensure the proper value for the Host Registration URL is set
And yes, the host can reach the Rancher Server:
[root@docker01 ~]# curl https://rancher01.example.org/v1
{"id":"5519214c-a18b-433d-968f-128015d9bee9","type":"error","links":{},"actions":{},"status":401,"code":"Unauthorized","message":"Unauthorized","detail":null,"baseType":"error"}[root@docker01 ~]#