### Description
Hi,
I have small Debian virtual machine(on VMware ESXi) wi…th docker and in it I have few containers. Basic stuff really as I'm learning how to use Docker and containers. I was not using this VM for few months, and today, when I wanted to do more testing on it, I found out that docker deamon is not starting. I tried to start it via systemctl and it failed.
I tried to do upgrade of all linux packages(apt update && apt upgrade) as I thought it might be some known bug that was fixed in newer versions. Even after this upgrade and VM restart docker is still not starting up.
Here is what I get when I try to run dockerd as root:
```
root@docker:~# dockerd -D
INFO[2023-10-20T19:24:35.925590878+02:00] Starting up
DEBU[2023-10-20T19:24:35.925955782+02:00] Listener created for HTTP on unix (/var/run/docker.sock)
DEBU[2023-10-20T19:24:35.926543490+02:00] Golang's threads limit set to 13860
DEBU[2023-10-20T19:24:35.926894337+02:00] metrics API listening on /var/run/docker/metrics.sock
DEBU[2023-10-20T19:24:35.929172038+02:00] Using default logging driver json-file
DEBU[2023-10-20T19:24:35.929471417+02:00] processing event stream module=libcontainerd namespace=plugins.moby
DEBU[2023-10-20T19:24:35.929764625+02:00] No quota support for local volumes in /var/lib/docker/volumes: Filesystem does not support, or has not enabled quotas
DEBU[2023-10-20T19:24:35.930740049+02:00] [graphdriver] priority list: [overlay2 fuse-overlayfs btrfs zfs devicemapper vfs]
DEBU[2023-10-20T19:24:35.933088295+02:00] successfully detected metacopy status storage-driver=overlay2 usingMetacopy=false
DEBU[2023-10-20T19:24:35.934324796+02:00] backingFs=extfs, projectQuotaSupported=false, usingMetacopy=false, indexOff="index=off,", userxattr="" storage-driver=overlay2
INFO[2023-10-20T19:24:35.934343952+02:00] [graphdriver] using prior storage driver: overlay2
DEBU[2023-10-20T19:24:35.934353370+02:00] Initialized graph driver overlay2
DEBU[2023-10-20T19:24:35.937311776+02:00] Max Concurrent Downloads: 3
DEBU[2023-10-20T19:24:35.937334268+02:00] Max Concurrent Uploads: 5
DEBU[2023-10-20T19:24:35.937338637+02:00] Max Download Attempts: 5
INFO[2023-10-20T19:24:35.937354186+02:00] Loading containers: start.
DEBU[2023-10-20T19:24:35.937671249+02:00] processing event stream module=libcontainerd namespace=moby
DEBU[2023-10-20T19:24:35.938464768+02:00] loaded container container=5c3fb96d20ca739cd430655d16f9c9aabd5ec349afb9f218c08561c61c2866eb paused=false running=false
DEBU[2023-10-20T19:24:35.938596138+02:00] loaded container container=0b9d85dae40f26b0f388deed4ad2a06001595b95e340e09539d99a68ba531af1 paused=false running=false
DEBU[2023-10-20T19:24:35.942886086+02:00] restoring container container=5c3fb96d20ca739cd430655d16f9c9aabd5ec349afb9f218c08561c61c2866eb paused=false restarting=false running=false
DEBU[2023-10-20T19:24:35.943010633+02:00] restoring container container=0b9d85dae40f26b0f388deed4ad2a06001595b95e340e09539d99a68ba531af1 paused=false restarting=false running=false
DEBU[2023-10-20T19:24:35.943751752+02:00] done restoring container container=0b9d85dae40f26b0f388deed4ad2a06001595b95e340e09539d99a68ba531af1 paused=false restarting=false running=false
DEBU[2023-10-20T19:24:35.943764787+02:00] done restoring container container=5c3fb96d20ca739cd430655d16f9c9aabd5ec349afb9f218c08561c61c2866eb paused=false restarting=false running=false
DEBU[2023-10-20T19:24:35.944077171+02:00] Option DefaultDriver: bridge
DEBU[2023-10-20T19:24:35.944102920+02:00] Option DefaultNetwork: bridge
DEBU[2023-10-20T19:24:35.944114702+02:00] Network Control Plane MTU: 1500
DEBU[2023-10-20T19:24:35.947574691+02:00] /usr/sbin/iptables, [--wait -t filter -C FORWARD -j DOCKER-ISOLATION]
DEBU[2023-10-20T19:24:35.948499009+02:00] /usr/sbin/iptables, [--wait -t nat -D PREROUTING -m addrtype --dst-type LOCAL -j DOCKER]
DEBU[2023-10-20T19:24:35.949539177+02:00] /usr/sbin/iptables, [--wait -t nat -D OUTPUT -m addrtype --dst-type LOCAL ! --dst 127.0.0.0/8 -j DOCKER]
DEBU[2023-10-20T19:24:35.951134450+02:00] /usr/sbin/iptables, [--wait -t nat -D OUTPUT -m addrtype --dst-type LOCAL -j DOCKER]
DEBU[2023-10-20T19:24:35.952296099+02:00] /usr/sbin/iptables, [--wait -t nat -D PREROUTING]
DEBU[2023-10-20T19:24:35.953160413+02:00] /usr/sbin/iptables, [--wait -t nat -D OUTPUT]
DEBU[2023-10-20T19:24:35.953946718+02:00] /usr/sbin/iptables, [--wait -t nat -F DOCKER]
DEBU[2023-10-20T19:24:35.955240789+02:00] /usr/sbin/iptables, [--wait -t nat -X DOCKER]
DEBU[2023-10-20T19:24:35.956192278+02:00] /usr/sbin/iptables, [--wait -t filter -F DOCKER]
DEBU[2023-10-20T19:24:35.957034409+02:00] /usr/sbin/iptables, [--wait -t filter -X DOCKER]
DEBU[2023-10-20T19:24:35.958301849+02:00] /usr/sbin/iptables, [--wait -t filter -F DOCKER-ISOLATION-STAGE-1]
DEBU[2023-10-20T19:24:35.959178456+02:00] /usr/sbin/iptables, [--wait -t filter -X DOCKER-ISOLATION-STAGE-1]
DEBU[2023-10-20T19:24:35.960404447+02:00] /usr/sbin/iptables, [--wait -t filter -F DOCKER-ISOLATION-STAGE-2]
DEBU[2023-10-20T19:24:35.961308597+02:00] /usr/sbin/iptables, [--wait -t filter -X DOCKER-ISOLATION-STAGE-2]
DEBU[2023-10-20T19:24:35.962494081+02:00] /usr/sbin/iptables, [--wait -t filter -F DOCKER-ISOLATION]
DEBU[2023-10-20T19:24:35.963281438+02:00] /usr/sbin/iptables, [--wait -t filter -X DOCKER-ISOLATION]
DEBU[2023-10-20T19:24:35.964447425+02:00] /usr/sbin/iptables, [--wait -t nat -n -L DOCKER]
DEBU[2023-10-20T19:24:35.965263467+02:00] /usr/sbin/iptables, [--wait -t nat -N DOCKER]
DEBU[2023-10-20T19:24:35.965998455+02:00] /usr/sbin/iptables, [--wait -t filter -n -L DOCKER]
DEBU[2023-10-20T19:24:35.966759462+02:00] /usr/sbin/iptables, [--wait -t filter -N DOCKER]
DEBU[2023-10-20T19:24:35.967936200+02:00] /usr/sbin/iptables, [--wait -t filter -n -L DOCKER-ISOLATION-STAGE-1]
DEBU[2023-10-20T19:24:35.968994893+02:00] /usr/sbin/iptables, [--wait -t filter -N DOCKER-ISOLATION-STAGE-1]
DEBU[2023-10-20T19:24:35.969733417+02:00] /usr/sbin/iptables, [--wait -t filter -n -L DOCKER-ISOLATION-STAGE-2]
DEBU[2023-10-20T19:24:35.971047235+02:00] /usr/sbin/iptables, [--wait -t filter -N DOCKER-ISOLATION-STAGE-2]
DEBU[2023-10-20T19:24:35.971899065+02:00] /usr/sbin/iptables, [--wait -t filter -C DOCKER-ISOLATION-STAGE-1 -j RETURN]
DEBU[2023-10-20T19:24:35.973222221+02:00] /usr/sbin/iptables, [--wait -A DOCKER-ISOLATION-STAGE-1 -j RETURN]
DEBU[2023-10-20T19:24:35.974073610+02:00] /usr/sbin/iptables, [--wait -t filter -C DOCKER-ISOLATION-STAGE-2 -j RETURN]
DEBU[2023-10-20T19:24:35.974960827+02:00] /usr/sbin/iptables, [--wait -A DOCKER-ISOLATION-STAGE-2 -j RETURN]
panic: page 3 already freed
goroutine 1 [running, locked to thread]:
go.etcd.io/bbolt.(*freelist).free(0xc0009f9900, 0x339, 0x7f5694f1d000)
/root/build-deb/engine/vendor/go.etcd.io/bbolt/freelist.go:175 +0x2c8
go.etcd.io/bbolt.(*node).spill(0xc0005f4cb0)
/root/build-deb/engine/vendor/go.etcd.io/bbolt/node.go:363 +0x1a8
go.etcd.io/bbolt.(*node).spill(0xc0005f4c40)
/root/build-deb/engine/vendor/go.etcd.io/bbolt/node.go:350 +0xa9
go.etcd.io/bbolt.(*Bucket).spill(0xc00007f680)
/root/build-deb/engine/vendor/go.etcd.io/bbolt/bucket.go:584 +0x33f
go.etcd.io/bbolt.(*Bucket).spill(0xc0004aa638)
/root/build-deb/engine/vendor/go.etcd.io/bbolt/bucket.go:551 +0x107
go.etcd.io/bbolt.(*Tx).Commit(0xc0004aa620)
/root/build-deb/engine/vendor/go.etcd.io/bbolt/tx.go:163 +0x10a
go.etcd.io/bbolt.(*DB).Update(0xc0007705f0?, 0xc0011be640)
/root/build-deb/engine/vendor/go.etcd.io/bbolt/db.go:869 +0xe5
github.com/docker/libkv/store/boltdb.(*BoltDB).Put(0xc0007705f0, {0xc000c749c0, 0x23}, {0x562560076ef0, 0x0, 0x0}, 0xc0006da390?)
/root/build-deb/engine/vendor/github.com/docker/libkv/store/boltdb/boltdb.go:187 +0x225
github.com/docker/docker/libnetwork/datastore.(*datastore).ensureParent(0xc000988d40, {0xc000c749c0, 0x23})
/root/build-deb/engine/libnetwork/datastore/datastore.go:476 +0x90
github.com/docker/docker/libnetwork/datastore.(*datastore).iterateKVPairsFromStore(0xc000988d40, {0xc000c749c0, 0x23}, {0x56255edb4500?, 0xc0006da390?}, 0xc0011be7c8)
/root/build-deb/engine/libnetwork/datastore/datastore.go:508 +0x8d
github.com/docker/docker/libnetwork/datastore.(*datastore).Map(0xc000988d40, {0xc000c749c0, 0x23}, {0x56255edb4500, 0xc0006da390})
/root/build-deb/engine/libnetwork/datastore/datastore.go:547 +0x15b
github.com/docker/docker/libnetwork.(*Controller).getNetworksFromStore(0xc000894000)
/root/build-deb/engine/libnetwork/store.go:104 +0x30a
github.com/docker/docker/libnetwork.(*Controller).Networks(0x56255eda5b20?)
/root/build-deb/engine/libnetwork/controller.go:786 +0x1d
github.com/docker/docker/libnetwork.(*Controller).WalkNetworks(0x56255ed90460?, 0x56255ed6f5a8)
/root/build-deb/engine/libnetwork/controller.go:798 +0x1e
github.com/docker/docker/libnetwork.New({0xc0008f4230, 0x8, 0xe})
/root/build-deb/engine/libnetwork/controller.go:153 +0x55a
github.com/docker/docker/daemon.(*Daemon).initNetworkController(0xc000d12480, 0xc000541980)
/root/build-deb/engine/daemon/daemon_unix.go:853 +0x4e
github.com/docker/docker/daemon.(*Daemon).restore(0xc000d12480)
/root/build-deb/engine/daemon/daemon.go:508 +0x6bd
github.com/docker/docker/daemon.NewDaemon({0x56255eda4f18?, 0xc000940320}, 0xc000948500, 0xc000c82d20, 0xc000c80280)
/root/build-deb/engine/daemon/daemon.go:1135 +0x2fde
main.(*DaemonCli).start(0xc00093cec0, 0xc0009397a0)
/root/build-deb/engine/cmd/dockerd/daemon.go:232 +0xae9
main.runDaemon(...)
/root/build-deb/engine/cmd/dockerd/docker_unix.go:14
main.newDaemonCommand.func1(0xc00089a000?, {0xc000932e50?, 0x1?, 0x1?})
/root/build-deb/engine/cmd/dockerd/docker.go:39 +0x94
github.com/spf13/cobra.(*Command).execute(0xc00089a000, {0xc000052070, 0x1, 0x1})
/root/build-deb/engine/vendor/github.com/spf13/cobra/command.go:916 +0x862
github.com/spf13/cobra.(*Command).ExecuteC(0xc00089a000)
/root/build-deb/engine/vendor/github.com/spf13/cobra/command.go:1044 +0x3bd
github.com/spf13/cobra.(*Command).Execute(...)
/root/build-deb/engine/vendor/github.com/spf13/cobra/command.go:968
main.main()
/root/build-deb/engine/cmd/dockerd/docker.go:109 +0x18c
root@docker:~#
```
In the log, last action before it starts printing trace is related to iptables. I tried to run last commend manually and it is executed correctly, no error is given so I don;t think it is iptables related.
### Reproduce
I don't know how to reproduce it.
### Expected behavior
Docker should start automatically during VM boot.
### docker version
```bash
root@docker:~# docker version
Client: Docker Engine - Community
Version: 24.0.6
API version: 1.43
Go version: go1.20.7
Git commit: ed223bc
Built: Mon Sep 4 12:32:16 2023
OS/Arch: linux/amd64
Context: default
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
root@docker:~#
```
### docker info
```bash
root@docker:~# docker info
Client: Docker Engine - Community
Version: 24.0.6
Context: default
Debug Mode: false
Plugins:
buildx: Docker Buildx (Docker Inc.)
Version: v0.11.2
Path: /usr/libexec/docker/cli-plugins/docker-buildx
compose: Docker Compose (Docker Inc.)
Version: v2.21.0
Path: /usr/libexec/docker/cli-plugins/docker-compose
Server:
ERROR: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
errors pretty printing info
root@docker:~#
```
### Additional Info
_No response_