{"record":{"id":"2bdf37a8842e6fca","repo":"weaviate/weaviate","slug":"analyzing-object-s-w","errorCode":null,"errorMessage":"analyzing object '%s': %w","messagePattern":"analyzing object '(.+?)': %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"adapters/repos/db/inverted_reindex_task_generic.go","lineNumber":2459,"sourceCode":"\t\t\t}\n\t\t}\n\n\t\tfor ; k != nil; k, v = cursor.Next() {\n\t\t\tik := keyParse(k)\n\t\t\tobj, err := storobj.FromBinaryOptionalDisk(v, className, addProps, propExtraction)\n\t\t\tif err != nil {\n\t\t\t\tmdCh <- &migrationData{err: fmt.Errorf(\"unmarshalling object '%s': %w\", ik.String(), err)}\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tif obj.LastUpdateTimeUnix() < reindexStarted.UnixMilli() {\n\t\t\t\t// The overlay is required by from-scratch strategies whose\n\t\t\t\t// target inverted-index flag is still false on the live\n\t\t\t\t// schema during backfill. It is nil for retokenize / refresh\n\t\t\t\t// strategies. See MigrationStrategy.AnalyzerOverlay.\n\t\t\t\tprops, _, err := shard.AnalyzeObjectForMigrationWithOverlay(obj, schemaOverlay)\n\t\t\t\tif err != nil {\n\t\t\t\t\tmdCh <- &migrationData{err: fmt.Errorf(\"analyzing object '%s': %w\", ik.String(), err)}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\n\t\t\t\tif <-breakCh {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tmdCh <- &migrationData{key: ik.Clone(), props: props, docID: obj.DocID}\n\t\t\t} else {\n\t\t\t\tif <-breakCh {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tmdCh <- &migrationData{key: ik.Clone()}\n\t\t\t}\n\t\t}\n\t\tif k == nil {\n\t\t\t<-breakCh\n\t\t\tmdCh <- nil\n\t\t}","sourceCodeStart":2441,"sourceCodeEnd":2477,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/adapters/repos/db/inverted_reindex_task_generic.go#L2441-L2477","documentation":"This error wraps a failure from shard.AnalyzeObjectForMigrationWithOverlay while a shard-level inverted-index reindex/migration backfills properties by scanning the objects bucket. During backfill each object older than the reindex start time is re-analyzed (with an optional schema overlay for from-scratch strategies) to rebuild its inverted-index entries; if analysis fails for a given object, the scan aborts and the wrapped error is pushed onto the migration channel, failing the whole migration task. It indicates per-object analysis (tokenization, property extraction, schema lookups) failed, not that the object is missing.","triggerScenarios":"Running an inverted-index reindex/migration (e.g. after changing a property's tokenization, indexFilterable/indexSearchable flags, or adding a property with index_null_state/property-length indexing) where shard.AnalyzeObjectForMigrationWithOverlay returns an error for a specific object — typically due to a schema/schemaOverlay mismatch for the property, an analyzer/tokenizer lookup failure, or corrupted/unexpected object content during storobj property extraction.","commonSituations":"Mid-migration schema updates so the live schema and the overlay disagree; a property referenced by the migration was deleted or renamed; custom/invalid tokenizer configuration on a text property; partially written or corrupt objects on disk after a crash; version upgrades where older objects lack fields the analyzer expects.","solutions":["Read the wrapped inner error (the %w cause) in the logs — it names the real failure (analyzer, property, schema); fix that underlying cause first.","Verify the collection schema matches the migration: the property being reindexed exists with valid tokenization/indexing settings, and no concurrent schema updates are running during the reindex.","Check the specific object (key printed via ik.String()) for corruption; if corrupt, delete/reinsert the object so the scan can proceed.","Restart the reindex/migration after fixing: the tracker's progress checkpoints let it resume from the last processed key.","If caused by an upgrade, ensure the upgrade completed fully (all schema migrations applied) before triggering the inverted reindex."],"exampleFix":"// before: migration aborts on the bad object\nprops, _, err := shard.AnalyzeObjectForMigrationWithOverlay(obj, schemaOverlay)\nif err != nil {\n    mdCh <- &migrationData{err: fmt.Errorf(\"analyzing object '%s': %w\", ik.String(), err)}\n    break\n}\n\n// after: log-and-skip poison objects so the migration completes (deviation only if skipping is acceptable)\nprops, _, err := shard.AnalyzeObjectForMigrationWithOverlay(obj, schemaOverlay)\nif err != nil {\n    logger.WithField(\"key\", ik.String()).Warnf(\"skipping unanalyzable object: %v\", err)\n    continue\n}","handlingStrategy":"try-catch","validationCode":"// Before triggering a reindex via schema update, validate the property config is analyzable\nprops, err := client.Schema.GetProperty(className, propName)\nif err != nil { return err }\nif props.Tokenization == \"\" && props.DataType[0] == \"text\" {\n    return fmt.Errorf(\"property %s has invalid/empty tokenization; fix schema before reindex\", propName)\n}","typeGuard":null,"tryCatchPattern":"res, err := client.Schema.UpdateClassProperty(className, propUpdate)\nif err != nil {\n    if strings.Contains(err.Error(), \"analyzing object\") {\n        // inner %w cause names the real analyzer/schema failure\n        logger.Errorf(\"reindex failed on object analysis: %v — check tokenization/schema of affected property\", err)\n        // fix schema or remove corrupt object, then re-trigger; tracker resumes from checkpoint\n    }\n    return err\n}","preventionTips":["Avoid concurrent schema updates while a reindex/migration is running.","Validate tokenization and indexing settings (indexFilterable/indexSearchable/indexNullState) before applying schema changes.","Watch for unwrapped inner causes in logs — they pinpoint the exact failing analyzer/property.","After crashes, verify shard integrity before re-triggering migrations so corrupt objects are repaired or removed first."],"tags":["go","reindex","inverted-index","migration","storage"],"backgroundTag":"object-analysis-failed-during-reindex","analyzedSha":"75aa4b6d11f8818305aafd4440b4e32794f7ca04","analyzedAt":"2026-09-04T14:58:20.392Z","contentChangedAt":"2026-09-04T14:58:20.392Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}