{"record":{"id":"6e2cb72d266fb4f3","repo":"weaviate/weaviate","slug":"index-q-w","errorCode":null,"errorMessage":"index %q: %w","messagePattern":"index %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"adapters/repos/db/crud.go","lineNumber":133,"sourceCode":"\t\t// store original position to make assembly easier later\n\t\tq.OriginalPosition = i\n\n\t\tfor _, index := range db.indices {\n\t\t\tif index.Config.ClassName != schema.ClassName(q.ClassName) {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tqueue := byIndex[index.ID()]\n\t\t\tqueue = append(queue, q)\n\t\t\tbyIndex[index.ID()] = queue\n\t\t}\n\t}\n\n\tout := make(search.Results, len(query))\n\tfor indexID, queries := range byIndex {\n\t\tindexRes, err := db.indices[indexID].multiObjectByID(ctx, queries, tenant)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"index %q: %w\", indexID, err)\n\t\t}\n\n\t\tfor i, obj := range indexRes {\n\t\t\tif obj == nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tres := obj.SearchResult(additional, tenant)\n\t\t\tout[queries[i].OriginalPosition] = *res\n\t\t}\n\t}\n\n\treturn out, nil\n}\n\n// ObjectByID checks every index of the particular kind for the ID\n//\n// @warning: this function is deprecated by Object()\nfunc (db *DB) ObjectByID(ctx context.Context, id strfmt.UUID,","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/adapters/repos/db/crud.go#L115-L151","documentation":"This wrapper is produced by DB.MultiGet (adapters/repos/db/crud.go:133) when multiObjectByID on one of the involved indices fails. MultiGet batches object lookups per index and then fans out; if any single index's batched lookup errors, the whole MultiGet fails wrapped with that index's ID. The inner error is preserved via %w for errors.Is/As inspection.","triggerScenarios":"Calling MultiGet (e.g. batch GetObjects by id across classes) where one of the target indices' multiObjectByID fails — typically storage/LSM read errors, tenant-resolution failures for multi-tenant classes, or internal shard lookup problems.","commonSituations":"Batch import pipelines resolving references by id across several collections; reference-graph processing where one corrupted or unhealthy shard poisons the entire multi-class batch read; multi-tenant requests where the tenant filter is missing for one involved class.","solutions":["Read the wrapped inner error to identify which shard/tenant/IO problem caused the failure and address that root cause.","Split the MultiGet into per-class requests so one failing index doesn't abort lookups for healthy classes.","For multi-tenant classes, ensure the tenant is supplied for every lookup in the batch.","Check shard/LSM health on the node holding indexID if errors persist (logs, disk space, compaction status)."],"exampleFix":"// before\nres, err := db.MultiGet(ctx, query, tenant)\nif err != nil { return err } // whole batch lost\n// after\nfor _, q := range perClassQueries {\n  res, err := db.MultiGet(ctx, q, tenant)\n  if err != nil { log.Warnf(\"class %s lookup failed, skipping: %v\", q.Class, err); continue }\n  out = append(out, res...)\n}","handlingStrategy":"try-catch","validationCode":"// validate classes exist and tenant is set before batch get\nfor _, class := range classes {\n  if !classExists(schema, class) { return fmt.Errorf(\"class %q missing before MultiGet\", class) }\n}\nif isMultiTenant(schema, classes[0]) && tenant == \"\" { return errors.New(\"tenant required\") }","typeGuard":null,"tryCatchPattern":"res, err := db.MultiGet(ctx, query, tenant)\nif err != nil {\n  var idxErr *IndexResolutionError // or inspect wrapped cause\n  if errors.As(err, &idxErr) {\n    log.Warnf(\"index %v failed in MultiGet: %v\", idxErr.IndexID, err)\n    return partialResults, nil // degrade instead of failing whole batch\n  }\n  return err\n}","preventionTips":["Split cross-class batch lookups into per-class requests to contain failures.","Always supply tenant for multi-tenant classes in batch reads.","Monitor shard health (disk, compaction) to preempt read errors.","Use errors.As to reach the wrapped cause rather than parsing error strings."],"tags":["go","weaviate","batch-read","error-wrapping","multi-tenancy"],"backgroundTag":"batch-object-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"}