1

I was running docker on my CentOS 7 machine. Today I was trying to upgrade a container. So I stopped the container and tried to pull new image.

I got the below error

Error getting v2 registry: Get https://registry-1.docker.io/v2/: proxyconnect tcp: dial tcp: lookup https_proxy=http: no such host"

I checked the proxy setting for machine in cat /etc/environment and for docker in cat /etc/systemd/system/docker.service.d/http-proxy.conf

It is set correctly. I enabled daemon logs for docker and the logs says

Sep 14 10:43:18 myCentOsServer kernel: [4913751.074277] docker0: port 1(veth1e3300a) entered disabled state
Sep 14 10:43:18 myCentOsServer kernel: [4913751.084599] docker0: port 1(veth1e3300a) entered disabled state
Sep 14 10:43:18 myCentOsServer kernel: [4913751.084888] docker0: port 1(veth1e3300a) entered disabled state
Sep 14 10:43:18 myCentOsServer NetworkManager[794]: <info>  [1505349798.0267] device (veth1e3300a): released from master device docker0
Sep 14 10:44:48 myCentOsServer dockerd[29136]: time="2017-09-14T10:44:48.802236300+10:00" level=warning msg="Error getting v2 registry: Get https://registry-1.docker.io/v2/: proxyconnect tcp: dial tcp: lookup https_proxy=http: no such host"

I tried below commands but it is stuck.

systemctl daemon-reload
systemctl restart docker

enter image description here

Any idea what might be the issue.

Thanks in advance.

VVP
  • 766
  • 4
  • 14
  • 39

2 Answers2

0

It occurs sometimes in CentOS. You can simply restart the docker service by

systemctl restart docker.service
Pang
  • 9,564
  • 146
  • 81
  • 122
jaydeep
  • 1
  • 3
  • It won't restart. When I try to, it gets stuck as shown in the image above on my question. I tried restarting machine as well. – VVP Sep 14 '17 at 04:43
  • @VVP, then you should try to see log in /var/log/messages, first you can run echo " " > /var/www/messages , and reboot your system then see in your logs that what actually happen in your docker.service. – jaydeep Sep 14 '17 at 04:49
  • 'Sep 14 15:04:35 CentOsHost dockerd[1072]: time="2017-09-14T15:04:35.721024400+10:00" level=info msg="libcontainerd: new containerd process, pid: 1182" Sep 14 15:04:36 CentOsHost dockerd[1072]: time="2017-09-14T15:04:36.809135800+10:00" level=info msg="[graphdriver] using prior storage driver: overlay" Sep 14 15:04:37 CentOsHost dockerd[1072]: time="2017-09-14T15:04:37.222375900+10:00" level=info msg="Graph migration to content-addressability took 0.00 seconds" Sep 14 15:04:37 CentOsHost dockerd[1072]: time="2017-09-14T15:04:37.222861500+10:00" level=info msg="Loading containers: start."' – VVP Sep 14 '17 at 05:09
  • `Sep 14 15:04:35 CentOsHost dockerd[1072]: time="2017-09-14T15:04:35.721024400+10:00" level=info msg="libcontainerd: new containerd process, pid: 1182" Sep 14 15:04:36 CentOsHost dockerd[1072]: time="2017-09-14T15:04:36.809135800+10:00" level=info msg="[graphdriver] using prior storage driver: overlay" Sep 14 15:04:37 CentOsHost dockerd[1072]: time="2017-09-14T15:04:37.222375900+10:00" level=info msg="Graph migration to content-addressability took 0.00 seconds" Sep 14 15:04:37 CentOsHost dockerd[1072]: time="2017-09-14T15:04:37.222861500+10:00" level=info msg="Loading containers: start."` – VVP Sep 14 '17 at 05:09
  • I followed this [Docker Exception](https://stackoverflow.com/questions/43537790/docker-fails-to-start-due-to-volume-store-metadata-database-timeout) Now I am seeing this `Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?` – VVP Sep 14 '17 at 05:31
0

I was finally able to solve this issue.
Issue was with my docker mount points. Mine was set as /var/lib/docker and I suspect it got courrupted when I did data volume export.

Steps I followed
1) Navigated to /var/lib/docker, took a backup of images,containers and volumes folder and deleted them.
2) Reloaded the Daemon
3) Restarted the docker.

Now it is working fine.
However bad news is I lost my datadump which I took from one of the containers (using volumes-from).
But it was a dev version of software. So I reinstalled and did the setup.

VVP
  • 766
  • 4
  • 14
  • 39