coolify icon indicating copy to clipboard operation
coolify copied to clipboard

[Bug]: `Danger Zone` does not delete all data related to the `Resource`

Open nicanordlc opened this issue 11 months ago • 1 comments

Description

When you create a resource in an environment and delete it before it is deployed (just create and delete right away) it leaves a docker network or a volume data around in the system that did not get deleted.

Minimal Reproduction (if possible, example repository)

I found two cases where some data is left on the host machine when you click the Delete button in the Danger Zone section.

  1. As soon as you create a new Resource on a environment it creates the docker network for that resource (deployment has not yet happen) and in that network is the coolify-proxy added by default.

It may be fixed on delete handler:

  • disconnect coolify-proxy from the network on this resource.
  • then delete the network. ( docker network prune would work as well but since is just one network at the moment of deletion target it directly would be more direct )
  1. As soon as you create a new Resource on a environment with the option Based on a Docker Compose it will create a directory here /data/coolify/services/<app-id>/, there will be the docker-compose.yml and any volume if specified there. This time there's no network created before the deployment is done.

Issue here is that if you delete the resource the directory will stay there /data/coolify/services/<app-id>/ (with any volume data previously there ?)

Maybe fixed by rm -rf /data/coolify/services/<app-id>/ ? (or is it too extreme/danger 😅, like the button says)

Exception or Error

No response

Version

v4.0.0-beta.239

nicanordlc avatar Mar 21 '24 04:03 nicanordlc

Not related to the issue but I think this network that gets created on resource initialization, is the one for connecting to the preferred network (the one with the proxy) ?

nicanordlc avatar Mar 21 '24 05:03 nicanordlc

This has been already solved. Now it deletes everything when you delete a resource and network.

andrasbacsai avatar Apr 30 '24 12:04 andrasbacsai