fix(doctor): backup check warns about services declared persistence.mode: ephemeral
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 78/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ệ
- go
- Lĩnh vực
- cli, devops, infrastructure
Hướng nghiên cứu
Bắt đầu từ vòng lặp dịch vụ trong cmd/ob/doctor.go:530 và đọc serviceIsEphemeral trong internal/app/services.go, bao gồm cả cách nó được sử dụng trong renderer và loader. Tái hiện đầu ra của ob doctor với một dịch vụ sử dụng persistence.mode: ephemeral, sau đó thêm coverage cho phần kiểm tra dịch vụ. Hoàn tất khi các dịch vụ ephemeral báo pass mà không có cảnh báo backup, còn các dịch vụ không có persistence mode hoặc backup vẫn giữ cảnh báo hiện có.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
ob doctor's service backup check keys only off service.Backup == nil, ignoring persistence.mode: ephemeral. A service the author has explicitly declared disposable is reported as unprotected durable data on every run, and the remedy it offers cannot be followed.
Observed
A project declaring:
redis:
driver: redis
version: "8.8"
# Rate-limit counters and nothing else. Losing them costs a window of
# limiter state, which rebuilds on its own.
persistence:
mode: ephemeral
gets, on every ob doctor:
[WARN] backups: durable data is present and Onebox does not back it up
[WARN] redis/backup: managed service data lives only on this host; declare
services.redis.backup to copy it off, or accept that one disk is all there is
That single warning also drags the overall report to Onebox doctor: WARNING.
Why it is wrong
The declaration has already answered the question the check is asking, and Onebox acts on it everywhere else:
internal/app/services.go:122—serviceIsEphemeralexists.internal/app/services.go:531-539— the renderer consults it and turns persistence off (appendonly: no,save: ""for the redis driver). The comment there is explicit: "The mode owns this decision and a driver setting cannot override it."internal/app/load.go:582— the loader refuses a service that declares volumes together withmode: ephemeral, because "an ephemeral service owns no durable volume".
So by the time doctor runs, the project has stated the data is disposable, the renderer has removed persistence, and the loader has guaranteed there is no durable volume. Doctor then warns that durable data is unprotected.
The offered remedy is worse than the warning. "Declare services.redis.backup" asks the operator to configure a backup for a service Onebox has already established owns nothing durable to back up. The advice cannot be acted on, so the only way to clear the warning is to stop meaning what the declaration says.
The standard is already stated in this file
cmd/ob/doctor.go:520-524, in the comment immediately above the loop:
// A service that declares backup is not the same as one that does not,
// and this said otherwise for both — it warned that "Onebox takes no
// backups yet" over a database archiving to an off-host repository. A
// doctor that reports a healthy thing as broken is a doctor people stop
// reading.
That is this defect, one case over. The earlier fix taught the check to distinguish "declares backup" from "does not"; it did not teach it to distinguish "has durable data" from "declared it has none."
The workload branch directly above, at doctor.go:505, already reasons about exactly this field — it tells the operator to "declare persistence: {mode: durable} to state this, or mode: ephemeral if the volume is not state." So doctor understands the concept, applies it to workloads, and skips it for services.
Cost
A warning an operator must dismiss on every run is not free. It trains people to skim past a report whose entire value is that its warnings mean something, and it is the same erosion product.md guards against from the other direction — there, silence reading as approval; here, noise reading as nothing.
Proposal
In the service loop at cmd/ob/doctor.go:530, consult the ephemeral declaration before warning. Something like:
serviceIsEphemeral(service)→doctorPass, message along the lines of "declared ephemeral; Onebox renders no durable volume and takes no backup, which is what the declaration asks for."service.Backup == niland not ephemeral → the existing warning, unchanged.service.Backup != nil→ the existing pass, unchanged.
Reporting it as a pass rather than omitting it keeps the inventory complete, which seems closer to the project's habit of naming what it does not own rather than staying quiet about it.
serviceIsEphemeral is currently unexported in internal/app; whether doctor consults an exported helper or the field directly is a taste call I have no basis for.
Notes
- Reproduced against runner
v2026.8.21(aafb110), against8500ab7of this repository. - Same run reports
[WARN] qdrant/backup— that one appears correct: qdrant declares no backup and no persistence mode, so nothing has claimed the data is disposable.
- Ngôn ngữ chính
- Go
- Star
- 3
- Fork
- 0
- Merge trung bình
- 2 giờ 46 phút
- Pull request đã merge (30 ngày)
- 38
Chuẩn bị môi trường
- Không có Dockerfile hay 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 labstack/onebox
-
bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 80/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của labstack/onebox
Issue tương tự
-
automation models
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug llm-stack needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
P3 Type: Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
grpc/grpc-go#9483 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
needs-area needs-kind needs-priority needs-status needs-triage
Độ khó 2/5 Dưới một giờ Mức phù hợp với người mới 85/100
cncf/automation#736 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Signing PIN can't be collected in-TUI: gpg helper never opts into credential handling, and the PIN pattern misses ssh-keygen's wordingCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
jesseduffield/lazygit#6094 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày