admin metrics fails against RustFS 1.0.1 stable with 501 NotImplemented — wrong admin route (/metrics instead of /realtime)
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ó
- 1/5
- Thời gian dự kiến
- Dưới một giờ
- Mức phù hợp với người mới
- 90/100
Hướng nghiên cứu
Bắt đầu tại realtime_metrics() trong crates/s3/src/admin.rs, nơi URL được dựng bằng self.admin_url("/metrics"); đổi thành /realtime để khớp với route đã đăng ký trong rustfs/src/admin/handlers/system.rs. Xây dựng lại và xác minh bằng rc admin metrics <alias> --json đối với máy chủ RustFS 1.0.1 (xong khi nó trả về status: success kèm samples). Tùy chọn, theo dõi các helper kiểm soát phiên bản add_known_server_capabilities / is_rustfs_beta_10 trong cùng file để các chuỗi ổn định 1.0.x được tính là đã biết và tương thích.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
rc admin metrics fails against a RustFS 1.0.1 (stable) server with:
{
"status": "error",
"error": {
"type": "unsupported_feature",
"message": "Failed to query realtime metrics: Unsupported feature: A header you provided implies functionality that is not implemented.",
"capability": "admin.metrics",
"suggestion": "Upgrade RustFS to beta.10 or later."
}
}
This happens even with no extra flags (rc admin metrics <alias> --json), not just --by-disk.
Root cause: crates/s3/src/admin.rs, realtime_metrics(), builds the request URL via:
let mut url = self.admin_url("/metrics");
which resolves to /rustfs/admin/v3/metrics. The server (rustfs/rustfs) registers this handler at a different path — see rustfs/src/admin/handlers/system.rs:
r.insert(
Method::GET,
format!("{}{}", ADMIN_PREFIX, "/v3/realtime").as_str(),
AdminOperation(&realtime::MetricsHandler {}),
)?;
i.e. /rustfs/admin/v3/realtime, not /v3/metrics. The mismatched path falls through to a generic NotImplemented response instead of a 404, which is what made this confusing to diagnose.
Fix: change the one line to:
let mut url = self.admin_url("/realtime");
Confirmed: after this one-line change and rebuilding, rc admin metrics works correctly against RustFS 1.0.1 (verified against a live server, status: success, samples returned, including --by-disk).
Side note (separate, lower-priority observation): the capability-discovery version gate in the same file (add_known_server_capabilities, is_rustfs_beta_10 / is_rustfs_rc_series) only recognizes beta.10-family and rc-prerelease version strings as "known capable" — a stable 1.0.1 version string doesn't match either pattern, so rc admin capabilities likely under-reports capabilities for any stable 1.0.x+ release. Didn't turn out to be the actual cause of the bug above, but probably worth a version-gate update too.
- Ngôn ngữ chính
- Rust
- Star
- 159
- Fork
- 23
- Merge trung bình
- 7 giờ 4 phút
- Pull request đã merge (30 ngày)
- 10
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Không 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 rustfs/cli
-
Cannot install and update with brewCó thể đã có người làm @overtrue đã nhận 2 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
rustfs/cli#387 · 2 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
rustfs/cli#389 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 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
-
`rc mirror` Upload PerformanceĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
[Feature]: [P3] engine-rs: the package source hash should ignore line endings and untracked filesĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
maniator/verticopolis#880 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Maintainer thường phản hồi trong vòng 3 ngày
-
defect
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 2 ngày