Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR: Pool overlaps with other one on this address space #85

Closed
daamien opened this issue Jul 23, 2017 · 27 comments
Closed

ERROR: Pool overlaps with other one on this address space #85

daamien opened this issue Jul 23, 2017 · 27 comments

Comments

@daamien
Copy link

daamien commented Jul 23, 2017

Hi

Thanks for this projet ! Installing Mailman3 is tricky and I hope your docker images will help

However I'm getting an error at the early stage:

$ docker-compose up
Creating network "dockermailman_mailman" with driver "bridge"
ERROR: Pool overlaps with other one on this address space

the host is a regular Linux box:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.1 LTS
Release:        16.04
Codename:       xenial

$ uname -a
Linux Hammer 4.4.0-59-generic #80-Ubuntu SMP Fri Jan 6 17:47:47 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

The docker version seems up to date

docker version
Client:
 Version:      17.05.0-ce
 API version:  1.29
 Go version:   go1.7.5
 Git commit:   89658be
 Built:        Thu May  4 22:10:54 2017
 OS/Arch:      linux/amd64

Server:
 Version:      17.05.0-ce
 API version:  1.29 (minimum version 1.12)
 Go version:   go1.7.5
 Git commit:   89658be
 Built:        Thu May  4 22:10:54 2017
 OS/Arch:      linux/amd64
 Experimental: false
@maxking
Copy link
Owner

maxking commented Jul 23, 2017

Are you using 172.19.199.1/24 subnet for something else in your network?

The default compose file provided uses this subnet to create a bridge network and allocates static IPs to the containers.

If this subnet is already in use, you can just change it to a different subnet. You'd have to change
environment variables and other IPAddresses allocated to each container too.

See the docker-compose.yaml file in the root of the project.

@daamien
Copy link
Author

daamien commented Jul 23, 2017

Hi !

Thanks for the quick answer 👍

FTR I am using the docker-compose.yaml file at the root of the project

There's no other docker containers running on the host while I'm doing this test.

I changed the subnet to 172.20.199.1/24 and modified the other IP adresse accordingly and I still get the same error..

@maxking
Copy link
Owner

maxking commented Jul 23, 2017

Not exactly sure about what is going on but this thread from docker might be relevant?

@daamien
Copy link
Author

daamien commented Jul 24, 2017

Hi !

Actually it seems that a simple sevirce docker restart solved the issue.

Sorry about that. Thanks for your help !

@daamien daamien closed this as completed Jul 24, 2017
@Pitastic
Copy link

Pitastic commented Dec 5, 2017

In case someone else is google'ing here: Even if the containers are down the networks are still persist. With no container running docker network prune did it. Guess restarting the service returns the same result.

@maxking
Copy link
Owner

maxking commented Dec 5, 2017

I think the semantics depend on how you actually stop the containers, docker-compose stop actually only stops the containers, but, docker-compose down stops and remove the containers & network.

https://docs.docker.com/compose/reference/down/
https://docs.docker.com/compose/reference/stop/

@narehreddythumma
Copy link

Working when I delete the pool network

docker network ls
NETWORK ID          NAME                          DRIVER              SCOPE  
8518cc751c09        bridge                        bridge              local  
5ebc27713033       pool_network              bridge              local  
25ff8d61d971        host                          host                local  
85c5507b6e64        none                          null                local

remove the pool_network

docker network rm pool_network

@tmrdurgun
Copy link

İt was about the wrong ip address in compose.yml in my case

@vanduc1102
Copy link

my case, I have to tun

docker-compose down
docker network prune

Then restart Docker service.

@idreesandroid
Copy link

version: "3"

networks:
tut07-frontend:
driver: bridge
ipam:
driver: default
config:
- subnet: 172.10.1.0/24
tut07-backend:
driver: bridge
ipam:
driver: default
config:
- subnet: 172.10.2.0/23

