Skip to content

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

Closed

Description

@bartfaizoli76

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.

Activity

  1. overtrue commented on Nov 2, 2026

    @overtrue
    Contributor

    The route fix is in #398, with regression checks for both the default command and the disk/host-filtered request. Formatting, Clippy, and all 1,953 workspace tests pass locally. Leaving this open until the PR is merged. The separate capability-discovery mismatch is being tracked in #384.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions