Dokploy/dokploy

Database backup fail when database is in worker node

Aperta

#3516 aperta il 25 gen 2026

 (4 commenti) (5 reazioni) (0 assegnatari)TypeScript (2522 fork)user submission
bughelp wanted

Metriche repository

Star
 (34.231 stelle)
Metriche merge PR
 (Merge medio 3g 12h) (28 PR mergiate in 30 g)

Descrizione

To Reproduce

  1. Setup a worker in your swarm
  2. Add a label to the worker (eg. docker node update --label-add type=database <node-name>)
  3. Setup a postgres database application to the worker (don't deploy yet)
  4. Add a constraint to the postgres database application
{
  "Constraints": [
    "node.labels.type == database", // or whatever you label the worker
    "node.role == worker"
  ]
}
  1. Deploy the database application
  2. Setup database backup
  3. Manually trigger the backup

Current vs. Expected behavior

Currently It throws an error

Initializing backup
[Sat Jan 24 04:02:23 UTC 2026] Starting backup process...
[Sat Jan 24 04:02:23 UTC 2026] Executing backup command...
[Sat Jan 24 04:02:23 UTC 2026] ❌ Error: Container not found

Expected Database backup created successfully.

Provide environment information

Operating System: Ubuntu 24.04.3 LTS (manager and worker vps)
Dokploy Version: v0.26.5
VPS Provider: Hetzner
What applications/services are you trying to deploy: Database

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

Databases

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

Remote server

Additional context

I have done some digging and the reason this happened is because the backup command code on packages/server/src/utils/backups/postgres.ts

await execAsync(backupCommand, {
	shell: "/bin/bash",
});

is ran on the manager vps. But since the database is in a worker (different vps), it couldn't find the container, hence the error.

Will you send a PR to fix it?

Yes

Guida contributor