{"record":{"id":"a22ea45284353c8d","repo":"weaviate/weaviate","slug":"parse-vector-config-w","errorCode":null,"errorMessage":"parse vector config: %w","messagePattern":"parse vector config: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"usecases/schema/class.go","lineNumber":584,"sourceCode":"\t\treturn fmt.Errorf(\"ObjectTTLConfig: %w\", err)\n\t} else {\n\t\tupdated.ObjectTTLConfig = ttlConfig\n\t}\n\n\tif err := h.parser.ParseClass(updated); err != nil {\n\t\treturn err\n\t}\n\n\t// ideally, these calls would be encapsulated in ParseClass but ParseClass is\n\t// used in many different areas of the codebase that may cause BC issues with the\n\t// new validation logic. Issue ref: gh-5860\n\t// As our testing becomes more comprehensive, we can move these calls into ParseClass\n\tif err := h.parser.parseModuleConfig(updated); err != nil {\n\t\treturn fmt.Errorf(\"parse module config: %w\", err)\n\t}\n\n\tif err := h.parser.parseVectorConfig(updated); err != nil {\n\t\treturn fmt.Errorf(\"parse vector config: %w\", err)\n\t}\n\n\t// Initial class is read up-front for the grandfather-on-tighten skip\n\t// in validateVectorSettingsAgainst.\n\tinitial := h.schemaReader.ReadOnlyClass(className)\n\n\tif err := rejectVectorIndexTypeNone(initial, updated); err != nil {\n\t\tvclasses, qErr := h.schemaManager.QueryReadOnlyClasses(className)\n\t\tif qErr != nil {\n\t\t\treturn err\n\t\t}\n\t\tconsistent, ok := vclasses[className]\n\t\tif !ok || consistent.Class == nil {\n\t\t\treturn err\n\t\t}\n\t\tif err := rejectVectorIndexTypeNone(consistent.Class, updated); err != nil {\n\t\t\treturn err\n\t\t}","sourceCodeStart":566,"sourceCodeEnd":602,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/usecases/schema/class.go#L566-L602","documentation":"UpdateClassInternal calls parser.parseVectorConfig separately from ParseClass (BC reasons, gh-5860). Invalid vector index configuration — bad HNSW/flat/dynamic parameters, invalid type/values — aborts the update with this wrapped error.","triggerScenarios":"PUT /v1/schema/{class} whose vectorIndexConfig contains invalid values — e.g. non-numeric ef/eFConstruction, invalid maxConnections, bad compression (PQ/BQ/SQ) settings, or entries inconsistent with vectorIndexType.","commonSituations":"Typos in vector index parameters; wrong types (strings instead of numbers) from templated JSON; compression settings copied from incompatible versions; mixing flat/HNSW-specific options.","solutions":["Fix the invalid vectorIndexConfig field named in the inner error (types, ranges)","Ensure vectorIndexConfig options match the configured vectorIndexType","Omit vectorIndexConfig to keep defaults when not changing vector settings","Validate compression parameters (segments, centroids, trainingLimit) against current docs"],"exampleFix":"// before\n\"vectorIndexConfig\": {\"ef\": \"128\"}\n// after\n\"vectorIndexConfig\": {\"ef\": 128}","handlingStrategy":"validation","validationCode":"import \"encoding/json\"\nfunc validVectorConfig(class *models.Class) error {\n    raw, _ := json.Marshal(class.VectorIndexConfig)\n    var m map[string]json.Number\n    if err := json.Unmarshal(raw, &m); err != nil { return err }\n    for _, k := range []string{\"ef\", \"efConstruction\", \"maxConnections\"} {\n        if v, ok := m[k]; ok {\n            if _, err := v.Int64(); err != nil { return fmt.Errorf(\"%s must be numeric\", k) }\n        }\n    }\n    return nil\n}","typeGuard":null,"tryCatchPattern":"err := client.Schema().ClassUpdater().WithClassName(name).WithClass(payload).Do(ctx)\nif err != nil && strings.Contains(err.Error(), \"parse vector config\") {\n    // fix the vectorIndexConfig field or omit it to keep defaults\n}","preventionTips":["Send numeric values (not strings) for vectorIndexConfig parameters","Match vectorIndexConfig options to the configured vectorIndexType","Omit vectorIndexConfig in updates unless intentionally changing vector settings","Validate compression (PQ/BQ/SQ) parameters against the target version's docs"],"tags":["schema","vector-index","validation","hnsw"],"backgroundTag":"vector-config-invalid","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"}