fix(volume-backups): restart services after backup failure - #5082
Open
bestmaa wants to merge 2 commits into
Open
fix(volume-backups): restart services after backup failure#5082bestmaa wants to merge 2 commits into
bestmaa wants to merge 2 commits into
Conversation
bestmaa
marked this pull request as ready for review
August 14, 2026 11:45
Comment on lines
+31
to
+35
| set -e | ||
| ${startCommand} | ||
| if [ "$DOKPLOY_VOLUME_BACKUP_STATUS" -ne 0 ]; then | ||
| exit "$DOKPLOY_VOLUME_BACKUP_STATUS" | ||
| fi |
Contributor
There was a problem hiding this comment.
When both the backup and subsequent restart fail, set -e exits during startCommand before the saved backup status is restored, so logs and failure notifications report the restart exit code instead of the original backup failure code.
Knowledge Base Used: Backups and Schedules
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When Turn Off Container During Backup is enabled, the generated volume-backup script stops the application or Compose service before creating the archive. Because the script runs with
set -e, a backup failure exits immediately and skips the restart command, leaving the service offline until someone restarts it manually.This is especially disruptive for transient failures such as an unavailable image registry or a failed
ubuntuimage pull.What changed
Impact
Services that are intentionally stopped for a consistent volume backup are brought back online even when archive creation fails. Successful backup and upload behavior remains unchanged.
Validation
pnpm --filter=dokploy exec vitest --config __test__/vitest.config.ts run __test__/backups— 23 tests passedpnpm --filter=@dokploy/server typecheckpnpm --filter=dokploy typecheckFixes #4263
Greptile Summary
This PR makes volume backups restart stopped services even when backup creation fails, while preserving the appropriate failure status.
Confidence Score: 5/5
The PR appears safe to merge.
The previously reported failure is fixed: a failed restart can no longer terminate the outer shell before the saved backup status is restored, and no blocking failure remains.
Reviews (2): Last reviewed commit: "fix(volume-backups): preserve backup fai..." | Re-trigger Greptile
Context used: