Database backup fail when database is in worker node
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 37.4k
- Forks
- 3k
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 73
Description
To Reproduce
- Setup a worker in your swarm
- Add a label to the worker (eg.
docker node update --label-add type=database <node-name>) - Setup a postgres database application to the worker (don't deploy yet)
- Add a constraint to the postgres database application
{
"Constraints": [
"node.labels.type == database", // or whatever you label the worker
"node.role == worker"
]
}
- Deploy the database application
- Setup database backup
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in packages/server/src/utils/backups/postgres.ts, especially the execAsync call used during the backup process. Reproduce the failure with a PostgreSQL database constrained to a worker node, then trace how the backup command is executed. Done means a manually triggered backup creates the database backup successfully on the remote worker.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, postgresql, typescript
- Domain
- backend, databases, devops
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100