pelias / docker

Run the Pelias geocoder in docker containers, including example projects.
MIT License
314 stars 217 forks source link

A network with name pelias_default exists but was not created by compose #342

Open avioli opened 4 months ago

avioli commented 4 months ago

https://github.com/pelias/docker/blob/dd8a29815e70c261f36f7f407d5aae917de33263/cmd/docker.sh#L4-L6

Getting following output when running pelias download wof (after successful pelias compose pull)

WARN[0000] a network with name pelias_default exists but was not created by compose.
Set `external: true` to use an existing network 
network pelias_default was found but has incorrect label com.docker.compose.network set to ""

Had to remove the net_init call within compose_run to be able to get it going.

sombriks commented 4 months ago

i had similar issue in a few test installations, somehow delete the docker network by hand made everything work normally again.

docker network rm pelias_default

i am still unable to reproduce this error, i just figured out that manual network remove helps

avioli commented 4 months ago

Did that. Didn't help. net_init kept recreating it and then docker compose complained.

orangejulius commented 4 months ago

I think I ran into this myself as well. My working theory is that some sort of upgrade of Docker or some other system settings can cause this. Maybe the switch from a version of Docker without docker-compose built in to one with it built in?

My fix was also to remove the network but also do a bit more cleanup along the awy:

# stop all pelias containers
pelias compose stop

# delete all stopped containers, clean up images, remove unused networks, etc
docker system prune

# start back up, re-creating any networks or containers required
pelias compose up
avioli commented 4 months ago

I use OrbStack and not Docker Desktop, so unsure if that could be the reason.

@orangejulius Thanks for the suggestions, but I'm not going to run the prune command, since I've got other data that I don't want removed accidentally.

The solution that worked for me is to remove the net_init call/use. Everything worked as advertised even without that. The docker-compose (or docker compose) is meant to manage the network, and it does.

I'm unsure why net_init even exists, but my best guess is - to create a network that uses the COMPOSE_PROJECT_NAME env instead of whatever the default would be.