coollabsio / coolify

An open-source & self-hostable Heroku / Netlify / Vercel alternative.
https://coolify.io
Apache License 2.0
26.5k stars 1.35k forks source link

[Bug]: Orphan error when recreate and opening publicly containers #2547

Open yohannlog opened 3 weeks ago

yohannlog commented 3 weeks ago

Description

When I delete and re-create a database (postgres for example) which can be accessible to public. An orphan error occurred when I want to click on the "Make it publicly available" again.

After some research, I see that all ports keep open and some containers are in "CREATED" state in docker container ls -a.

To remove this error, I have to close manually all ports (you can list wih lsof -i {port}) and kill all applications which use them (using kill cmd) and run --remove-orphan in the docker-compose of the proxy and remove database from coolify and "CREATED" state containers.

If you use docker-compose down --remove-orphan, generally it works but you have to re-create the proxy from the coolify ui.

Minimal Reproduction (if possible, example repository)

Exception or Error

Could not chdir to home directory /nonexistent: No such file or directory ussoco4-proxy Pulling ussoco4-proxy Pulled time="2024-06-14T12:39:52Z" level=warning msg="Found orphan containers ([coolify-proxy]) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up." Container ussoco4-proxy Creating Container ussoco4-proxy Created Container ussoco4-proxy Starting Error response from daemon: driver failed programming external connectivity on endpoint ussoco4-proxy (f6c202fb1df2a98e62c53b47a39979c7a18b9e2c947ec8064ff5f7bfa7dc0898): Bind for 0.0.0.0:5873 failed: port is already allocated

Version

v4.0.0-beta.297

yohannlog commented 3 weeks ago

Related to #2546