Skip to content

fix: disable restore backup when service is not running#4478

Open
slig wants to merge 1 commit into
Dokploy:canaryfrom
slig:fix/disable-restore-backup-when-not-running
Open

fix: disable restore backup when service is not running#4478
slig wants to merge 1 commit into
Dokploy:canaryfrom
slig:fix/disable-restore-backup-when-not-running

Conversation

@slig
Copy link
Copy Markdown

@slig slig commented May 23, 2026

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:

  • The Restore button is disabled and a warning is shown inside the Restore Backup modal when the service isn't running.
  • "Running" is derived from the service status: applicationStatus === "done" for databases and composeStatus === "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

  • You created a dedicated branch based on the canary branch.
  • You have read the suggestions in the CONTRIBUTING.md file.
  • You have tested this PR in your local instance.

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.

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.
@slig slig requested a review from Siumauricio as a code owner May 23, 2026 18:15
@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label May 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant