Dokploy/dokploy

Database backup fail when database is in worker node

Offen

#3.516 geöffnet am 25.01.2026

 (4 Kommentare) (5 Reaktionen) (0 zugewiesene Personen)TypeScript (2.522 Forks)user submission
bughelp wanted

Repository-Metriken

Stars
 (34.231 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 3T 12h) (28 gemergte PRs in 30 T)

Beschreibung

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

Contributor Guide