services:
tut07-db:
build: ./db
command: --default-authentication-plugin=mysql_native_password
ports:
- 3306:3306
networks:
tut07-backend:
ipv4_address: 172.10.3.2
env_file:
- ./development.env
tut07-www:
build: ./www
ports:
- 8080:80
volumes:
- ./src:/var/www/html/
networks:
tut07-backend:
ipv4_address: 172.10.2.2
tut07-frontend:
ipv4_address: 172.10.1.2
depends_on:
- tut07-db
env_file:
- ./development.env

#######################################################
above is my docker compose yml file but i got the same error even i have change

@My-Only-wan
Copy link

docker network prune

@panchocasanova
Copy link

In case someone else is google'ing here: Even if the containers are down the networks are still persist. With no container running docker network prune did it. Guess restarting the service returns the same result.

it´s worked for me. Thanks you.

@arunodhayam10d
Copy link

arunodhayam10d commented Oct 21, 2021

I have tried with docker network prune but after docker-compose up it will show again. Its not work for me.
Shall I remove docker completely and reinstall it??
Also, I restart the docker service. It's Not worked for me.

@z3roCoo1
Copy link

z3roCoo1 commented Nov 8, 2021

In case someone else is google'ing here: Even if the containers are down the networks are still persist. With no container running docker network prune did it. Guess restarting the service returns the same result.

For me docker network prune did it whereas service docker restart did not. I'm running the container with macvlan network.

@briosheje
Copy link

In case you are configuring docker networks with bridge mode and in case you are assigning pool of addresses, make sure each stack has a unique subnet, in my case I had two docker-compose files using the same subnet:

    driver: bridge
    ipam:
      driver: default
      config:
        - subnet: 192.168.175.0/24

In my case, subnet 192.168.175.0/24 was used by two stacks, hence the error.

@bSushil
Copy link

bSushil commented Mar 11, 2022

I also had the same issue. Here is how I fixed it:

  1. Listed active networks with docker network list
  2. Removed clean_default network with docker network rm clean_default
  3. Removed any active container by docker container stop (container id) and docker container prune
  4. Restarted with docker-compose up -d

Doing these fixed the issue for me.

@KES777
Copy link

KES777 commented May 20, 2022

@briosheje Hi, Is it possible to configure docker compose to allow stack to reuse subnets? In case I run multiple stacks for one docker-compose.yml file. I name each stack with own -p option but want each stack to reuse specified subnet. Is that possible?

@briosheje
Copy link

@briosheje Hi, Is it possible to configure docker compose to allow stack to reuse subnets? In case I run multiple stacks for one docker-compose.yml file. I name each stack with own -p option but want each stack to reuse specified subnet. Is that possible?

I don't think so, the cleverest is probably to create a network outside the docker-compose first, then use it in docker-compose as "external" (check here for an example: https://stackoverflow.com/questions/38088279/communication-between-multiple-docker-compose-projects), in this way the same address pool is reused (and the same network is used).

@KES777
Copy link

KES777 commented May 20, 2022

@briosheje No, I do not want to allow containers to communicate with each other. Those are different testing context thus should be isolated. I want to run them as:

docker compose -p proj-${BUILD_NUMBER} up --detach
docker compose -p proj-${BUILD_NUMBER} up --detach
docker compose -p proj-${BUILD_NUMBER} up --detach

@dyduai
Copy link

dyduai commented Jun 28, 2022

The answer stating to do a docker network prune or service restart are partially correct. Yes indeed it would fix the issue when there is indeed a conflict with IP range.
But this does not apply when there are no conflicts :

$ for name in  $(docker network ls --format '{{.Name}}' ) ; do echo $name ; docker inspect $name --format '{{ .IPAM.Config }}' ; done

