{"record":{"id":"e253e81c0c5eb41f","repo":"chroma-core/chroma","slug":"schema-is-missing-keys-embedding-key-float-list","errorCode":null,"errorMessage":"Schema is missing keys[{embedding_key}].float_list.vector_index","messagePattern":"Schema is missing keys\\[(.+?)\\]\\.float_list\\.vector_index","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"chromadb/api/collection_configuration.py","lineNumber":843,"sourceCode":"    \"\"\"\n\n    # Get the vector index from defaults and #embedding key\n    if (\n        schema.defaults.float_list is None\n        or schema.defaults.float_list.vector_index is None\n    ):\n        raise ValueError(\"Schema is missing defaults.float_list.vector_index\")\n\n    embedding_key = \"#embedding\"\n    if embedding_key not in schema.keys:\n        raise ValueError(f\"Schema is missing keys[{embedding_key}]\")\n\n    embedding_value_types = schema.keys[embedding_key]\n    if (\n        embedding_value_types.float_list is None\n        or embedding_value_types.float_list.vector_index is None\n    ):\n        raise ValueError(\n            f\"Schema is missing keys[{embedding_key}].float_list.vector_index\"\n        )\n\n    # Update vector index config in both locations\n    for vector_index in [\n        schema.defaults.float_list.vector_index,\n        embedding_value_types.float_list.vector_index,\n    ]:\n        if \"hnsw\" in configuration and configuration[\"hnsw\"] is not None:\n            # Update HNSW config\n            if vector_index.config.hnsw is None:\n                raise ValueError(\"Trying to update HNSW config but schema has SPANN\")\n\n            hnsw_config = vector_index.config.hnsw\n            update_hnsw = configuration[\"hnsw\"]\n\n            # Only update fields that are present in the update\n            if \"ef_search\" in update_hnsw:","sourceCodeStart":825,"sourceCodeEnd":861,"githubUrl":"https://github.com/chroma-core/chroma/blob/aecdd12c8a891610db8653630b066b32ceb678b5/chromadb/api/collection_configuration.py#L825-L861","documentation":"This ValueError from update_schema_from_collection_configuration fires when the schema's '#embedding' key exists but has no float_list.vector_index attached (embedding_value_types.float_list is None or its vector_index is None). The update loop needs the concrete vector-index object to mutate hnsw/spann settings, so a #embedding column that exists but is unindexed cannot be updated and the call is rejected.","triggerScenarios":"Calling collection.modify with an hnsw or spann configuration update on a collection whose '#embedding' key lacks a float_list.vector_index — e.g. an embedding column declared but never assigned an index, a schema built partially in tests, or a collection created by a version/fork that skips index assignment.","commonSituations":"Schemas from partial migrations or hand-constructed test fixtures; collections whose embeddings were added through non-standard paths; version skew between the client sending updates and the server owning the schema.","solutions":["Recreate the collection with a full configuration (including the desired vector index) and re-ingest","Ensure collection creation in your code/version always assigns a vector index to '#embedding' before later modify calls","Keep client and server versions in sync so schema invariants hold"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"def collection_has_indexed_embeddings(collection) -> bool:\n    cfg = collection.configuration or {}\n    return cfg.get('hnsw') is not None or cfg.get('spann') is not None\n\nif collection_has_indexed_embeddings(collection):\n    collection.modify(configuration=update)","typeGuard":null,"tryCatchPattern":"try:\n    collection.modify(configuration=update)\nexcept ValueError as e:\n    if 'float_list.vector_index' in str(e):\n        # vector index missing from schema: rebuild collection with full config\n        migrate_to_new_collection(collection)\n    else:\n        raise","preventionTips":["Always create collections with an explicit vector index configuration","Do not fabricate Schema objects outside chromadb's creation path","Test modify flows against collections created by the same Chroma version"],"tags":["chroma","schema","vector-index","embedding-key","modify-collection"],"backgroundTag":"schema-validation-failed","analyzedSha":"aecdd12c8a891610db8653630b066b32ceb678b5","analyzedAt":"2026-08-16T21:53:27.228Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}