Suddenly when I want to create a network (either with docker network create test or with a docker compose file and an implicit network) I get the error mentioned in the title. It seems to imply that I run a lot of networks but docker network ls shows only what seems to be the default networks: bridge, host, none.
Only restarting my system seems to help, and since I did that after a bit of restarting containers and networks, the error appeared again.
Adding the following to my /etc/docker/daemon.json hasn’t helped either. This is recommended on many posts online.
Defining address pools helps only if you use too many networks and fewer IP addresses are enough in one network or when there are other virtual or physical networks on the host detected by Docker so it cannot create a new one.
I created 30 network with the default settings and the 31st gave me the same error (older Docker CE had a different error message for the same). I deleted one network, the 3rd and I could create a new network.
I remember the old issue when Docker couldn’t reuse subnets that became available again and restarting the Docker daemon helped, but it didn’t require restarting the whole machine.
I used Ubuntu. I don’t know how Docker behaves on AlmaLinux, but it is not officially supported. It doesn’t matter if it is based on a supported one.