You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When defining two networks one of which is an overlay network (the host is initialized as swarm manager) and assigning it to a service in the docker compose file, the start is sporadically aborted with the following error message: Error response from daemon: failed to set up container networking: could not find a network matching network mode <overlay-network-name>: network <overlay-network-name> not found
Expected behaviour should be that the service and networking definition is created everytime without error.
Steps To Reproduce
Using the following minimal working example the error message can be reproduced every once in a while (Note I don't know if the driver_opts is necessary, but it is what we used in our production environment where we noticed the error):
Executing docker compose up will result in the following error once in a while:
[+] Running 2/3
✔ Network net Created 0.0s
✔ Network second-net Created 0.1s
⠸ Container debug-nginx-1 Starting 0.3s
Error response from daemon: failed to set up container networking: could not find a network matching network mode net: network net not found
Because the error seems to appear only sporadically I wrote a simple script to perform the same actions everytime:
# Enter your advertise-addr here
ADVERTISE_ADDR="x.x.x.x"
docker swarm leave --force >/dev/null 2>&1
docker swarm init --advertise-addr "$ADVERTISE_ADDR" >/dev/null 2>&1
while true; do
docker compose down -v >/dev/null 2>&1 && docker compose down -v >/dev/null 2>&1
output=$(docker compose up -d --force-recreate 2>&1)
if error_output=$(echo "$output" | grep "Error"); then
echo
echo $error_output
echo
else
echo
echo "Everything OK"
echo
fi
done
This will result in an output which looks like this:
Everything OK
Error response from daemon: failed to set up container networking: could not find a network matching network mode net: network net not found
Everything OK
Everything OK
Everything OK
Error response from daemon: failed to set up container networking: could not find a network matching network mode net: network net not found
Everything OK
Error response from daemon: failed to set up container networking: could not find a network matching network mode net: network net not found
Everything OK
Description
When defining two networks one of which is an overlay network (the host is initialized as swarm manager) and assigning it to a service in the docker compose file, the start is sporadically aborted with the following error message:
Error response from daemon: failed to set up container networking: could not find a network matching network mode <overlay-network-name>: network <overlay-network-name> not found
Expected behaviour should be that the service and networking definition is created everytime without error.
Steps To Reproduce
Using the following minimal working example the error message can be reproduced every once in a while (Note I don't know if the driver_opts is necessary, but it is what we used in our production environment where we noticed the error):
Executing docker compose up will result in the following error once in a while:
Because the error seems to appear only sporadically I wrote a simple script to perform the same actions everytime:
This will result in an output which looks like this:
Compose Version
Docker Environment
Anything else?
The issue also occures with docker compose version 2.35.1
The text was updated successfully, but these errors were encountered: