{"record":{"id":"248a4f41b017e9bc","repo":"juicedata/juicefs","slug":"invalid-storage-s","errorCode":null,"errorMessage":"invalid storage: %s","messagePattern":"invalid storage: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/object/object_storage.go","lineNumber":202,"sourceCode":"\nvar storages = make(map[string]Creator)\n\nfunc Register(name string, register Creator) {\n\tstorages[name] = register\n}\n\nfunc IsSupported(name string) bool {\n\t_, ok := storages[name]\n\treturn ok\n}\n\nfunc CreateStorage(name, endpoint, accessKey, secretKey, token string) (ObjectStorage, error) {\n\tf, ok := storages[name]\n\tif ok {\n\t\tlogger.Debugf(\"Creating %s storage at endpoint %s\", name, endpoint)\n\t\treturn f(endpoint, accessKey, secretKey, token)\n\t}\n\treturn nil, fmt.Errorf(\"invalid storage: %s\", name)\n}\n\nvar bufPool = sync.Pool{\n\tNew: func() interface{} {\n\t\t// Default io.Copy uses 32KB buffer, here we choose a larger one (1MiB io-size increases throughput by ~20%)\n\t\tbuf := make([]byte, 1<<20)\n\t\treturn &buf\n\t},\n}\n\ntype listThread struct {\n\tsync.Mutex\n\tcond      *utils.Cond\n\tready     bool\n\terr       error\n\tentries   []Object\n\tnextToken string\n\thasMore   bool","sourceCodeStart":184,"sourceCodeEnd":220,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/pkg/object/object_storage.go#L184-L220","documentation":"CreateStorage looks up the storage backend constructor in a registry keyed by the storage name (s3, oss, cos, minio, nfs, ...). If the name is not registered, it returns 'invalid storage: <name>'. This is a typo/unsupported-backend guard, thrown before any network call.","triggerScenarios":"Passing an unknown or misspelled storage name as the first argument of CreateStorage, or a name whose backend was compiled out (e.g. juicefs.lite builds disable most object storages), or via --storage flag with an unsupported value.","commonSituations":"Typos like 'S3' vs 's3' or 'cephs' vs 'cephs3'; using a backend not compiled into a lite binary; older JuiceFS version lacking a newer backend name; format/storage config mismatch.","solutions":["Check the exact supported storage names in pkg/object/object_storage.go (the storages map) and fix the spelling","Rebuild with the full build (not juicefs.lite) if the backend was compiled out","Upgrade JuiceFS if the backend name is newer than your binary","Validate the --storage value before calling CreateStorage"],"exampleFix":"// before\nstore, err := object.CreateStorage(\"S3\", endpoint, ak, sk, \"\")\n// after\nstore, err := object.CreateStorage(\"s3\", endpoint, ak, sk, \"\")","handlingStrategy":"validation","validationCode":"supported := map[string]bool{\"s3\":true,\"oss\":true,\"cos\":true,\"obs\":true,\"minio\":true,\"nfs\":true}\nif !supported[name] { return fmt.Errorf(\"unsupported storage %q\", name) }","typeGuard":null,"tryCatchPattern":"store, err := object.CreateStorage(name, endpoint, ak, sk, token)\nif err != nil {\n\tvar ie *fmt.Errorf\n\tif strings.HasPrefix(err.Error(), \"invalid storage:\") {\n\t\t// fall back to a known-good backend name\n\t}\n}","preventionTips":["Copy backend names exactly from the storages registry in pkg/object/object_storage.go","Remember names are lowercase","Check your build variant (lite builds drop backends)"],"tags":["object-storage","configuration","unsupported-backend"],"backgroundTag":"invalid-enum-value","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"}