juicedata/juicefs · error

no bucket name provided in %s

Error message

no bucket name provided in %s

What it means

newMinio derives the bucket from the endpoint URL path; the endpoint must be of the form scheme://host/bucket. If uri.Path is shorter than 2 characters (i.e. no '/bucket' component), there is no bucket name and the constructor fails.

Source

Thrown at pkg/object/minio.go:105

	} else {
		cfg, err = config.LoadDefaultConfig(ctx, defaultChecksumOpts()...)
	}
	if err != nil {
		return nil, fmt.Errorf("failed to load config: %s", err)
	}
	client := s3.NewFromConfig(cfg, func(options *s3.Options) {
		options.Region = region
		options.BaseEndpoint = aws.String(uri.Scheme + "://" + uri.Host)
		options.EndpointOptions.DisableHTTPS = !ssl
		options.UsePathStyle = defaultPathStyle()
		options.HTTPClient = httpClient
		options.APIOptions = append(options.APIOptions, func(stack *smithymiddleware.Stack) error {
			return v4.SwapComputePayloadSHA256ForUnsignedPayloadMiddleware(stack)
		}, addS3UserAgent)
		options.RetryMaxAttempts = 1
	})
	if len(uri.Path) < 2 {
		return nil, fmt.Errorf("no bucket name provided in %s", endpoint)
	}
	bucket := uri.Path[1:]
	if strings.Contains(bucket, "/") && strings.HasPrefix(bucket, "minio/") {
		bucket = bucket[len("minio/"):]
	}
	bucket = strings.Split(bucket, "/")[0]
	return &minio{s3client{bucket: bucket, s3: client, region: region}}, nil
}

func init() {
	Register("minio", newMinio)
}

View on GitHub (pinned to c9a67b23e8)

Solutions

  1. Append the bucket to the endpoint path: 'minio://127.0.0.1:9000/mybucket'.
  2. If the bucket lives under a 'minio/' prefix, that prefix is stripped automatically — still keep at least the bucket segment.
  3. Check the object-storage URL format in the docs and ensure the path component is present.

Example fix

// before
newMinio("http://127.0.0.1:9000", ak, sk, "")
// after
newMinio("http://127.0.0.1:9000/mybucket", ak, sk, "")
Defensive patterns

Strategy: validation

Validate before calling

u, _ := url.Parse(endpoint)
if u == nil || len(u.Path) < 2 {
	return fmt.Errorf("minio endpoint %q must include /bucket", endpoint)
}

Try / catch

store, err := newMinio(endpoint, ak, sk, "")
if err != nil && strings.Contains(err.Error(), "no bucket name") {
	endpoint = strings.TrimRight(endpoint, "/") + "/" + bucket
	store, err = newMinio(endpoint, ak, sk, "")
}

Prevention

When it happens

Trigger: Calling newMinio (or using a minio:// URL with juicefs) with an endpoint lacking a path, e.g. 'minio://127.0.0.1:9000' or 'http://minio.local' with no bucket segment.

Common situations: Forgetting the bucket in the endpoint URL; assuming the bucket comes from an env var or flag — for MinIO it must be in the path.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of juicedata/juicefs@c9a67b23e8 (2026-09-06). Data as JSON: /api/errors/2e9ad830c61995e3. Report an issue: GitHub.