{"record":{"id":"2e9ad830c61995e3","repo":"juicedata/juicefs","slug":"no-bucket-name-provided-in-s","errorCode":null,"errorMessage":"no bucket name provided in %s","messagePattern":"no bucket name provided in (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/object/minio.go","lineNumber":105,"sourceCode":"\t} else {\n\t\tcfg, err = config.LoadDefaultConfig(ctx, defaultChecksumOpts()...)\n\t}\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to load config: %s\", err)\n\t}\n\tclient := s3.NewFromConfig(cfg, func(options *s3.Options) {\n\t\toptions.Region = region\n\t\toptions.BaseEndpoint = aws.String(uri.Scheme + \"://\" + uri.Host)\n\t\toptions.EndpointOptions.DisableHTTPS = !ssl\n\t\toptions.UsePathStyle = defaultPathStyle()\n\t\toptions.HTTPClient = httpClient\n\t\toptions.APIOptions = append(options.APIOptions, func(stack *smithymiddleware.Stack) error {\n\t\t\treturn v4.SwapComputePayloadSHA256ForUnsignedPayloadMiddleware(stack)\n\t\t}, addS3UserAgent)\n\t\toptions.RetryMaxAttempts = 1\n\t})\n\tif len(uri.Path) < 2 {\n\t\treturn nil, fmt.Errorf(\"no bucket name provided in %s\", endpoint)\n\t}\n\tbucket := uri.Path[1:]\n\tif strings.Contains(bucket, \"/\") && strings.HasPrefix(bucket, \"minio/\") {\n\t\tbucket = bucket[len(\"minio/\"):]\n\t}\n\tbucket = strings.Split(bucket, \"/\")[0]\n\treturn &minio{s3client{bucket: bucket, s3: client, region: region}}, nil\n}\n\nfunc init() {\n\tRegister(\"minio\", newMinio)\n}\n","sourceCodeStart":87,"sourceCodeEnd":118,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/pkg/object/minio.go#L87-L118","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Append the bucket to the endpoint path: 'minio://127.0.0.1:9000/mybucket'.","If the bucket lives under a 'minio/' prefix, that prefix is stripped automatically — still keep at least the bucket segment.","Check the object-storage URL format in the docs and ensure the path component is present."],"exampleFix":"// before\nnewMinio(\"http://127.0.0.1:9000\", ak, sk, \"\")\n// after\nnewMinio(\"http://127.0.0.1:9000/mybucket\", ak, sk, \"\")","handlingStrategy":"validation","validationCode":"u, _ := url.Parse(endpoint)\nif u == nil || len(u.Path) < 2 {\n\treturn fmt.Errorf(\"minio endpoint %q must include /bucket\", endpoint)\n}","typeGuard":null,"tryCatchPattern":"store, err := newMinio(endpoint, ak, sk, \"\")\nif err != nil && strings.Contains(err.Error(), \"no bucket name\") {\n\tendpoint = strings.TrimRight(endpoint, \"/\") + \"/\" + bucket\n\tstore, err = newMinio(endpoint, ak, sk, \"\")\n}","preventionTips":["Always include /bucket in the MinIO endpoint path.","Document the minio://host/bucket format where endpoints are configured.","Validate the URL path before constructing the storage client."],"tags":["object-storage","minio","missing-argument"],"backgroundTag":"missing-required-argument","analyzedSha":"c9a67b23e8e08ec23ec331aa6f1675e2319e921c","analyzedAt":"2026-09-06T17:55:48.476Z","contentChangedAt":"2026-09-06T17:55:48.476Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}