Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

admin metrics fails against RustFS 1.0.1 stable with 501 NotImplemented — wrong admin route (/metrics instead of /realtime)

Đang mở Phù hợp với người mới
#388 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

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
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ệ
rust
Lĩnh vực
cli

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

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của rustfs/cli

Tất cả issue của rustfs/cli

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.