{"record":{"id":"0159637aebdfad4f","repo":"chroma-core/chroma","slug":"cannot-create-index-on-special-key-key-this-k","errorCode":null,"errorMessage":"Cannot create index on special key '{key}'. This key is managed automatically by the system. Invoke create_index(VectorIndexConfig(...)) without specifying a key to configure the vector index globally.","messagePattern":"Cannot create index on special key '(.+?)'\\. This key is managed automatically by the system\\. Invoke create_index\\(VectorIndexConfig\\(\\.\\.\\.\\)\\) without specifying a key to configure the vector index globally\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"chromadb/api/types.py","lineNumber":2144,"sourceCode":"        config: Optional[IndexConfig] = None,\n        key: Optional[Union[str, \"Key\"]] = None,\n    ) -> \"Schema\":\n        \"\"\"Create an index configuration.\"\"\"\n        # Convert Key to string if provided\n        from chromadb.execution.expression.operator import Key as KeyType\n\n        if key is not None and isinstance(key, KeyType):\n            key = key.name\n\n        # Disallow config=None and key=None - too dangerous\n        if config is None and key is None:\n            raise ValueError(\n                \"Cannot enable all index types globally. Must specify either config or key.\"\n            )\n\n        # Disallow using special internal key #embedding\n        if key is not None and key == EMBEDDING_KEY:\n            raise ValueError(\n                f\"Cannot create index on special key '{key}'. This key is managed automatically by the system. Invoke create_index(VectorIndexConfig(...)) without specifying a key to configure the vector index globally.\"\n            )\n\n        # Only allow #document with FtsIndexConfig\n        if key == DOCUMENT_KEY and not isinstance(config, FtsIndexConfig):\n            raise ValueError(\n                f\"Cannot create index on special key '{key}' with this config. \"\n                \"Only FtsIndexConfig is allowed for #document.\"\n            )\n\n        # Disallow any key starting with # (except #document which allows FTS)\n        if key is not None and key.startswith(\"#\") and key != DOCUMENT_KEY:\n            raise ValueError(\n                \"key cannot begin with '#'. \"\n                \"Keys starting with '#' are reserved for system use.\"\n            )\n\n        # Special handling for vector index","sourceCodeStart":2126,"sourceCodeEnd":2162,"githubUrl":"https://github.com/chroma-core/chroma/blob/aecdd12c8a891610db8653630b066b32ceb678b5/chromadb/api/types.py#L2126-L2162","documentation":"Error \"Cannot create index on special key '{key}'. This key is managed automatically by the system. Invoke create_index(VectorIndexConfig(...)) without specifying a key to configure the vector index globally.\" thrown in chroma-core/chroma.","triggerScenarios":"Thrown at chromadb/api/types.py:2144 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"aecdd12c8a891610db8653630b066b32ceb678b5","analyzedAt":"2026-08-16T21:53:27.228Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}