Pull hello-world image i/o timeout

I have a problem, I can ping google normally but can’t pull image, please help me to see what is the problem, thanks!

root@ser300462488588:~# ping google.com
PING google.com (142.251.42.238) 56(84) bytes of data.
64 bytes from tsa01s11-in-f14.1e100.net (142.251.42.238): icmp_seq=1 ttl=52 time=155 ms
64 bytes from tsa01s11-in-f14.1e100.net (142.251.42.238): icmp_seq=2 ttl=52 time=150 ms
64 bytes from tsa01s11-in-f14.1e100.net (142.251.42.238): icmp_seq=3 ttl=52 time=156 ms
64 bytes from tsa01s11-in-f14.1e100.net (142.251.42.238): icmp_seq=4 ttl=52 time=151 ms
^C
--- google.com ping statistics ---
5 packets transmitted, 4 received, 20% packet loss, time 4006ms
rtt min/avg/max/mdev = 150.446/153.033/156.295/2.567 ms


root@ser300462488588:~# sudo docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
c1ec31eb5944: Retrying in 1 second 
docker: error pulling image configuration: download failed after attempts=6: dial tcp 157.240.10.32:443: i/o timeout.
See 'docker run --help'.


root@ser300462488588:~# ping google.com
PING google.com (142.251.42.238) 56(84) bytes of data.
64 bytes from tsa01s11-in-f14.1e100.net (142.251.42.238): icmp_seq=1 ttl=52 time=152 ms
64 bytes from tsa01s11-in-f14.1e100.net (142.251.42.238): icmp_seq=2 ttl=52 time=151 ms
64 bytes from tsa01s11-in-f14.1e100.net (142.251.42.238): icmp_seq=3 ttl=52 time=151 ms
^C
--- google.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 150.572/150.933/151.539/0.430 ms
root@ser300462488588:~# 

seems like there might be a networking issue on your end.
check your connectivity to the registry : wget https://registry-1.docker.io/v2/

Thanks for the reply, now I have this problem, please help me out.

root@ser300462488588:~# docker login
Authenticating with existing credentials...
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credential-stores

Login Succeeded

root@ser300462488588:~# wget https://registry-1.docker.io/v2/
--2024-07-01 01:23:34--  https://registry-1.docker.io/v2/
Resolving registry-1.docker.io (registry-1.docker.io)... 34.226.69.105, 54.196.99.49, 3.219.239.5, ...
Connecting to registry-1.docker.io (registry-1.docker.io)|34.226.69.105|:443... connected.
HTTP request sent, awaiting response... 401 Unauthorized

Username/Password Authentication Failed.
root@ser300462488588:~# docker login https://registry-1.docker.io
Username: dierbei
Password: 
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credential-stores

Login Succeeded


root@ser300462488588:~# docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
c1ec31eb5944: Retrying in 1 second 
docker: error pulling image configuration: download failed after attempts=6: read tcp 10.0.20.2:40202->104.244.43.229:443: read: connection reset by peer.
See 'docker run --help'.
root@ser300462488588:~# 

In order to understand your situation, we need some context information.

Please share the output of following commands:

docker version
docker info

Remove secrets like private IP adddresses, registries or usernames from the output.

The output I get is something like the following:

root@ser300462488588:~# docker version
Client: Docker Engine - Community
 Version:           27.0.2
 API version:       1.45 (downgraded from 1.46)
 Go version:        go1.21.11
 Git commit:        912c1dd
 Built:             Wed Jun 26 18:47:28 2024
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          26.1.3
  API version:      1.45 (minimum version 1.24)
  Go version:       go1.21.10
  Git commit:       8e96db1
  Built:            Thu May 16 08:33:58 2024
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.7.18
  GitCommit:        ae71819c4f5e67bb4d5ae76a6b735f29cc25774e
 runc:
  Version:          1.1.12
  GitCommit:        v1.1.12-0-g51d5e94
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
root@ser300462488588:~# docker info
Client: Docker Engine - Community
 Version:    27.0.2
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.15.1
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.28.1
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 0
 Server Version: 26.1.3
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: ae71819c4f5e67bb4d5ae76a6b735f29cc25774e
 runc version: v1.1.12-0-g51d5e94
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: builtin
 Kernel Version: 5.4.0-110-generic
 Operating System: Ubuntu 20.04.4 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 4
 Total Memory: 7.771GiB
 Name: ser300462488588
 ID: xxxxxxxxxxxxxxxxxxxxxxx
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Username: xxxxxxxxxxxxxxxxxxxxx
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false
 Product License: Community Engine

