{"record":{"id":"f0fd4cebc4f46fe2","repo":"weaviate/weaviate","slug":"reading-props-w","errorCode":null,"errorMessage":"reading props: %w","messagePattern":"reading props: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"adapters/repos/db/inverted_reindex_task_generic.go","lineNumber":472,"sourceCode":"// the end of [runtimeSwap] after the atomic pointer flip.\nfunc (t *ShardReindexTaskGeneric) RunPrepareOnShard(ctx context.Context, shard ShardLike) error {\n\tentry, err := t.enterDTMPhase(ctx, shard, \"RunPrepareOnShard\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tconcreteShard, logger, rt := entry.shard, entry.logger, entry.rt\n\n\t// Idempotent fast-path: already merged means prep was already\n\t// completed (either by an earlier call in this process or by a\n\t// previous boot's runtimePrepare → markMerged).\n\tif rt.IsMerged() {\n\t\tlogger.Debug(\"RunPrepareOnShard: already merged on disk; no-op\")\n\t\treturn nil\n\t}\n\n\tprops, err := t.readPropsToReindex(rt)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"reading props: %w\", err)\n\t}\n\tif len(props) == 0 {\n\t\treturn fmt.Errorf(\"no props found for prep on shard %q\", concreteShard.Name())\n\t}\n\n\tif err := t.ensureReindexBucketsLoadedForSwap(ctx, logger, concreteShard, props); err != nil {\n\t\treturn fmt.Errorf(\"ensure buckets loaded: %w\", err)\n\t}\n\n\treturn t.runtimePrepare(ctx, logger, shard, rt, props)\n}\n\n// dtmPhaseEntry is the shared entry state of the DTM-scheduler-driven phase\n// callbacks (RunPrepareOnShard / RunSwapOnShard).\ntype dtmPhaseEntry struct {\n\tshard  *Shard\n\tlogger logrus.FieldLogger\n\trt     reindexTracker","sourceCodeStart":454,"sourceCodeEnd":490,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/adapters/repos/db/inverted_reindex_task_generic.go#L454-L490","documentation":"RunPrepareOnShard wraps failures from t.readPropsToReindex(rt) with the 'reading props' prefix. readPropsToReindex reads the reindex tracker / schema to determine which inverted-index properties must be re-indexed on this shard during the disk-heavy prep phase. A failure here means the property list could not be computed, so prep cannot proceed.","triggerScenarios":"Calling RunPrepareOnShard (directly or via the DTM scheduler paths dispatchMatrixDriveToMerged / dispatchMatrixDriveToTidied) when readPropsToReindex returns an error — typically because the reindex tracker's stored migration state is unreadable/corrupt or the schema lookup for the class fails.","commonSituations":"Corrupt .mig sentinel/tracker files on disk after a crash; schema class deleted concurrently while a migration is in flight; permission problems reading the tracker file after a restore/backup copy.","solutions":["Read the wrapped underlying error to see whether it is a file-read, parse, or schema lookup failure","Check the shard directory's migration/tracker files are readable and not corrupt; restore from a healthy node or backup if corrupt","Verify the class still exists in the schema and the migration is still applicable; cancel stale migrations if the class changed","Re-run RunPrepareOnShard — the merge phase is idempotent via sentinels"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Pre-check: tracker file readable and class exists in schema\nif _, err := os.Stat(shardDir + \"/reindexed.mig\"); err != nil { /* missing tracker: re-run earlier phases */ }\nif !schema.ClassExists(className) { return fmt.Errorf(\"class %s gone; cancel migration\", className) }","typeGuard":null,"tryCatchPattern":"if err := task.RunPrepareOnShard(ctx, shard); err != nil {\n\tif strings.Contains(err.Error(), \"reading props\") {\n\t\tlogger.Errorf(\"tracker/schema read failure on %s: %v\", shard.Name(), err)\n\t\t// inspect tracker files, restore or re-trigger migration\n\t}\n\treturn err\n}","preventionTips":["Avoid concurrent schema edits (property removal) during active migrations","Back up the shard directory before manual restores so .mig tracker files stay intact","Ensure file permissions are consistent when copying shard dirs between nodes","Verify phase ordering: never call prep before reindex completed"],"tags":["go","reindex","schema"],"backgroundTag":"reindex-tracker-read-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"}