Volume backup silently uploads an empty tar when the volume does not exist on the host (stack prefix missing / service on swarm worker)
Maintainer thường phản hồi trong vòng 1 ngày
@imrja8 đang làm issue này rồi.
Từ ngày 1/12/2026.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 74/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- docker, typescript
Hướng nghiên cứu
Bắt đầu trong packages/server/src/utils/volume-backups/backup.ts, nơi lệnh docker run --rm -v ${volumeName}:/volume_data ... được lắp ráp và đầu ra của nó được truyền vào log backup. Thêm một bước kiểm tra docker volume inspect "$VOLUME" (hoặc --mount type=volume,src=...,volume-nocopy) trước khi chạy và đưa lỗi vào cùng đường dẫn lỗi mà các nhánh lỗi hiện có dùng, để lần chạy được đánh dấu là thất bại thay vì ghi log Volume backup done ✅. Hoàn thành nghĩa là một tên volume không tồn tại tạo ra lỗi rõ ràng và không có tar nào được tải lên, trong khi một volume hợp lệ vẫn được backup; mã backup cơ sở dữ liệu bên cạnh là một tham chiếu hữu ích cho cách lỗi được hiển thị.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
To Reproduce
- Create a Docker Compose service of type Stack (swarm) with a named volume, e.g.
pgdata. Docker creates it as<appName>_pgdata. - Add a volume backup with volume name
pgdata, i.e. without the stack prefix. The UI accepts any string. - Alternative way to trigger it: use the correct full name, but pin the service to a worker node. The backup command always runs on the Dokploy/manager server, so the volume does not exist there.
- Run the volume backup, manually or on its schedule.
Current vs. Expected behavior
Current: The backup runs docker run --rm -v ${volumeName}:/volume_data ... ubuntu tar cvf ... (packages/server/src/utils/volume-backups/backup.ts). If no volume with that name exists on the host, docker run silently creates a new empty volume, and an empty tar of 10240 bytes is uploaded. The log ends with Volume backup done ✅ / Upload to S3 done ✅, so nothing tells you the backup is useless.
We only found out when we needed a restore. A Postgres volume had been "backed up" every night for two months, and all 60 retained files were empty tars. Seven of our 17 volume backups were affected:
- some because the stack prefix was missing from the configured name,
- some because the service runs on a swarm worker.
Each run also leaves an empty stray volume with the configured name on the manager.
Expected:
- The backup fails with a clear error if the volume does not exist on the host where the command runs. For example, check
docker volume inspect "$VOLUME"before thedocker run, or use--mount type=volume,src=...,volume-nocopy. Plain-vauto-creates the volume, so it does not help here. - Optionally, the UI validates or suggests the real volume name (including the
<appName>_prefix for stacks). - Optionally, a warning when the backed-up volume is empty.
The swarm worker case is the broader limitation tracked in #2692, and #3516 covers it for database backups. Database backups at least fail with Container not found there. Volume backups report success instead, which is the dangerous part.
Provide environment information
Dokploy version: v0.31.1 (code checked against v0.31.2, same behavior)
OS: Debian 13
Setup: 2-node Docker Swarm (Dokploy on the manager, services on manager and worker), Compose type "Stack"
Destination: S3-compatible
Which area(s) are affected? (Select all that apply)
Docker Compose, Docker
Are you deploying the applications where Dokploy is installed or on a remote server?
Both
Additional context
Minimal demonstration of the root cause:
docker volume ls -q | grep -x does-not-exist # nothing
docker run --rm -v does-not-exist:/volume_data ubuntu bash -c 'cd /volume_data && tar cf - . | wc -c'
# 10240 -> empty tar, exit code 0
docker volume ls -q | grep -x does-not-exist # now exists (created by the run)
Will you send a PR to fix it?
No
- Ngôn ngữ chính
- TypeScript
- Star
- 38.8k
- Fork
- 3.2k
- Merge trung bình
- 1 ngày 8 giờ
- Pull request đã merge (30 ngày)
- 117
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Dokploy/dokploy
-
Docker > Volumes: sorting by Size does nothing, and text columns sort inconsistentlyCó thể đã có người làm @BitPluto đã nhận hôm nay. Đang mởneeds-triage🔍
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
Dokploy/dokploy#6203 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
needs-triage🔍
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Dokploy/dokploy#6197 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Healthy Swarm task shows an empty `(Error:)` suffix on the last row of the Containers tabCó thể đã có người làm @AyhamJo7 đã nhận 7 ngày trước. Đang mởneeds-triage🔍
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Dokploy/dokploy#6115 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
MongoDB with Replica Sets enabled: container exits with code 0 and restarts in a loop (generated startup script never waits on mongod)Có thể đã có người làm @ghazy2001 đã nhận 13 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Dokploy/dokploy#6051 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Dokploy monitoring API returns partial container metrics with HTTP 200 when a row read failsCó thể đã có người làm @PAtreju đã nhận 15 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Dokploy/dokploy#6029 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của Dokploy/dokploy
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
ardia-browser/ardia#6391 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Feature:Actions/ConnectorTypes Team:ResponseOps
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
elastic/kibana#309028 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
🔨 tool 🧰 library
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Orange-OpenSource/Orange-Boosted-Bootstrap#4035 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Ajouter la page Plan du siteĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
DISIC/teleservice-conformite#230 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
rothgar/rabble.radio#410 ·
Maintainer thường phản hồi trong vòng 1 ngày