juicedata/juicefs · warning

Did you forget to specify the `--storage <type>`?

Error message

Did you forget to specify the `--storage <type>`?

What it means

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.

Source

Thrown at cmd/objbench.go:162

	if bSize == 0 || fsize == 0 || smallBSize == 0 {
		logger.Fatalf("block-size, big-object-size and small-object-size should not be zero")
	}
	ak, sk, token := ctx.String("access-key"), ctx.String("secret-key"), ctx.String("session-token")
	if ak == "" {
		ak = os.Getenv("ACCESS_KEY")
	}
	if sk == "" {
		sk = os.Getenv("SECRET_KEY")
	}
	if token == "" {
		token = os.Getenv("SESSION_TOKEN")
	}
	endpoint := ctx.Args().First()
	storageType := strings.ToLower(ctx.String("storage"))
	if storageType == "file" {
		if strings.Contains(endpoint, "://") {
			warn("The bucket \"%s\" doesn't look like a file path.", endpoint)
			warn("Did you forget to specify the `--storage <type>`?")
			if !userConfirmed() {
				return errors.New("Aborted")
			}
		}
		var err error
		if endpoint, err = filepath.Abs(endpoint); err != nil {
			logger.Fatalf("invalid path %q: %s", endpoint, err)
		}
	}
	var blobOrigin object.ObjectStorage
	var err error
	shards := ctx.Int("shards")
	if shards > 1 {
		blobOrigin, err = object.NewSharded(storageType, endpoint, ak, sk, token, shards)
	} else {
		blobOrigin, err = object.CreateStorage(storageType, endpoint, ak, sk, token)
	}
	if err != nil {

View on GitHub (pinned to c9a67b23e8)

Solutions

  1. Specify `--storage <type>` explicitly (s3, oss, redis, etc.) when the bucket is a URL
  2. Verify the flag spelling and that it is placed before/after the command as documented
  3. Pass a plain filesystem path if file storage was actually intended

Example fix

// before
juicefs objbench oss://bucket/dir
// after
juicefs objbench --storage oss oss://bucket/dir
Defensive patterns

Strategy: validation

Validate before calling

case "$BUCKET" in *"://"*) STORAGE_FLAG="--storage ${BUCKET%%://*}";; *) STORAGE_FLAG="";; esac
juicefs objbench $STORAGE_FLAG "$BUCKET"

Prevention

When it happens

Trigger: `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.

Common situations: Forgetting --storage when benchmarking against s3://, oss://, or minio endpoints; mistyping the storage flag name so it falls back to the default.

Understand the failure class

Background: "--flag is required" and "must specify" CLI errors: how missing-required-flag validation works and how to fix it — this error's family across 20 libraries.

Related errors


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