dokploy icon indicating copy to clipboard operation
dokploy copied to clipboard

Error response from daemon: all predefined address pools have been fully subnetted.

Open aleksander-pankow opened this issue 7 months ago • 1 comments

To Reproduce

  1. Create a application
  2. Click Deploy
  3. Get this error

When I attempt to create a new application, I encounter the following Docker error: Error response from daemon: all predefined address pools have been fully subnetted.

Could you advise on how to resolve this issue?

Current vs. Expected behavior

Following the steps from the previous section.

Provide environment information

Ubuntu 24.04
Dokploy Version v0.22.6

Which area(s) are affected? (Select all that apply)

Application

Are you deploying the applications where Dokploy is installed or on a remote server?

Same server where Dokploy is installed

Additional context

No response

Will you send a PR to fix it?

No

aleksander-pankow avatar May 23 '25 15:05 aleksander-pankow

@aleksander-pankow This sounds like an issue with normal docker networks ( for swarm overlays, you shouldn't see this error)

the default subnet for normal docker networks, means you can only have 32? or so networks before all address pools are exhausted.

solution

  1. remove unused docker networks

  2. alter the default address pool in /etc/docker/daemon.json to be something like the following ( a docker restart would be required):

{
  "default-address-pools" : [
    {
      "base" : "172.17.0.0/12",
      "size" : 20
    },
    {
      "base" : "192.168.0.0/16",
      "size" : 24
    }
  ]
}

edit address range as required but this will now give you 512 networks, with range of 256 - 4096 hosts per network depending on base

for swarm overlays, the default is 10.0.0.0/8 where each mask is /24 meaning you have a huge number of networks, each limited to 256 hosts so i doubt this is swarm overlay error

djsisson avatar May 24 '25 12:05 djsisson

alter the default address pool in /etc/docker/daemon.json

Folder is empty. I read this information in forums, but I don't have /etc/docker/daemon.json.

Console log:

root@host:~# cd /etc/docker/
root@host:/etc/docker# ls
root@host:/etc/docker# 

aleksander-pankow avatar May 26 '25 09:05 aleksander-pankow

@aleksander-pankow then create the file, with those contents if the file doesn't exist

i will add you should really add the default logging options in there as well, otherwise you end up with too many log files

{
  "log-driver": "json-file",
  "log-opts": {
    "max-file": "3",
    "max-size": "10m"
  },
  "default-address-pools" : [
    {
      "base" : "172.17.0.0/12",
      "size" : 20
    },
    {
      "base" : "192.168.0.0/16",
      "size" : 24
    }
  ]
}

djsisson avatar May 26 '25 09:05 djsisson

i will add, this won't magically fix your situation, unless you remove existing networks, since they have already been created with the old subnets

djsisson avatar May 26 '25 09:05 djsisson

You can also try to run docker network prune, usually this cleanup all the unused networks It may help, although there are also certain operating systems that may have limitations in terms of networking.

You can run docker network prune

Siumauricio avatar Jul 28 '25 05:07 Siumauricio

For now we can close this issue.

Siumauricio avatar Aug 03 '25 03:08 Siumauricio