Skip to content

Volume backup: container should restart immediately after tar creation, not after S3 upload completes #4000

Description

@WalidDevIO

To Reproduce

  1. Configure a volume backup with "Turn Off Container During Backup" enabled
  2. Use a large volume (1GB+) with an S3 destination
  3. Trigger the backup manually
  4. Observe that the container remains stopped during the entire S3 upload, not just during tar creation

Current vs. Expected behavior

Current behavior

stop container → tar → rclone upload → rm → restart container

Expected behavior

stop container → tar → restart container → rclone upload → rm

Why it matters

The risk of data corruption exists only during the tar creation phase, when the container is actively writing to the volume. Once the tar is created, the container can safely restart — the rclone upload reads only from the local tar file and has no dependency on the running container. Correct this "bug" will reduce container downtime on big volume backups.

Code reference

The issue is in backupVolume()startCommand is called after baseCommand which includes both the tar creation and the rclone upload. The fix is to move startCommand between the tar creation and the rclone call.

Provide environment information

OS: Debian 13
Dokploy v0.28.6

Which area(s) are affected? (Select all that apply)

Docker Compose

Are you deploying the applications where Dokploy is installed or on a remote server?

Same server where Dokploy is installed

Additional context

No response

Will you send a PR to fix it?

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions