Dokploy/dokploy

Database backup fail when database is in worker node

开放

#3,516 创建于 2026年1月25日

 (4 条评论) (5 个反应) (0 位负责人)TypeScript (2,522 个派生)user submission
bughelp wanted

仓库指标

星标
 (34,231 个星标)
PR 合并指标
 (平均合并 3天 12小时) (30 天内合并 28 个 PR)

描述

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

贡献者指南