{"record":{"id":"90f36c161b30570d","repo":"juicedata/juicefs","slug":"the-bucket-s-doesn-t-look-like-a-file-path","errorCode":null,"errorMessage":"The bucket \"%s\" doesn't look like a file path.","messagePattern":"The bucket \"(.+?)\" doesn't look like a file path\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cmd/objbench.go","lineNumber":161,"sourceCode":"\tsmallBSize := int(utils.ParseBytes(ctx, \"small-object-size\", 'K'))\n\tif bSize == 0 || fsize == 0 || smallBSize == 0 {\n\t\tlogger.Fatalf(\"block-size, big-object-size and small-object-size should not be zero\")\n\t}\n\tak, sk, token := ctx.String(\"access-key\"), ctx.String(\"secret-key\"), ctx.String(\"session-token\")\n\tif ak == \"\" {\n\t\tak = os.Getenv(\"ACCESS_KEY\")\n\t}\n\tif sk == \"\" {\n\t\tsk = os.Getenv(\"SECRET_KEY\")\n\t}\n\tif token == \"\" {\n\t\ttoken = os.Getenv(\"SESSION_TOKEN\")\n\t}\n\tendpoint := ctx.Args().First()\n\tstorageType := strings.ToLower(ctx.String(\"storage\"))\n\tif storageType == \"file\" {\n\t\tif strings.Contains(endpoint, \"://\") {\n\t\t\twarn(\"The bucket \\\"%s\\\" doesn't look like a file path.\", endpoint)\n\t\t\twarn(\"Did you forget to specify the `--storage <type>`?\")\n\t\t\tif !userConfirmed() {\n\t\t\t\treturn errors.New(\"Aborted\")\n\t\t\t}\n\t\t}\n\t\tvar err error\n\t\tif endpoint, err = filepath.Abs(endpoint); err != nil {\n\t\t\tlogger.Fatalf(\"invalid path %q: %s\", endpoint, err)\n\t\t}\n\t}\n\tvar blobOrigin object.ObjectStorage\n\tvar err error\n\tshards := ctx.Int(\"shards\")\n\tif shards > 1 {\n\t\tblobOrigin, err = object.NewSharded(storageType, endpoint, ak, sk, token, shards)\n\t} else {\n\t\tblobOrigin, err = object.CreateStorage(storageType, endpoint, ak, sk, token)\n\t}","sourceCodeStart":143,"sourceCodeEnd":179,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/cmd/objbench.go#L143-L179","documentation":"objbench validates that when --storage=file is selected, the bucket argument is actually a filesystem path. If the endpoint contains '://', it is almost certainly an object-storage URL (e.g. s3://bucket), meaning the user forgot to pass --storage <type> and the default 'file' was used. objbench prints this warning and asks for confirmation before proceeding or aborting.","triggerScenarios":"Running `juicefs objbench s3://mybucket ...` (or any URL with a scheme) without `--storage <type>`, so storageType defaults to \"file\" while the endpoint is clearly an object-store URL.","commonSituations":"Copy-pasting a command meant for an S3/OSS backend but omitting the --storage flag; scripting objbench with a variable holding a URL while assuming the storage type is auto-detected.","solutions":["Add the correct `--storage <type>` flag (e.g. --storage s3) matching the endpoint scheme","If you really intend to bench a local path, pass the filesystem path without a scheme (e.g. /mnt/data or ./dir)","Answer the interactive confirmation with 'n'/abort and re-run with corrected arguments"],"exampleFix":"// before\njuicefs objbench s3://mybucket/prefix\n// after\njuicefs objbench --storage s3 s3://mybucket/prefix","handlingStrategy":"validation","validationCode":"if [[ \"$BUCKET\" == *\"://\"* && -z \"$STORAGE_FLAG\" ]]; then echo \"Add --storage <type> for URL buckets\"; exit 1; fi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass --storage explicitly when bucketing to object stores","Lint scripts for objbench calls whose bucket contains '://' without --storage"],"tags":["cli","object-storage","validation"],"backgroundTag":"invalid-cli-argument","analyzedSha":"c9a67b23e8e08ec23ec331aa6f1675e2319e921c","analyzedAt":"2026-09-06T17:55:48.476Z","contentChangedAt":"2026-09-06T17:55:48.476Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}