Docker Not Starting " Could Not Delete the Default Bridge Network: Network Bridge Has Active Endpoints""

Docker not starting could not delete the default bridge network: network bridge has active endpoints

I had a similar issue after upgrading.

Run

sudo mv /var/lib/docker/network/files/ /tmp/dn-bak

to reset your networks. Then restart docker (sudo systemctl restart docker or sudo service docker restart depending on your OS).

If everything works again you can delete the dn-bak directory.

error while removing network: network id has active endpoints

To list your networks, run docker network ls. You should see your <network> there. Then get the containers still attached to that network with (replacing your network name at the end of the command):

docker network inspect \
--format '{{range $cid,$v := .Containers}}{{printf "%s: %s\n" $cid $v.Name}}{{end}}' \
"<network>"

For the various returned container id's, you can check why they haven't stopped (inspecting the logs, making sure they are part of the compose project, etc), or manually stop them if they aren't needed anymore with (replacing the <cid> with your container id):

docker container stop "<cid>"

Then you should be able to stop the compose project.

docker-compose down default_network error

I'm guessing you edited the docker-compose file while you were currently running...?

Sometimes if you edit the docker-compose file before doing a docker-compose down it will then have a mismatch in what docker-compose will attempt to stop. First run docker rm 8598560 to stop the currently running container. From there, make sure you do a docker-compose down before editing the file. Once you stop the container, docker-compose up should work.

Docker cannot remove network that already exists

Deleting "network not found" in docker

  1. Inspect the network which we are unable to delete

    docker network inspect [<id> or <name>]
  2. Disconnect the network

    docker network disconnect -f [<networkID> or <networkName>] [<endpointName> or <endpointId>]
  3. Delete unused networks

    docker network prune

failed to start daemon: Error initializing network controller: Error creating default bridge network

Found out that

$ firewall-cmd --get-active-zones
FedoraWorkstation
interfaces: ens4u1u2 wlp59s0
docker
interfaces: br-48d7d996793a
libvirt
interfaces: virbr0
trusted
interfaces: docker0

the interface docker0 seems to be in the trusted zone.
But there's another zone called docker.

So I decided to give it a shot and add it to the docker zone instead.

$ sudo firewall-cmd --permanent --zone=docker --change-interface=docker0
$ sudo firewall-cmd --reload

Looks like this afterwards:

$ firewall-cmd --get-active-zones
FedoraWorkstation
interfaces: ens4u1u2 wlp59s0
docker
interfaces: br-48d7d996793a docker0
libvirt
interfaces: virbr0

Seems to work.

Maybe someone can shed more light on this.

Edit: added firewall-cmd --reload as pointed out in the comments

Error response from daemon: service endpoint with name

TLDR: restart your docker daemon or restart your docker-machine (if you're using that e.g. on a mac).

Edit: As there are more recent posts below, they answer the question better then mine. The Network adapter is stuck on the daemon. I'm updating mine as its possibly 'on top' of the list and people might not scroll down.

  1. Restarting your docker daemon / docker service / docker-machine is the easiest answer.

  2. the better answer (via Shalabh Negi):

docker network inspect <network name>
docker network disconnect <network name> <container id/ container name>

This is also faster in real time if you can find the network as restarting the docker machine/demon/service in my experience is a slow thing. If you use that, please scroll down and click +1 on their answer.


So the problem is probably your network adapter (virtual, docker thing, not real): have a quick peek at this: https://github.com/moby/moby/issues/23302.

To prevent it happening again is a bit tricky. It seems there may be an issue with docker where a container exits with a bad status code (e.g. non-zero) that holds the network open. You can't then start a new container with that endpoint.

docker-compose unlink network from child containers when stopping parent containers?

A quick experiment with an external network:

dc1/dc1.yml

version: "3.0"

services:
nginx:
image: nginx
ports:
- "8080:80"
networks:
- an0

networks:
an0:
external: true

dc2/dc2.yml

version: "3.0"

services:
redis:
image: redis
ports:
- "6379:6379"
networks:
- an0

networks:
an0:
external: true

Starting and stopping:

$ docker network create -d bridge an0
1e07251e32b0d3248b6e70aa70a0e0d0a94e457741ef553ca5f100f5cec4dea3

$ docker-compose -f dc1/dc1.yml up -d
Creating dc1_nginx_1 ... done

$ docker-compose -f dc2/dc2.yml up -d
Creating dc2_redis_1 ... done

$ docker-compose -f dc1/dc1.yml down
Stopping dc1_nginx_1 ... done
Removing dc1_nginx_1 ... done
Network an0 is external, skipping

$ docker-compose -f dc2/dc2.yml down
Stopping dc2_redis_1 ... done
Removing dc2_redis_1 ... done
Network an0 is external, skipping

PHP CLI - ERROR: could not find an available, non-overlapping IPv4 address pool among the defaults to assign to the network

The same issue was gone after renaming the network interface from ens33 to eth0.
One guide used was https://www.itzgeek.com/how-tos/mini-howtos/change-default-network-name-ens33-to-old-eth0-on-ubuntu-16-04.html

Docker daemon fails to restart gracefully

Seems like the issue was solved in 1.9.1-rc1 of docker but is back 1.10 versions.
You can track the issue at https://github.com/docker/docker/issues/17083



Related Topics



Leave a reply



Submit