{"record":{"id":"b783503ac1683691","repo":"weaviate/weaviate","slug":"bucket-s","errorCode":null,"errorMessage":"bucket %s","messagePattern":"bucket (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"adapters/repos/db/vector/hfresh/store.go","lineNumber":77,"sourceCode":"\nfunc newBucketRef(store *lsmkv.Store, name string) bucketRef {\n\treturn bucketRef{store: store, name: name}\n}\n\n// acquire resolves the bucket and pins it against teardown, or reports that\n// the store no longer holds it ([lsmkv.ErrBucketNotFound]) or that the ref was\n// never initialized ([errUninitializedBucketRef]). The pin blocks a concurrent\n// bucket shutdown, so callers MUST call the returned release exactly once —\n// deferring it at the call site — and MUST NOT retain the bucket beyond it.\nfunc (r bucketRef) acquire() (*lsmkv.Bucket, func(), error) {\n\tif r.store == nil {\n\t\treturn nil, nil, errUninitializedBucketRef\n\t}\n\n\tbucket, release := r.store.AcquireBucketForRead(r.name)\n\tif bucket == nil {\n\t\trelease()\n\t\treturn nil, nil, errors.Wrapf(lsmkv.ErrBucketNotFound, \"bucket %s\", r.name)\n\t}\n\treturn bucket, release, nil\n}\n\ntype PostingStore struct {\n\tstore    *lsmkv.Store\n\tbucket   bucketRef\n\tlocks    *common.ShardedRWLocks\n\tmetrics  *Metrics\n\tversions *PostingVersionsStore\n}\n\nfunc NewPostingStore(store *lsmkv.Store, sharedBucket bucketRef, metrics *Metrics, id string, cfg StoreConfig) (*PostingStore, error) {\n\tbName := postingsBucketName(id)\n\n\tversions := NewPostingVersionsStore(sharedBucket)\n\n\terr := store.CreateOrLoadBucket(context.Background(),","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/adapters/repos/db/vector/hfresh/store.go#L59-L95","documentation":"bucketRef.acquire resolves the named lsmkv bucket and pins it against concurrent teardown. This wrapper fires when the store's Bucket lookup fails for the given name — the bucket is not registered (store teardown, naming mismatch) — so the caller cannot obtain a usable bucket handle.","triggerScenarios":"Thrown at adapters/repos/db/vector/hfresh/store.go:77 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the bucket name in the message against the buckets the store actually created","If this happens during shutdown, treat ErrBucketNotFound as expected and stop using the bucket","Retry after shard init completes if the call raced startup"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"75aa4b6d11f8818305aafd4440b4e32794f7ca04","analyzedAt":"2026-09-04T14:58:20.392Z","contentChangedAt":"2026-09-04T14:58:20.392Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}