WARNING: No swap limit support
root@ser300462488588:~# 

Something is wrong. Your server version is older than the client. How did you install Docker? Do you have a link to an installation guide you followed?

I’m using ubuntu installation, which is a three-step process.

That is the right guide. Did you “hold” some packages after the first installation and ran apt upgrade later? Check the output of

apt-mark showheld

Holding docker packages in production is a good practice and that small difference shouldn’t be a problem, but the best if you have the same version of the client and the server.

please, share the output of the following command as well:

dpkg -l | grep docker-ce
root@ser300462488588:~# apt-mark showheld
root@ser300462488588:~# dpkg -l | grep docker-ce
ii  docker-ce                       5:27.0.2-1~ubuntu.20.04~focal      amd64        Docker: the open-source application container engine
ii  docker-ce-cli                   5:27.0.2-1~ubuntu.20.04~focal      amd64        Docker CLI: the open-source application container engine
ii  docker-ce-rootless-extras       5:27.0.2-1~ubuntu.20.04~focal      amd64        Rootless support for Docker.
root@ser300462488588:~# 

How do I go about cleaning it up and reinstalling it, give me some help!

It gets stranger and stranger. You have the right packages, yet docker info shows you are connecting to an older docker server version. Did you install a second docker engine on your machine? If it were Docker desktop, we would have seen it in the output of docker info, but the version number of the package is different. Please, run this command as well:

snap list docker

and another dpkg

dpkg -l | grep docker

and list the contexts:

docker context ls
root@ser300462488588:~# snap list docker
error: no matching snaps installed
root@ser300462488588:~# dpkg -l | grep docker
ii  docker-buildx-plugin            0.15.1-1~ubuntu.20.04~focal        amd64        Docker Buildx cli plugin.
ii  docker-ce                       5:27.0.2-1~ubuntu.20.04~focal      amd64        Docker: the open-source application container engine
ii  docker-ce-cli                   5:27.0.2-1~ubuntu.20.04~focal      amd64        Docker CLI: the open-source application container engine
ii  docker-ce-rootless-extras       5:27.0.2-1~ubuntu.20.04~focal      amd64        Rootless support for Docker.
ii  docker-compose-plugin           2.28.1-1~ubuntu.20.04~focal        amd64        Docker Compose (V2) plugin for the Docker CLI.
root@ser300462488588:~# docker context ls
NAME        DESCRIPTION                               DOCKER ENDPOINT               ERROR
default *   Current DOCKER_HOST based configuration   unix:///var/run/docker.sock 

Then i don’t know what happened. You are running a wrong Docker version even though you have the right package. My only idea is that you installed Docker ins a special environment where the default socket is redirected to a remote Docker daemon. So the daemon on your machine is possibly not even running.

systemctl status docker

But if it is running, it either uses a different socket or the socket was just overridden by something else.

What is your environment? A physical machine at home? A VPS provider? Some kind of container?

The network issue could be caused by the special environment or a proxy, but I don’t know what this IP address is: 104.244.43.229

Thank you very much for your patience in replying, I am using a VPS;

Maybe it’s because I’ve used other methods to install Docker before and that caused the problem;

Maybe I should try reinstalling the OS.

root@ser300462488588:~# systemctl status docker
● docker.service - Docker Application Container Engine
     Loaded: loaded (/etc/systemd/system/docker.service; enabled; vendor preset: enabled)
     Active: active (running) since Fri 2024-06-28 08:54:53 UTC; 3 days ago
TriggeredBy: ● docker.socket
       Docs: http://docs.docker.io
   Main PID: 2892 (dockerd)
      Tasks: 11 (limit: 9508)
     Memory: 25.2M
     CGroup: /system.slice/docker.service
             └─2892 /opt/kube/bin/dockerd

