{"record":{"id":"2bf379b0c9ec8913","repo":"juicedata/juicefs","slug":"storj-bucket-name-is-required-set-via-bucket","errorCode":null,"errorMessage":"storj: bucket name is required (set via --bucket)","messagePattern":"storj: bucket name is required \\(set via --bucket\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/object/storj.go","lineNumber":355,"sourceCode":"\t\treturn iter.Err()\n\t})\n\tif err != nil {\n\t\treturn nil, \"\", err\n\t}\n\treturn pending, \"\", nil\n}\n\nfunc newStorj(endpoint, accessGrant, _, _ string) (ObjectStorage, error) {\n\tif accessGrant == \"\" {\n\t\treturn nil, fmt.Errorf(\"storj: access grant is required (pass via --access-key)\")\n\t}\n\taccess, err := uplink.ParseAccess(accessGrant)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"storj: parse access grant: %w\", err)\n\t}\n\tbucket := strings.Trim(strings.TrimPrefix(endpoint, \"storj://\"), \"/\")\n\tif bucket == \"\" {\n\t\treturn nil, fmt.Errorf(\"storj: bucket name is required (set via --bucket)\")\n\t}\n\n\tcfg := uplink.Config{UserAgent: UserAgent}\n\n\tctx := context.Background()\n\tproject, err := cfg.OpenProject(ctx, access)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"storj: open project: %w\", err)\n\t}\n\treturn &storjClient{project: project, bucket: bucket}, nil\n}\n\nfunc init() {\n\tRegister(\"storj\", newStorj)\n}\n","sourceCodeStart":337,"sourceCodeEnd":371,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/pkg/object/storj.go#L337-L371","documentation":"The bucket name derived by stripping the 'storj://' scheme and slashes from the endpoint is empty. Validation guard: Storj operations target a single bucket that must be encoded in the endpoint or set via --bucket; without it the client has nothing to address.","triggerScenarios":"Thrown at pkg/object/storj.go:355 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Include the bucket in the endpoint, e.g. storj://mybucket"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}