{"record":{"id":"fb4349c4a253a5aa","repo":"weaviate/weaviate","slug":"get-object-by-doc-id-w","errorCode":null,"errorMessage":"get object by doc id: %w","messagePattern":"get object by doc id: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"adapters/repos/db/shard_read.go","lineNumber":1011,"sourceCode":"\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"build inverted filter allow list\")\n\t}\n\n\treturn list, nil\n}\n\nfunc (s *Shard) uuidFromDocID(docID uint64) (strfmt.UUID, error) {\n\tbucket, release, err := s.objectsBucket()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer release()\n\n\tdocIDBytes := make([]byte, 8)\n\tbinary.LittleEndian.PutUint64(docIDBytes, docID)\n\tres, err := bucket.GetBySecondary(context.TODO(), 0, docIDBytes) // TODO: context\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"get object by doc id: %w\", err)\n\t}\n\n\tprop, _, err := storobj.ParseAndExtractProperty(res, \"id\")\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"parse and extract property: %w\", err)\n\t}\n\n\treturn strfmt.UUID(prop[0]), nil\n}\n\nfunc (s *Shard) batchDeleteObject(ctx context.Context, id strfmt.UUID, deletionTime time.Time) error {\n\t// Wait outside RLock: initAsyncReplication holds the write lock while\n\t// initialising, so blocking under RLock here would deadlock.\n\tif err := s.waitForMinimalHashTreeInitialization(ctx); err != nil {\n\t\treturn err\n\t}\n\n\ts.asyncReplicationRWMux.RLock()","sourceCodeStart":993,"sourceCodeEnd":1029,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/adapters/repos/db/shard_read.go#L993-L1029","documentation":"uuidFromDocID resolves a doc ID to a UUID by looking up the object in the bucket via its secondary index (doc ID key). The GetBySecondary call failed, so the reverse lookup cannot proceed. Used by FindUUIDs (e.g. during geo/filtered scans and reference resolution).","triggerScenarios":"FindUUIDs iterating doc IDs where bucket.GetBySecondary(0, docIDBytes) fails — LSM store read error, bucket closed (shard dropping), or IO failure during the lookup.","commonSituations":"Shard being dropped/migrated concurrently while a query resolves doc IDs; disk IO errors; corruption of the secondary index (docID→UUID mapping) after an unclean shutdown.","solutions":["Inspect the wrapped inner error for the underlying store failure","Retry the query — transient errors occur if the shard is being dropped or migrated concurrently","If persistent, verify shard integrity and restore from backup or rebuild","Check disk health and node logs for LSM store issues"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Ensure the target collection/shard is READY before doc-ID-dependent queries\nstatus, _ := client.Cluster().NodesStatus(ctx)","typeGuard":null,"tryCatchPattern":"uuids, err := shard.FindUUIDs(ctx, docIDs)\nif err != nil && strings.Contains(err.Error(), \"get object by doc id\") {\n\t// transient if shard was dropping/migrating — retry with backoff\n}","preventionTips":["Retry idempotent read paths with backoff around shard lifecycle events","Monitor disk health and LSM store warnings in node logs","Prevent concurrent shard deletion and heavy reads where possible","Restore corrupted shards from backup instead of continuing reads"],"tags":["lsmkv","docid-lookup","weaviate"],"backgroundTag":"secondary-index-lookup-failed","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"}