{"record":{"id":"541694dd80b62ef5","repo":"chroma-core/chroma","slug":"schema-is-missing-defaults-float-list-vector-index","errorCode":null,"errorMessage":"Schema is missing defaults.float_list.vector_index","messagePattern":"Schema is missing defaults\\.float_list\\.vector_index","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"chromadb/api/collection_configuration.py","lineNumber":832,"sourceCode":") -> \"Schema\":\n    \"\"\"\n    Updates a schema with configuration changes.\n    Only updates fields that are present in the configuration update.\n\n    Args:\n        schema: The existing Schema object\n        configuration: The configuration updates to apply\n\n    Returns:\n        Updated Schema object\n    \"\"\"\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,","sourceCodeStart":814,"sourceCodeEnd":850,"githubUrl":"https://github.com/chroma-core/chroma/blob/aecdd12c8a891610db8653630b066b32ceb678b5/chromadb/api/collection_configuration.py#L814-L850","documentation":"This ValueError from update_schema_from_collection_configuration indicates an internal invariant broke: while applying a collection-configuration update, the collection's Schema has no defaults.float_list.vector_index (the object describing how the #embedding column is indexed). Every properly created collection with a vector index has this, so hitting it usually means the schema was constructed outside the normal path, is malformed/None, or the collection predates vector-index defaults.","triggerScenarios":"Calling client.modify_collection/collection.modify with an hnsw or spann update where the server-side Schema object lacks defaults.float_list or defaults.float_list.vector_index — e.g. collections restored from very old Chroma versions, hand-built/test schemas, or a schema where defaults were dropped during a migration. The error is raised before any field updates are applied.","commonSituations":"Persisted databases created by much older Chroma versions being upgraded in place and then modified; test harnesses that fabricate Schema objects directly; bugs in custom server builds or forks that skip default vector-index assignment at collection creation.","solutions":["Create a fresh collection and re-ingest the data instead of modifying the malformed one","Upgrade the Chroma server/client together so collections always carry a complete schema before you call modify","If operating a custom build, ensure collection creation assigns defaults.float_list.vector_index; report the issue upstream if a stock server produces this","Check collection metadata/configuration first and only call modify on collections that expose a vector index"],"exampleFix":"// before\nold = client.get_collection('legacy_from_v0.4')\nold.modify(configuration={'hnsw': {'ef_search': 200}})  # schema lacks vector index\n\n// after\nnew = client.create_collection('legacy_migrated', configuration={'hnsw': {'ef_search': 200}})\nnew.add(ids=old.get()['ids'], embeddings=old.get(include=['embeddings'])['embeddings'],\n        documents=old.get(include=['documents'])['documents'])","handlingStrategy":"try-catch","validationCode":"def collection_supports_index_update(collection) -> bool:\n    cfg = collection.configuration or {}\n    return 'hnsw' in cfg or 'spann' in cfg or cfg.get('embedding_function') is not None\n\n# heuristic client-side check; the authoritative check is the server schema\nif collection_supports_index_update(collection):\n    collection.modify(configuration=update)","typeGuard":null,"tryCatchPattern":"try:\n    collection.modify(configuration=update)\nexcept ValueError as e:\n    if 'Schema is missing defaults.float_list.vector_index' in str(e):\n        # schema malformed: migrate data into a freshly created collection instead\n        migrate_to_new_collection(collection)\n    else:\n        raise","preventionTips":["Upgrade Chroma client and server together before modifying legacy collections","Create collections with an explicit configuration so schemas are always complete","Avoid modify on collections restored from very old versions; recreate them"],"tags":["chroma","schema","vector-index","modify-collection","internal-invariant"],"backgroundTag":"schema-validation-failed","analyzedSha":"aecdd12c8a891610db8653630b066b32ceb678b5","analyzedAt":"2026-08-16T21:53:27.228Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}