admin metrics fails against RustFS 1.0.1 stable with 501 NotImplemented — wrong admin route (/metrics instead of /realtime)
还没有人认领这个 Issue。
评估
调研方向
从 crates/s3/src/admin.rs 中的 realtime_metrics() 开始,这里 URL 是用 self.admin_url("/metrics") 构建的;将其改为 /realtime,以匹配 rustfs/src/admin/handlers/system.rs 中注册的路由。针对一台 RustFS 1.0.1 服务器,使用 rc admin metrics <alias> --json 重新构建并验证(当返回包含 samples 的 status: success 时即完成)。可选地,在同一文件中跟进版本门控辅助函数 add_known_server_capabilities / is_rustfs_beta_10,使稳定的 1.0.x 字符串被视为已知且具备能力。
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- Rust
- 星标
- 159
- 派生
- 23
- 平均合并
- 3 天 14 小时
- 30 天内合并 PR
- 3
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
rustfs/cli 的其他 Issue
-
Cannot install and update with brew可能已有人在做 @overtrue 于 6 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 62/100
-
难度 1/5 1-3 小时 新手友好度 82/100
-
难度 3/5 1-2 天 新手友好度 68/100
-
难度 3/5 1-2 天 新手友好度 55/100
-
难度 3/5 1-2 天 新手友好度 78/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
bytecodealliance/rustix#1703 ·
维护者通常 3 天内回复
-
bug discussion
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
farion1231/cc-switch#8298 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
ajeetdsouza/zoxide#1323 ·
维护者通常 1 天内回复