{"record":{"id":"5e622251b5062b03","repo":"weaviate/weaviate","slug":"property-s-not-found-in-schema","errorCode":null,"errorMessage":"property '%s' not found in schema","messagePattern":"property '(.+?)' not found in schema","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"adapters/repos/db/shard_write_batch_references.go","lineNumber":154,"sourceCode":"\t\t\terrLock.Unlock()\n\t\t\tcontinue\n\t\t}\n\n\t\t// The merge above bumped the object past a live reindex watermark; mirror\n\t\t// its co-located props so the backfill scan's skip stays lossless.\n\t\tif err := b.mirrorColocatedPropsForReindex(res); err != nil {\n\t\t\tfunc() {\n\t\t\t\terrLock.Lock()\n\t\t\t\tdefer errLock.Unlock()\n\t\t\t\terrs[i] = err\n\t\t\t}()\n\t\t\tcontinue\n\t\t}\n\n\t\tprop, ok := propsByName[ref.From.Property.String()]\n\t\tif !ok {\n\t\t\terrLock.Lock()\n\t\t\terrs[i] = fmt.Errorf(\"property '%s' not found in schema\", ref.From.Property)\n\t\t\terrLock.Unlock()\n\t\t\tcontinue\n\t\t}\n\n\t\t// generally the batch ref is an append only change which does not alter\n\t\t// the vector position. There is however one inverted index link that needs\n\t\t// to be cleanup: the ref count\n\t\tif err := b.analyzeInverted(invertedMerger, res, ref, prop); err != nil {\n\t\t\terrLock.Lock()\n\t\t\terrs[i] = err\n\t\t\terrLock.Unlock()\n\t\t\tcontinue\n\t\t}\n\t}\n\n\tif err := b.writeInverted(invertedMerger.Merge()); err != nil {\n\t\tfor i := range errs {\n\t\t\terrs[i] = errors.Wrap(err, \"write inverted batch\")","sourceCodeStart":136,"sourceCodeEnd":172,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/adapters/repos/db/shard_write_batch_references.go#L136-L172","documentation":"Thrown during a batch reference add operation (`storeSingleBatchInLSM` inside `storeInObjectStore`) when the property named by the reference's `from` field (e.g. `Article {hasAuthor: ...}`) does not exist in the target class's schema. The batcher looks up the property in a `propsByName` map built from the read-only schema (`getSchemaPropsByName`); the merge of the reference into the target object still succeeds up to that point, but the inverted-index ref-count update cannot proceed, so the reference at that batch index fails. This indicates a client-side schema mismatch: the property is misspelled, was never created, or was deleted.","triggerScenarios":"Calling the batch references API (REST `/v1/batch/references`) with `from` pointing to a property name that is not defined in the schema of the `from` class — e.g. `from: weaviate://localhost/Article/hasAuthors` when the property is actually `hasAuthor`, or referencing a property on the wrong class, or after the property was removed concurrently while a batch was in flight.","commonSituations":"Typos in property names in bulk import scripts; generating reference batches from a stale schema snapshot after a migration deleted/renamed the property; multi-tenant setups where the reference batch targets a class whose schema differs from what the client assumed; case-sensitivity mistakes (`hasauthor` vs `hasAuthor`).","solutions":["Check the property name in `from` exactly matches a property of the source class: run the GraphQL `__type { ...Obj }` introspection query or `GET /v1/schema/{className}` and compare names (property names are case-sensitive).","Create the missing property first via `POST /v1/schema/{className}/properties`, then re-submit the failed references.","Fix misspellings/case in the import script; a failed reference leaves the merge undone, so re-run those entries after correction.","If the property was recently deleted or renamed, regenerate the batch from the current schema instead of a cached copy.","For partial batch results, use per-reference error handling: Weaviate returns an error per batch index — requeue only the failing indices."],"exampleFix":"// before\nclient.Batch().ReferencesBatcher().WithReference(&models.BatchReference{\n    From:  \"weaviate://localhost/Article/hasAuthors\", // typo: property is hasAuthor\n    To:    \"weaviate://localhost/Author/...\",\n}).Do(ctx) // -> property 'hasAuthors' not found in schema\n\n// after\nschema, _ := client.Schema().Getter().WithClassName(\"Article\").Do(ctx)\nfor _, p := range schema.Properties {\n    fmt.Println(p.Name) // verify exact name before batching\n}\nclient.Batch().ReferencesBatcher().WithReference(&models.BatchReference{\n    From: \"weaviate://localhost/Article/hasAuthor\",\n    To:   \"weaviate://localhost/Author/...\",\n}).Do(ctx)","handlingStrategy":"validation","validationCode":"func assertRefPropsExist(ctx context.Context, client *weaviate.Client, class string, props []string) error {\n    schema, err := client.Schema().Getter().WithClassName(class).Do(ctx)\n    if err != nil {\n        return err\n    }\n    have := map[string]bool{}\n    for _, p := range schema.Properties {\n        have[p.Name] = true\n    }\n    for _, want := range props {\n        if !have[want] {\n            return fmt.Errorf(\"class %s has no property %q\", class, want)\n        }\n    }\n    return nil\n}","typeGuard":null,"tryCatchPattern":"_, err := refsBatcher.Do(ctx)\nif err != nil {\n    var we *weaviate.WeaviateClientError\n    if errors.As(err, &we) && strings.Contains(we.Msg, \"not found in schema\") {\n        // re-fetch schema, fix/queue the failing references, do not blind-retry\n        return refreshSchemaAndRequeue(failedRefs)\n    }\n    return err\n}","preventionTips":["Always derive property names from a live `GET /v1/schema` call, never from hardcoded strings.","Remember property and class names are case-sensitive; lint import scripts for exact names.","Serialize schema migrations and reference imports; never delete/rename a property mid-batch.","Log the `from` property of every failed reference for easy requeue after schema fixes.","Create all reference properties before starting bulk imports."],"tags":["schema","references","batch-import","cross-references"],"backgroundTag":"schema-property-not-found","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"}