me-box-archive / databox-netdev

Old Dev version Databox OS container manager and dashboard server (do not use)
MIT License
3 stars 6 forks source link

ERROR :service endpoint with name databox-arbiter already exists #60

Open Toshbrown opened 7 years ago

Toshbrown commented 7 years ago

When reinstalling an app/driver, or restarting with saved containers, after merging #50 and #54 we get the following error.

Error: (HTTP code 500) server error - service endpoint with name databox-arbiter already exists

yousefamar commented 7 years ago

A bit of digging yields this: https://github.com/docker/docker/issues/20398. It seems that this happens either when trying to connect arbiter to a network it is already connected to, or if it's removed before restart, then some sort of bug where it needs to be explicitly disconnected first.

A workaround may be to try and disconnect a container before reconnecting it, or inspecting and seeing if it's connected, but maybe it's an issue where we try to connect it twice so perhaps network inspect and arbiter container inspect networks might unearth what's going wrong?

yousefamar commented 7 years ago

It may have been the first case after all, due to a bug in dockerode that @sevenEng hunted down! https://github.com/apocas/dockerode/pull/349

yousefamar commented 7 years ago

I think this bug is actually secretly two bugs in one. The first caused by above, the second due to network naming. I have a strong hunch that for some reason you can't have a network be named the same as a container. The places where it fails for me coincide with store names, i.e. databox-driver-databox-store as that driver's store's name, collides with the network between that driver and store.

I think I'm very close to cracking #56, but this is holding me back. Will investigate and report back.

yousefamar commented 7 years ago

Never mind that; I found out what the problem is. Exactly what I said in my first post:

https://github.com/me-box/databox/blob/master/src/container-manager.js#L323

PR incoming.