fix: disable restore backup when service is not running#4478
Open
slig wants to merge 1 commit into
Open
Conversation
Running a restore requires a live database container; doing it against a stopped service failed with a cryptic console error. Gate the Restore button (disabled + in-modal alert) unless the service status is "done" (applicationStatus for databases, composeStatus for compose). The web-server backup target is never gated.
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.
What is this PR about?
The Restore Backup action on database services requires a live database container. When the service is stopped / not running, clicking Restore failed with a cryptic console error instead of any useful feedback.
This PR gates the Restore Backup UI so it only acts when the service is actually running:
applicationStatus === "done"for databases andcomposeStatus === "done"for compose. The web-server backup target (Dokploy itself) has no such status, so it is never gated.What could be improved (possible follow-up): the root cause could also be handled in the backend, by guarding the restore command (
docker exec -i $CONTAINER_ID …) when no running container is found — that would also cover direct API calls and every database type in one place. I went with the UI gate here because I thought it was clearer and more self-contained, and it directly addresses the user-facing behaviour. The backend guard could be added as a separate change.Checklist
canarybranch.Issues related (if applicable)
N/A
Screenshots (if applicable)
Tested locally: with the service stopped, the Restore button is disabled and the modal shows a warning ("The database must be running to restore a backup. Start it first."); once the service is running, the button is enabled and the warning is gone. Verified the same gating for a Compose service, and that the Settings → Server (web-server) backups stay enabled.