bridge
[{172.17.0.0/16  172.17.0.1 map[]}]
host
[]
none
[]
staging-***
[{172.108.0.0/24   map[]}]
staging-****
[{172.21.0.0/16  172.21.0.1 map[]}]
staging-***
[{172.24.0.0/16  172.24.0.1 map[]}]
staging-***
[{172.50.0.0/24   map[]}]
staging-***
[{172.25.0.0/16  172.25.0.1 map[]}]
staging-***
[{172.26.0.0/16  172.26.0.1 map[]}]
staging-***
[{172.27.0.0/16  172.27.0.1 map[]}]
staging-***
[{172.22.0.0/16  172.22.0.1 map[]}]
staging-**
[{172.28.0.0/16  172.28.0.1 map[]}]
staging-**
[{172.18.0.0/16 172.18.3.0/24 172.18.3.254 map[]}]

When restarting the compose describing [{172.108.0.0/24 map[]}], it throws the error ' Pool overlaps with other one on this address space'. The compose is exactly the same than previous run, the IPAM config did not changed, the compose project name is the same.
I would expect dockercompose to use the existing same network, not throw an error... And that works fine with a lot of other projects

@mdakram28
Copy link

@briosheje No, I do not want to allow containers to communicate with each other. Those are different testing context thus should be isolated. I want to run them as:

docker compose -p proj-${BUILD_NUMBER} up --detach
docker compose -p proj-${BUILD_NUMBER} up --detach
docker compose -p proj-${BUILD_NUMBER} up --detach

You could use different subnet for each docker compose app.

In my case I was creating too many networks. Here's an example of how I fixed it.

networks:
  default:
    ipam:
      config:
        - subnet: 172.16.${NETWORK_ID}.0/24

And then give a unique NETWORK_ID for each run.

docker compose -p proj-${BUILD_NUMBER} up --detach -e NETWORK_ID=1
docker compose -p proj-${BUILD_NUMBER} up --detach -e NETWORK_ID=2
docker compose -p proj-${BUILD_NUMBER} up --detach -e NETWORK_ID=3

If you run out of network ids (0-255) you can create a pool of numbers (0-255) and take a number from the pool for your network_id when you create the network and put it back in the pool when the compose application finishes.

@KES777
Copy link

KES777 commented Aug 22, 2022

@mdakram28 Ok, We can workaround. But why I should do this if private network could be private for each stack? Like 10.0.0.0/8 networks are reusable among different offices in the world. This is no any problem that 192.168.0.1/24 is used by each router, because networks are private and isolated from each other. Same should be for containers.

Why containers may not use same network if theirs networks are isolated from each other??

@williamkoller
Copy link

i added the network without the driver and it worked

@a7993n
Copy link

a7993n commented Apr 3, 2023

Change your subnet 172.* to 192.*

@horizonvert1027
Copy link

horizonvert1027 commented May 24, 2023

I have create docker container with
docker-compose -f /var/www/klustering-saas/docker-compose.yml up -d
the content is here
version: '3.8'
x-common:
database: ...
panel:
image: ghcr.io/horizonvert1027/klustering:latest
restart: always
ports:
- '3001:80'
..................
networks:
- exam-bridge-network
networks:
exam-bridge-network:
driver: bridge
ipam:
config:
- subnet: 172.20.0.0/16
successfully, and then I also try one more like this way
docker-compose -f /var/www/klustering-saas/docker-compose.yml up -d
in here I have updated network from exam to blog only.
version: '3.8'
x-common:
database: ...
panel:
image: ghcr.io/horizonvert1027/klustering:latest
restart: always
ports:
- '3001:80'
..................
networks:
- exam-bridge-network
networks:
exam-bridge-network:
driver: bridge
ipam:
config:
- subnet: 172.20.0.0/16
Then, I have this error ERROR: Pool overlaps with other one on this address space, I think I have to change IP address of subnet at docker-compose.yml.
Question:

  • where related this IP address?
  • when I want to create lots of docker container in aws ubuntu server, How to set this IP address of container?

@aliuskonte
Copy link

Change your subnet 172.* to 192.*

Thank you. It halped me

@jskcnsl
Copy link

jskcnsl commented Feb 22, 2024

Is there any way to change the default bridge subnet 172.19.199.1/24 ? I can't start docker.service after reboot with the same error, so I can't change containers' subnet ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests