{"record":{"id":"da9126c816efbb93","repo":"weaviate/weaviate","slug":"parse-refs-for-prop-q","errorCode":null,"errorMessage":"parse refs for prop %q","messagePattern":"parse refs for prop %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"adapters/repos/db/refcache/resolver.go","lineNumber":142,"sourceCode":"func (r *Resolver) parseSchema(schema map[string]interface{},\n\tidx search.SelectPropertiesIndex,\n) (map[string]interface{}, error) {\n\tfor propName, value := range schema {\n\t\trefs, ok := value.(models.MultipleRef)\n\t\tif !ok {\n\t\t\t// not a ref, not interesting for us\n\t\t\tcontinue\n\t\t}\n\n\t\tselectProp := idx.Find(propName)\n\t\tif selectProp == nil {\n\t\t\t// user is not interested in this prop\n\t\t\tcontinue\n\t\t}\n\n\t\tparsed, err := r.parseRefs(refs, propName, *selectProp)\n\t\tif err != nil {\n\t\t\treturn schema, errors.Wrapf(err, \"parse refs for prop %q\", propName)\n\t\t}\n\n\t\tif parsed != nil {\n\t\t\tschema[propName] = parsed\n\t\t}\n\t}\n\n\treturn schema, nil\n}\n\nfunc (r *Resolver) parseRefs(input models.MultipleRef, prop string,\n\tselectProp search.SelectProperty,\n) ([]interface{}, error) {\n\tvar refs []interface{}\n\tfor _, selectPropRef := range selectProp.Refs {\n\t\t// built once, reused for every ref of this property\n\t\tinnerIdx := selectPropRef.RefProperties.Indexed()\n\t\tadditionalProperties := selectPropRef.AdditionalProperties","sourceCodeStart":124,"sourceCodeEnd":160,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/adapters/repos/db/refcache/resolver.go#L124-L160","documentation":"parseSchema walks an object's properties and, for each selected reference property, calls parseRefs to resolve its references. A failure for property propName is wrapped with \"parse refs for prop %q\", naming the exact property whose references could not be resolved. Called from parseObject, parseAdditionalGroup, and resolveRef.","triggerScenarios":"Reference resolution fails for a specific property — nested resolveRefs error (e.g. inner per-item failure), malformed select property, or refs pointing to a class that no longer matches the property's class list.","commonSituations":"Schema drift: property defined with class X but data contains refs to class Y; querying a property whose referenced class was renamed or deleted; nested GraphQL ref selections with inner failures.","solutions":["Fix the named property in the error — check which classes it references in the schema","Verify all referenced classes still exist and match the property definition","Inspect the inner wrapped error for the per-item position detail","Clean up inconsistent refs on affected objects"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Confirm the property's reference classes exist before resolving\nprop := classProperty(schema, className, propName)\nfor _, dt := range prop.DataType {\n    refClass := strings.TrimPrefix(strings.TrimSuffix(dt, \">\"), \"<\")\n    if !classExists(schema, refClass) {\n        return fmt.Errorf(\"property %q references missing class %q\", propName, refClass)\n    }\n}","typeGuard":"// Go\nfunc isPropParseError(err error, prop string) bool {\n    return err != nil && strings.Contains(err.Error(), fmt.Sprintf(\"parse refs for prop %q\", prop))\n}","tryCatchPattern":"// Go\nif err != nil {\n    if isPropParseError(err, \"hasAuthor\") {\n        log.Warnf(\"bad refs on hasAuthor, querying without it: %v\", err)\n        return queryWithoutProperty(ctx, \"hasAuthor\")\n    }\n    return err\n}","preventionTips":["Never rename/delete a class referenced by another property without migrating data","Validate ref property class targets against the schema in CI","Inspect inner \"at position\" wraps to locate the bad item"],"tags":["weaviate","refcache","schema","reference-resolution"],"backgroundTag":"reference-parse-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"}