rustfs/rustfs · error · std::io::Error

NotImplemented

NotImplemented

Error message

The list_buckets API is not implemented in this build.

What it means

TransitionClient::list_buckets is an intentional stub in this build: it returns ErrorKind::Unsupported wrapping an embedded ErrorResponse whose code is "NotImplemented". The remote-tier client deliberately does not support bucket enumeration; the trait surface exists but the operation is unimplemented, so any code path that reaches it fails deterministically.

Source

Thrown at crates/ecstore/src/client/api_list.rs:41

    api_s3_datatypes::{
        ListBucketResult, ListBucketV2Result, ListMultipartUploadsResult, ListObjectPartsResult, ListVersionsResult, ObjectPart,
    },
    credentials,
    transition_api::{ReaderImpl, RequestMetadata, TransitionClient, collect_response_body},
};
use crate::storage_api_contracts::bucket::BucketInfo;
use http::{HeaderMap, StatusCode};
use http_body_util::BodyExt;
use hyper::body::Body;
use hyper::body::Bytes;
use rustfs_config::MAX_S3_CLIENT_RESPONSE_SIZE;
use rustfs_utils::hash::EMPTY_STRING_SHA256_HASH;
use std::collections::HashMap;
use std::io::ErrorKind;

impl TransitionClient {
    pub fn list_buckets(&self) -> Result<Vec<BucketInfo>, std::io::Error> {
        Err(std::io::Error::new(
            ErrorKind::Unsupported,
            credentials::ErrorResponse {
                sts_error: credentials::STSError {
                    r#type: "".to_string(),
                    code: "NotImplemented".to_string(),
                    message: "The list_buckets API is not implemented in this build.".to_string(),
                },
                request_id: "".to_string(),
            },
        ))
    }

    pub async fn list_objects_v2_query(
        &self,
        bucket_name: &str,
        object_prefix: &str,
        continuation_token: &str,
        fetch_owner: bool,

View on GitHub (pinned to 35af688cd9)

Solutions

  1. Do not use the transition client for bucket enumeration; enumerate buckets through the S3 API/admin layer of the target system instead
  2. Detect the stub by checking io ErrorKind::Unsupported plus embedded code "NotImplemented" and fall back to a capable client
Defensive patterns

Strategy: fallback

Type guard

fn is_not_implemented(err: &std::io::Error) -> bool {
    err.kind() == std::io::ErrorKind::Unsupported
        && err.get_ref().and_then(|e| e.downcast_ref::<credentials::ErrorResponse>()).is_some_and(|r| r.sts_error.code == "NotImplemented")
}

Try / catch

match client.list_buckets() {
    Err(err) if is_not_implemented(&err) => {
        // fall back to an S3/admin API that enumerates buckets on the target system
    }
    other => other?,
}

Prevention

When it happens

Trigger: Calling client.list_buckets() on a TransitionClient; generic tooling that enumerates buckets via a shared client trait dispatching to this implementation.

Common situations: Ported S3 tooling that assumes all clients implement ListBuckets; scripts trying to discover tier buckets through the transition client.

Related errors


AI-assisted analysis of rustfs/rustfs@35af688cd9 (2026-08-20). Data as JSON: /api/errors/d16eb3ac23708eb2. Report an issue: GitHub.