coollabsio / coolify

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

[Bug]: Quickly opening and merging a PR crashes deploys and leaves ghosts #2610

Open ity-alex opened 4 months ago

ity-alex commented 4 months ago

Description

When connecting a resource via Github App and opening a PR, a preview deployment gets queued. If the PR is merged right after it is created (few seconds) the deployment stalls (I assume because there is nothing to pull from?), blocks the queue and the new docker container will not get cleaned up.

We are using the hosted interface at app.coolify.com, love this project so far! This is only a minor issue, not urgent for us at all!

All the best!

Minimal Reproduction (if possible, example repository)

Connect source as Github App, open Pull Request, wait only 2-3 seconds, close/merge the PR.

Exception or Error

No response

Version

v4.0.0-beta.297

ity-alex commented 4 months ago

I found these two possibly relevant code sections:

Maybe the deletion by webhook only removes the final container, while the cancelling of the deploy removes the currently building container. Possible solution would be to check for currently active deploys in the webhook handler?

TorstenDittmann commented 2 weeks ago

Yeah, this is also very annoying for us and blocks the preview environments on a daily basis and someone has to manually clear the queue.

It also happens with queue builds. They silently fail without logs when the PR has been merged before it starts.