moby / moby/swarmkit

Subnet overlap error is ignored

Open
#2,398 1 comment 1 reaction 1 assignee View on GitHub

@nishanttotla is already working on this.

Since Oct 6, 2017.

area/networking kind/bug
Dominant language
Go
Stars
3.7k
Forks
676
Avg merge
4d 9h
Merged PRs (30d)
6

Description

When I create 2 networks with overlapping subnets, the allocator fails as expected. But the error is consumed at swarmkit and hence the network is created in inconsistent state (the driver field is empty). In the example below, the wtnet2's driver is not overlay and the daemon logs shows the subnet overlap error.

root@Ubuntu-vm ~ $ docker network create -d overlay --subnet=10.10.0.0/16 wtnet
bm52fabktkk5p5gddsbdf0vwp
root@Ubuntu-vm ~ $ docker network ls | grep wtnet
bm52fabktkk5        wtnet              overlay             swarm

root@Ubuntu-vm ~ $ docker network create -d overlay --subnet=10.10.1.0/24 wtnet2
rgk301uv83vj3p9ac5nqdw4l4
root@Ubuntu-vm ~ $ docker network ls | grep wtnet
bm52fabktkk5        wtnet              overlay             swarm
rgk301uv83vj        wtnet2                                 swarm
DEBU[21843] RequestPool(GlobalDefault, 10.10.1.0/24, , map[], false)
ERRO[21843] Failed allocation for network rgk301uv83vj3p9ac5nqdw4l4  error="failed during network allocation for network rgk301uv83vj3p9ac5nqdw4l4: failed allocating pools and gateway IP for network rgk301uv83vj3p9ac5nqdw4l4: Pool overlaps with other one on this address space" module=node node.id=2ojtm3zuylbi4osers2frp50e

The error must be pushed back to the control-api and the network should be removed from the raft-store and the error is clearly displayed synchronously to the user.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.