Docker commands not showing any output

Hi team, I have installed docker.io in ubuntu 22.04, suddenly docker commands failed to throw any outputs.
I can confirm my containers are up and running since I can access the web applications running on the containers. It doesn’t even shows any errors

Below are the commands which I ran.

root@unilab-monitor:/home/user# docker ps
root@unilab-monitor:/home/user# docker ps -a
root@unilab-monitor:/home/user# docker --version
root@unilab-monitor:/home/user# docker image ls
root@unilab-monitor:/home/user#

Below is the status of docker service.

root@unilab-monitor:/home/user# systemctl status docker
● docker.service - Docker Application Container Engine
     Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2025-03-24 15:35:04 IST; 20h ago
TriggeredBy: ● docker.socket
       Docs: https://docs.docker.com
   Main PID: 1021 (dockerd)
      Tasks: 75
     Memory: 97.8M
        CPU: 27.879s
     CGroup: /system.slice/docker.service
             ├─1021 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
             ├─2263 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 8086 -container-ip 172.24.0.2 -container-port 8086
             ├─2334 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 8086 -container-ip 172.24.0.2 -container-port 8086
             ├─2376 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 3000 -container-ip 172.24.0.3 -container-port 3000
             ├─2383 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 3000 -container-ip 172.24.0.3 -container-port 3000
             ├─2397 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 9090 -container-ip 172.24.0.4 -container-port 9090
             └─2404 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 9090 -container-ip 172.24.0.4 -container-port 9090

Mar 24 15:35:03 unilab-monitor dockerd[1021]: time="2025-03-24T15:35:03.413366460+05:30" level=info msg="Loading containers: start."
Mar 24 15:35:03 unilab-monitor dockerd[1021]: time="2025-03-24T15:35:03.834519062+05:30" level=info msg="Default bridge (docker0) is assigned with an IP addr>
Mar 24 15:35:03 unilab-monitor dockerd[1021]: time="2025-03-24T15:35:03.902010701+05:30" level=info msg="No non-localhost DNS nameservers are left in resolv.>
Mar 24 15:35:03 unilab-monitor dockerd[1021]: time="2025-03-24T15:35:03.933483619+05:30" level=info msg="No non-localhost DNS nameservers are left in resolv.>
Mar 24 15:35:03 unilab-monitor dockerd[1021]: time="2025-03-24T15:35:03.941377416+05:30" level=info msg="No non-localhost DNS nameservers are left in resolv.>
Mar 24 15:35:04 unilab-monitor dockerd[1021]: time="2025-03-24T15:35:04.249929322+05:30" level=info msg="Loading containers: done."
Mar 24 15:35:04 unilab-monitor dockerd[1021]: time="2025-03-24T15:35:04.406820493+05:30" level=info msg="Docker daemon" commit="26.1.3-0ubuntu1~22.04.1" cont>
Mar 24 15:35:04 unilab-monitor dockerd[1021]: time="2025-03-24T15:35:04.407248760+05:30" level=info msg="Daemon has completed initialization"
Mar 24 15:35:04 unilab-monitor dockerd[1021]: time="2025-03-24T15:35:04.434676912+05:30" level=info msg="API listen on /run/docker.sock"
Mar 24 15:35:04 unilab-monitor systemd[1]: Started Docker Application Container Engine.

Something must have happened with the “docker” executable. If it is empty or if it is failing, you will get no output. Try the following:

file $(which docker)

It should returned something like this but the architecture could be different:

/usr/bin/docker: ELF 64-bit LSB pie executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, BuildID[sha1]=f64f4bc6678da60d2560792b1d12588a6b9f09da, for GNU/Linux 3.7.0, with debug_info, not stripped

or you can try this to see if the command fails with an exit code:

docker --version; echo $?

This is what I get:

Docker version 28.0.1, build 068a01e
0

If you get only “1”, or any non-zero exit code, the command failed.

If the executable is broken, you will need to reinstall the Docker client from the docker-ce-cli package assuming you installed Docker Engine from the docker-ce package as suggested in the documentation..