coollabsio / coolify

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

[Bug]: Delete server without validation #2750

Open pReya opened 2 months ago

pReya commented 2 months ago

Description

I can't delete a server, which i accidentally added, because it seems that it needs to be validated before it can be deleted. I can't do either of those things, so the server is stuck in limbo :(

I think the delete option should be available, even when validation is still outstanding.

Minimal Reproduction (if possible, example repository)

Exception or Error

No response

Version

v4.0.0-beta.306

CodeGeek04 commented 2 months ago

It does delete without validation, you just have to skip onboarding and you can find all servers/delete them.

pReya commented 2 months ago

It does delete without validation, you just have to skip onboarding and you can find all servers/delete them.

How? The delete button does not appear on unvalidated server (see screenshots – one shows a validated server, one shows an unvalidated server)

Screenshot 2024-07-06 at 22 14 40 Screenshot 2024-07-06 at 22 14 18
Xiloe commented 2 months ago

Looking at your screenshot I can see that:

image

You might have some random ressource on that server somehow, try to check if you have one, if you do you need to stop & delete them, then you should be able to delete the server, you shouldn't need to delete the environments though

pReya commented 2 months ago

Looking at your screenshot I can see that: image

You might have some random ressource on that server somehow, try to check if you have one, if you do you need to stop & delete them, then you should be able to delete the server, you shouldn't need to delete the environments though

This is the screenshot of the validated server. The other screenshot shows the unvalidated server (you'll see there's no delete option).

Xiloe commented 2 months ago

Oh, my bad I though it was one screenshot, well then the issue is most likely due to this line : https://github.com/coollabsio/coolify/blob/e9158b7305bb9253fe75a0e76ef34af62f75199b/resources/views/livewire/server/delete.blade.php#L2

where for some reasons your server id would === 0, that's the only way the Danger zone part could disappear. I'm also surprised you were able to use host.docker.internal as the address, as it's already used by localhost, and you can't use it more than once, it will even tell you.

any way you could reproduce this on a fresh coolify instance ? I couldn't

edit: $server->id === 0 is the first server in the list, so localhost, and in fact, if you go on your default localhost server, you can't delete it, so for some reasons you somehow got the id of 0 on this server meaning it's treated as default localhost meaning you can't delete it. I wonder how that would even happen? that would help if you could reproduce it..

pReya commented 1 month ago

Sorry for the late response. I'm not entirely sure how I got to this state. I set up Coolify and then somehow did not finish the initial setup. When I came back to it, a couple of weeks later, I guess I manually added a new server, without the "Server 0" working properly, because I was under the assumption I can just delete it later.

Can I manually delete the server from the Postgres DB to fix this?