{"record":{"id":"255499bec9a9b692","repo":"juicedata/juicefs","slug":"did-you-forget-to-specify-the-storage-type","errorCode":null,"errorMessage":"Did you forget to specify the `--storage <type>`?","messagePattern":"Did you forget to specify the `--storage <type>`\\?","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cmd/objbench.go","lineNumber":162,"sourceCode":"\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}\n\tif err != nil {","sourceCodeStart":144,"sourceCodeEnd":180,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/cmd/objbench.go#L144-L180","documentation":"This is the companion hint printed by objbench (cmd/objbench.go:162) immediately after the 'doesn't look like a file path' warning when --storage=file but the bucket endpoint contains '://'. It tells the user the most likely cause: the --storage flag was not set, so the 'file' default was applied to a URL-shaped endpoint. It is a warning prompt, not a thrown error; the command aborts only if the user does not confirm.","triggerScenarios":"`juicefs objbench <url-with-scheme>` where ctx.String(\"storage\") resolves to \"file\" (either unset or explicitly set to file) and strings.Contains(endpoint, \"://\") is true.","commonSituations":"Forgetting --storage when benchmarking against s3://, oss://, or minio endpoints; mistyping the storage flag name so it falls back to the default.","solutions":["Specify `--storage <type>` explicitly (s3, oss, redis, etc.) when the bucket is a URL","Verify the flag spelling and that it is placed before/after the command as documented","Pass a plain filesystem path if file storage was actually intended"],"exampleFix":"// before\njuicefs objbench oss://bucket/dir\n// after\njuicefs objbench --storage oss oss://bucket/dir","handlingStrategy":"validation","validationCode":"case \"$BUCKET\" in *\"://\"*) STORAGE_FLAG=\"--storage ${BUCKET%%://*}\";; *) STORAGE_FLAG=\"\";; esac\njuicefs objbench $STORAGE_FLAG \"$BUCKET\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Derive --storage from the URL scheme automatically in wrapper scripts","Avoid relying on the 'file' default when endpoints may be URLs"],"tags":["cli","object-storage","missing-flag"],"backgroundTag":"missing-required-flag","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"}