mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-12 18:15:58 +00:00
Fix deployment marked as failed when healthy container completes rolling update
Prevent deployment status from regressing to FAILED after it's marked as FINISHED by: 1. Calling completeDeployment() first in post_deployment() before any operations that could fail 2. Wrapping all post-deployment side effects in try-catch blocks 3. Adding FINISHED to terminal states that cannot be changed 4. Protecting ExecuteRemoteCommand from overwriting FINISHED status This fixes the issue where a deployment with a healthy container and successful rolling update was still marked as Failed in the UI. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
1 parent
d2a1b96598
commit
a2e5b2d67d
2 files changed
+38
-7
No files matched your search
@@ -140,9 +140,13 @@ trait ExecuteRemoteCommand
|
||||
// If we exhausted all retries and still failed
|
||||
if (! $commandExecuted && $lastError) {
|
||||
// Now we can set the status to FAILED since all retries have been exhausted
|
||||
// But only if the deployment hasn't already been marked as FINISHED
|
||||
if (isset($this->application_deployment_queue)) {
|
||||
$this->application_deployment_queue->status = ApplicationDeploymentStatus::FAILED->value;
|
||||
$this->application_deployment_queue->save();
|
||||
$this->application_deployment_queue->refresh();
|
||||
if ($this->application_deployment_queue->status !== ApplicationDeploymentStatus::FINISHED->value) {
|
||||
$this->application_deployment_queue->status = ApplicationDeploymentStatus::FAILED->value;
|
||||
$this->application_deployment_queue->save();
|
||||
}
|
||||
}
|
||||
throw $lastError;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user