{"record":{"id":"aa96b9c2f1a6354f","repo":"juicedata/juicefs","slug":"ensure-bucket-s-w","errorCode":null,"errorMessage":"ensure bucket %s: %w","messagePattern":"ensure bucket (.+?): %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/object/storj.go","lineNumber":98,"sourceCode":"func (s *storjClient) Limits() Limits {\n\treturn Limits{\n\t\tIsSupportMultipartUpload: true,\n\t\tIsSupportUploadPartCopy:  false,\n\t\tMinPartSize:              5 << 20,\n\t\tMaxPartSize:              5 << 30,\n\t\tMaxPartCount:             10000,\n\t}\n}\n\nfunc (s *storjClient) Shutdown() {\n\t_ = s.project.Close()\n}\n\nfunc (s *storjClient) Create(ctx context.Context) error {\n\treturn storjBackoff(ctx, func() error {\n\t\t_, err := s.project.EnsureBucket(ctx, s.bucket)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"ensure bucket %s: %w\", s.bucket, err)\n\t\t}\n\t\treturn nil\n\t})\n}\n\nfunc (s *storjClient) Head(ctx context.Context, key string) (Object, error) {\n\tvar object *uplink.Object\n\terr := storjBackoff(ctx, func() error {\n\t\tvar e error\n\t\tobject, e = s.project.StatObject(ctx, s.bucket, key)\n\t\treturn e\n\t})\n\tif err != nil {\n\t\tif errors.Is(err, uplink.ErrObjectNotFound) {\n\t\t\treturn nil, os.ErrNotExist\n\t\t}\n\t\treturn nil, err\n\t}","sourceCodeStart":80,"sourceCodeEnd":116,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/pkg/object/storj.go#L80-L116","documentation":"storjClient.Create wraps storj's project.EnsureBucket with retry backoff (storjBackoff); if bucket creation still fails, the error is wrapped as 'ensure bucket <name>'. The %w wrapping preserves the underlying Storj error (auth, project ID, network, quota).","triggerScenarios":"Calling Create on a storj object store when EnsureBucket fails: invalid access grant/API key, wrong satellite address, nonexistent project, bucket name violating Storj rules, or persistent network failure beyond the backoff budget.","commonSituations":"Expired or revoked Storj access grant in JuiceFS config; misconfigured satellite URL; project ID mismatch between the access grant and configured endpoint.","solutions":["Regenerate the Storj access grant and update the configuration (access grants can expire or be revoked).","Verify the satellite address and project match the access grant.","Check bucket-name validity (Storj naming rules) and network reachability to the satellite; retry after transient outages since the call is already backoff-retried."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// validate access grant before mounting\nuplinkCfg := uplink.Config{}\nproj, err := uplinkCfg.OpenProject(ctx, accessGrant)\nif err != nil { return fmt.Errorf(\"invalid storj access grant: %v\", err) }","typeGuard":null,"tryCatchPattern":"if err := store.Create(ctx); err != nil {\n    var se *uplink.Error\n    if errors.As(err, &se) {\n        log.Printf(\"storj ensure bucket failed: class=%v cause=%v\", se.Class, se.Details)\n    }\n    return err\n}","preventionTips":["Test the access grant with uplink CLI before configuring JuiceFS.","Regenerate access grants on rotation schedules.","Confirm satellite address and project match the grant."],"tags":["storj","bucket","network"],"backgroundTag":"api-request-failed","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"}