← Debugging Guides

阅读中文版本

MinIO — bucket does not exist on put operation

MinIO returns NoSuchBucket because the target bucket was not created before the put operation, or the bucket name is misspelled or in a different region.

beginnerdebuggingminiostorage

Symptoms

  • error: NoSuchBucket: The specified bucket does not exist
  • Put works for one bucket but not another
  • The bucket exists in the console but the SDK cannot find it

Possible causes

  • The bucket was never created or was deleted
  • The bucket name has a typo or wrong casing
  • The SDK endpoint points to a different MinIO instance than the console

Diagnosis steps

List buckets

mc ls myminio/

Interpretation

If the bucket is not listed, it does not exist on this instance.

Check the SDK endpoint

grep -n "endPoint|bucket" src/minio-client.ts

Interpretation

Confirm the endpoint and bucket name match the deployment.

Root cause

The bucket does not exist on the MinIO instance the client is connected to, so the put operation fails with NoSuchBucket.

Fix

Create the bucket with mc mb or client.makeBucket before putting objects, and verify the endpoint and bucket name are correct.

Verify the fix

Create the bucket and retry the put; confirm the object appears in the bucket listing.

Symptom walkthrough

MinIO returns NoSuchBucket because the target bucket was not created before the put operation, or the bucket name is misspelled or in a different region. The error appears in production but may not surface in local development because the conditions that trigger it depend on the deployment environment or runtime configuration. Understanding the full symptom set helps distinguish this issue from similar errors.

Diagnosis in practice

Follow the diagnosis steps in the frontmatter to isolate the cause. Each step includes a command and an interpretation of the output. The goal is to narrow down whether the issue is in the configuration, the runtime, or the application code. Reproduce the error in a minimal setup before applying a fix.

Root cause

The bucket does not exist on the MinIO instance the client is connected to, so the put operation fails with NoSuchBucket.

Fix

Create the bucket with mc mb or client.makeBucket before putting objects, and verify the endpoint and bucket name are correct. After applying the fix, monitor the system to confirm the error does not recur under load or in different environments.

Verification

Create the bucket and retry the put; confirm the object appears in the bucket listing. If the verification passes, the fix is confirmed; if not, re-examine the diagnosis steps for missed contributing factors.

Diagnostic commands

Run these commands to reproduce and diagnose the issue:

mc ls myminio/
grep -n "endPoint|bucket" src/minio-client.ts