Jun 28 08:54:54 ser300462488588 dockerd[2892]: time="2024-06-28T08:54:54.052471495Z" level=info msg="Docker daemon" commit=8e96db1 containerd-snapshotter=false storage-driver>
Jun 28 08:54:54 ser300462488588 dockerd[2892]: time="2024-06-28T08:54:54.052553598Z" level=info msg="Daemon has completed initialization"
Jun 28 08:54:54 ser300462488588 dockerd[2892]: time="2024-06-28T08:54:54.119171036Z" level=info msg="API listen on /var/run/docker.sock"
Jun 28 08:56:07 ser300462488588 dockerd[2892]: time="2024-06-28T08:56:07.740031781Z" level=info msg="Download failed, retrying (1/5): dial tcp 103.42.176.244:443: i/o timeout"
Jun 28 08:57:13 ser300462488588 dockerd[2892]: time="2024-06-28T08:57:13.168562484Z" level=info msg="Download failed, retrying (2/5): dial tcp 103.42.176.244:443: i/o timeout"
Jun 28 08:57:42 ser300462488588 dockerd[2892]: time="2024-06-28T08:57:42.433503829Z" level=error msg="Not continuing with pull after error: error pulling image configuration:>
Jul 01 01:28:24 ser300462488588 dockerd[2892]: time="2024-07-01T01:28:24.836377671Z" level=info msg="Error logging in to endpoint, trying next endpoint" error="login attempt >
Jul 01 01:28:24 ser300462488588 dockerd[2892]: time="2024-07-01T01:28:24.847936007Z" level=error msg="Handler for POST /v1.45/auth returned error: login attempt to https://hu>
Jul 01 01:30:03 ser300462488588 dockerd[2892]: time="2024-07-01T01:30:03.910812407Z" level=info msg="Download failed, retrying (1/5): dial tcp 157.240.3.50:443: i/o timeout"
Jul 01 01:30:08 ser300462488588 dockerd[2892]: time="2024-07-01T01:30:08.352024931Z" level=error msg="Not continuing with pull after error: error pulling image configuration:>
root@ser300462488588:~# 

Unfortunately, after reinstalling os the problem is still there.

root@ser300462488588:~# ping google.com
PING google.com (142.251.42.238) 56(84) bytes of data.
64 bytes from tsa01s11-in-f14.1e100.net (142.251.42.238): icmp_seq=1 ttl=52 time=150 ms
64 bytes from tsa01s11-in-f14.1e100.net (142.251.42.238): icmp_seq=2 ttl=52 time=150 ms
^C
--- google.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1008ms
rtt min/avg/max/mdev = 149.960/150.076/150.192/0.116 ms
root@ser300462488588:~# docker version
Client: Docker Engine - Community
 Version:           27.0.3
 API version:       1.46
 Go version:        go1.21.11
 Git commit:        7d4bcd8
 Built:             Sat Jun 29 00:02:33 2024
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          27.0.3
  API version:      1.46 (minimum version 1.24)
  Go version:       go1.21.11
  Git commit:       662f78c
  Built:            Sat Jun 29 00:02:33 2024
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.7.18
  GitCommit:        ae71819c4f5e67bb4d5ae76a6b735f29cc25774e
 runc:
  Version:          1.7.18
  GitCommit:        v1.1.13-0-g58aa920
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
root@ser300462488588:~# docker info
Client: Docker Engine - Community
 Version:    27.0.3
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.15.1
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.28.1
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 0
 Server Version: 27.0.3
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 Swarm: inactive
 Runtimes: runc io.containerd.runc.v2
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: ae71819c4f5e67bb4d5ae76a6b735f29cc25774e
 runc version: v1.1.13-0-g58aa920
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 5.15.0-30-generic
 Operating System: Ubuntu 22.04 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 4
 Total Memory: 7.765GiB
 Name: ser300462488588
 ID: 0bc827b4-627a-49d8-8245-df21319743c4
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

root@ser300462488588:~# docker login
Log in with your Docker ID or email address to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com/ to create one.
You can log in with your password or a Personal Access Token (PAT). Using a limited-scope PAT grants better security and is required for organizations using SSO. Learn more at https://docs.docker.com/go/access-tokens/

Username: dierbei
Password: 
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credential-stores

