Database backup on remote server fails when backup name/prefix contains certain characters (works on panel server with same config)
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 37.4k
- Forks
- 3k
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 73
Description
To Reproduce
- Set up Dokploy panel server with an S3 Destination (Tencent COS in my case). Test Connection: success.
- Add a remote server via Remote Servers → run Setup Server → all items in Validate tab are green (rclone, Docker, etc. all installed).
- Deploy a PostgreSQL database on the remote server.
- Create a backup with a name/prefix containing a hyphen
-(in my case: prefix/English-Program, backup nameEnglish-Program). - Trigger a manual backup → UI shows
Error creating the manual backupwith no further detail. - Edit the backup, remove the
-character (prefix →/englishprogram, backup name →englishprogram) → manual backup succeeds immediately.
Current vs. Expected behavior
Current: Backups for databases deployed on remote servers fail when the backup name or storage prefix contains a hyphen (-). The toast error is just Error creating the manual backup, with no detail in the UI about what actually broke.
Expected: Either
- the backup should work regardless of
-(matching the behavior for databases on the panel server), or - the UI should validate the input and surface a clear error indicating which characters are disallowed.
Important — this is the part that points to a real bug, not user error: The exact same backup configuration (same destination, same prefix containing -, same database name) works correctly when the database is deployed on the panel server. The failure only happens when the database is on a remote server.
Suspected root cause
Looking at packages/server/src/utils/backups/postgres.ts, the code branches on postgres.serverId:
- Local DB →
execAsync(runs inside the Dokploy container) - Remote DB →
execAsyncRemote(runs on the remote host via SSH)
The two paths very likely differ in how they escape the rclone command string before execution. When the prefix/name containing - is interpolated into the rclone command and then sent over SSH, the - may be getting parsed as a CLI flag prefix by the receiving shell or by rclone itself, breaking the command. That would explain why the local path (single shell layer, cleaner escaping) works while the remote path (extra SSH shell layer) fails on the same input.
Provide environment information
- OS (panel server): Ubuntu Server 24.04 LTS 64-bit
- OS (remote server): Ubuntu Server 24.04 LTS 64-bit
- Dokploy version: v0.29.0
- Database: PostgreSQL
- S3 Provider: Tencent Cloud Object Storage (COS)
- VPS Provider: Tencent Cloud (腾讯云) — both panel and remote
- Deployment: Self-hosted
Which area(s) are affected? (Select all that apply)
Remote server
Are you deploying the applications where Dokploy is installed or on a remote server?
Same server where Dokploy is installed
Additional context
No logs surfaced in the UI beyond the generic toast. Happy to provide deeper logs if there is a way to enable verbose backup logging on the remote-server execution path.
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 and compare the execAsync local path with execAsyncRemote for PostgreSQL backups. Reproduce the remote-server case using a backup name or prefix containing a hyphen, then verify that the backup succeeds or that the UI reports a clear validation error instead of the generic failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgresql, typescript
- Domain
- backend, databases, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100