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

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

Open
avioli opened this issue Feb 27, 2024 · 4 comments
Open

Comments

@avioli
Copy link

avioli commented Feb 27, 2024

docker/cmd/docker.sh

Lines 4 to 6 in dd8a298

function net_init(){
docker network create ${COMPOSE_PROJECT_NAME}_default &>/dev/null || true
}

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
Copy link

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
Copy link
Author

avioli commented Feb 29, 2024

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

@orangejulius
Copy link
Member

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
Copy link
Author

avioli commented Mar 3, 2024

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.

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

3 participants