{"record":{"id":"780c3279806da4c3","repo":"weaviate/weaviate","slug":"the-dynamic-index-can-only-be-created-when-async-i","errorCode":null,"errorMessage":"the dynamic index can only be created when async indexing is enabled","messagePattern":"the dynamic index can only be created when async indexing is enabled","errorType":"validation","errorClass":null,"httpStatus":422,"severity":"error","filePath":"usecases/schema/class.go","lineNumber":1760,"sourceCode":"\t}\n\n\tif err := h.vectorizerValidator.ValidateVectorizer(vectorizer); err != nil {\n\t\treturn errors.Wrap(err, \"vectorizer\")\n\t}\n\n\treturn nil\n}\n\n// validateVectorIndexTypeBasic is the per-type correctness gate\n// (async-indexing for dynamic, known name).\n// Runs unconditionally — these are invariants, not policy.\nfunc (h *Handler) validateVectorIndexTypeBasic(vectorIndexType string) error {\n\tswitch vectorIndexType {\n\tcase vectorindex.VectorIndexTypeHNSW, vectorindex.VectorIndexTypeFLAT:\n\t\treturn nil\n\tcase vectorindex.VectorIndexTypeDYNAMIC:\n\t\tif !h.asyncIndexingEnabled {\n\t\t\treturn fmt.Errorf(\"the dynamic index can only be created when async indexing is enabled\")\n\t\t}\n\t\treturn nil\n\tcase vectorindex.VectorIndexTypeHFresh:\n\t\treturn nil\n\tdefault:\n\t\treturn errors.Errorf(\"unrecognized or unsupported vectorIndexType %q\",\n\t\t\tvectorIndexType)\n\t}\n}\n\n// validateVectorIndexTypeAllowList enforces ALLOWED_VECTOR_INDEX_TYPES.\n// Split from the basic check because the grandfather skip applies here.\n//\n// On a named-vector hnsw rejection the message gets an out-of-date-client\n// hint: older clients send vectorIndexType=\"hnsw\" implicitly even when\n// the user didn't pick it, so a hfresh-only allow-list rejects requests\n// the user never thought they made.\nfunc (h *Handler) validateVectorIndexTypeAllowList(vectorIndexType string, forNamedVector bool) error {","sourceCodeStart":1742,"sourceCodeEnd":1778,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/usecases/schema/class.go#L1742-L1778","documentation":"Returned by validateVectorIndexTypeBasic when a vector target declares the dynamic index type but the server was not started with async indexing enabled (ASYNC_INDEXING env). Dynamic indexing depends on asynchronous maintenance, so the combination is rejected as an invariant, regardless of other settings.","triggerScenarios":"Thrown at usecases/schema/class.go:1760 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Start the server with async indexing enabled (ASYNC_INDEXING=true) if dynamic indexes are required","Use the hnsw or flat index type instead when async indexing is off"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}