Login Succeeded
root@ser300462488588:~# ping google.com
PING google.com (142.251.42.238) 56(84) bytes of data.
64 bytes from tsa01s11-in-f14.1e100.net (142.251.42.238): icmp_seq=1 ttl=52 time=150 ms
^C
--- google.com ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 149.971/149.971/149.971/0.000 ms
root@ser300462488588:~# sudo docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
c1ec31eb5944: Pulling fs layer 
^Cdocker: context canceled.
See 'docker run --help'.
root@ser300462488588:~# sudo docker run nginx
Unable to find image 'nginx:latest' locally
latest: Pulling from library/nginx
2cc3ae149d28: Retrying in 1 second 
1018f2b8dba8: Retrying in 1 second 
b831e78d8e20: Retrying in 1 second 
3ab22521e919: Waiting 
5112bf42775b: Waiting 
cbdaf9e4ee2d: Waiting 
a06b6fd631e8: Waiting 
^Cdocker: context canceled.
See 'docker run --help'.
root@ser300462488588:~# docker pull nginx
Using default tag: latest
latest: Pulling from library/nginx
2cc3ae149d28: Waiting 
1018f2b8dba8: Waiting 
b831e78d8e20: Waiting 
3ab22521e919: Waiting 
^Ccontext canceled
root@ser300462488588:~# snap list docker
error: no matching snaps installed
root@ser300462488588:~# dpkg -l | grep docker
ii  docker-buildx-plugin            0.15.1-1~ubuntu.22.04~jammy             amd64        Docker Buildx cli plugin.
ii  docker-ce                       5:27.0.3-1~ubuntu.22.04~jammy           amd64        Docker: the open-source application container engine
ii  docker-ce-cli                   5:27.0.3-1~ubuntu.22.04~jammy           amd64        Docker CLI: the open-source application container engine
ii  docker-ce-rootless-extras       5:27.0.3-1~ubuntu.22.04~jammy           amd64        Rootless support for Docker.
ii  docker-compose-plugin           2.28.1-1~ubuntu.22.04~jammy             amd64        Docker Compose (V2) plugin for the Docker CLI.
root@ser300462488588:~# docker context ls
NAME        DESCRIPTION                               DOCKER ENDPOINT               ERROR
default *   Current DOCKER_HOST based configuration   unix:///var/run/docker.sock   
root@ser300462488588:~# systemctl status docker
● docker.service - Docker Application Container Engine
     Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2024-07-02 02:03:32 UTC; 7min ago
TriggeredBy: ● docker.socket
       Docs: https://docs.docker.com
   Main PID: 7745 (dockerd)
      Tasks: 10
     Memory: 28.7M
        CPU: 2.159s
     CGroup: /system.slice/docker.service
             └─7745 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

Jul 02 02:03:32 ser300462488588 dockerd[7745]: time="2024-07-02T02:03:32.909926958Z" level=info msg="API listen on /run/docker.sock"
Jul 02 02:03:32 ser300462488588 systemd[1]: Started Docker Application Container Engine.
Jul 02 02:05:18 ser300462488588 dockerd[7745]: time="2024-07-02T02:05:18.989670638Z" level=info msg="Download failed, retrying (1/5): dial tcp 67.15.100.252:443: i/o timeout"
Jul 02 02:06:24 ser300462488588 dockerd[7745]: time="2024-07-02T02:06:24.559461496Z" level=info msg="Download failed, retrying (2/5): dial tcp 74.86.228.110:443: i/o timeout"
Jul 02 02:06:53 ser300462488588 dockerd[7745]: time="2024-07-02T02:06:53.692833497Z" level=error msg="Not continuing with pull after error: error pulling image configuration:>
Jul 02 02:08:55 ser300462488588 dockerd[7745]: time="2024-07-02T02:08:55.111120788Z" level=error msg="Not continuing with pull after error: error pulling image configuration:>
Jul 02 02:09:33 ser300462488588 dockerd[7745]: time="2024-07-02T02:09:33.704640364Z" level=info msg="Download failed, retrying (1/5): dial tcp 54.234.18.200:443: i/o timeout"
Jul 02 02:09:33 ser300462488588 dockerd[7745]: time="2024-07-02T02:09:33.707909514Z" level=info msg="Download failed, retrying (1/5): dial tcp 54.234.18.200:443: i/o timeout"
Jul 02 02:09:33 ser300462488588 dockerd[7745]: time="2024-07-02T02:09:33.708522674Z" level=info msg="Download failed, retrying (1/5): dial tcp 54.234.18.200:443: i/o timeout"
Jul 02 02:10:04 ser300462488588 dockerd[7745]: time="2024-07-02T02:10:04.812556183Z" level=error msg="Not continuing with pull after error: error pulling image configuration:>
root@ser300462488588:~# 

I think it might not be a Docker problem, it’s a net problem.

I need to consult the operator.

Thank you so much for your patience in replying, I’ve gotten a lot of help.