docker / cli

The Docker CLI
Apache License 2.0
4.74k stars 1.88k forks source link

False address already in use #5136

Closed Tohjuler closed 3 weeks ago

Tohjuler commented 3 weeks ago

Description

After a restart of my server, some containers can't start because of Address already in use, but they ran fine before the restart. And sudo lsof -i -P -n | grep LISTEN says that the port is not in use.

The bug has been there since 26.0.0, but sometime it will be fixed by restarting the server. I haven't seen this bug on any other server. I am considering reinstalling the server, but wanted to share the bug first.

Reproduce

docker start

Expected behavior

No response

docker version

Client: Docker Engine - Community
 Version:           26.1.4
 API version:       1.45
 Go version:        go1.21.11
 Git commit:        5650f9b
 Built:             Wed Jun  5 11:29:35 2024
 OS/Arch:           linux/arm64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          26.1.4
  API version:      1.45 (minimum version 1.24)
  Go version:       go1.21.11
  Git commit:       de5c9cf
  Built:            Wed Jun  5 11:29:35 2024
  OS/Arch:          linux/arm64
  Experimental:     true
 containerd:
  Version:          1.6.33
  GitCommit:        d2d58213f83a351ca8f528a95fbd145f5654e957
 runc:
  Version:          1.1.12
  GitCommit:        v1.1.12-0-g51d5e94
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

docker info

Client: Docker Engine - Community
 Version:    26.1.4
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.14.1
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.27.1
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Server:
 Containers: 37
  Running: 32
  Paused: 0
  Stopped: 5
 Images: 42
 Server Version: 26.1.4
 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: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: d2d58213f83a351ca8f528a95fbd145f5654e957
 runc version: v1.1.12-0-g51d5e94
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 5.15.0-112-generic
 Operating System: Ubuntu 22.04.4 LTS
 OSType: linux
 Architecture: aarch64
 CPUs: 4
 Total Memory: 7.556GiB
 Name: ub-8gb-fsn-P-Web
 ID: 03f37f8c-27b4-4c92-a3d5-f4ffd2e2fc39
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: true
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

Additional Info

No response

akerouanton commented 3 weeks ago

Hi @Tohjuler,

After a restart of my server, some containers can't start because of Address already in use, but they ran fine before the restart.

Could you provide more details about where you see this? It'd be helpful to have the complete error message included, and the output of docker inspect ... for one of the affected containers. Could you also include the output of sudo ss -tlpn 'sport = :<affected_port>?

EDIT: Ah, just realized this issue was probably filed against the wrong repo -- this should have been opened in https://github.com/moby/moby. Could you open a new issue there, including all details requested above?

Tohjuler commented 3 weeks ago

Okay, I will close this and reopen it in moby/moby

thaJeztah commented 3 weeks ago