{"record":{"id":"cc918294d67c2e0a","repo":"chroma-core/chroma","slug":"cannot-disable-all-indexes-for-special-key-key","errorCode":null,"errorMessage":"Cannot disable all indexes for special key '${key}'. These keys are managed automatically by the system.","messagePattern":"Cannot disable all indexes for special key '(.+?)'\\. These keys are managed automatically by the system\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"clients/new-js/packages/chromadb/src/schema.ts","lineNumber":852,"sourceCode":"    // Sparse vector indexes require both sourceKey and embeddingFunction,\n    // so they cannot be auto-enabled and must be configured explicitly\n    current.sparseVector = new SparseVectorValueType(\n      new SparseVectorIndexType(false, new SparseVectorIndexConfig()),\n    );\n    current.intValue = new IntValueType(\n      new IntInvertedIndexType(true, new IntInvertedIndexConfig()),\n    );\n    current.floatValue = new FloatValueType(\n      new FloatInvertedIndexType(true, new FloatInvertedIndexConfig()),\n    );\n    current.boolean = new BoolValueType(\n      new BoolInvertedIndexType(true, new BoolInvertedIndexConfig()),\n    );\n  }\n\n  private disableAllIndexesForKey(key: string): void {\n    if (key === EMBEDDING_KEY || key === DOCUMENT_KEY) {\n      throw new Error(\n        `Cannot disable all indexes for special key '${key}'. These keys are managed automatically by the system.`,\n      );\n    }\n\n    const current = (this.keys[key] = ensureValueTypes(this.keys[key]));\n    current.string = new StringValueType(\n      new FtsIndexType(false, new FtsIndexConfig()),\n      new StringInvertedIndexType(false, new StringInvertedIndexConfig()),\n    );\n    current.floatList = new FloatListValueType(\n      new VectorIndexType(false, new VectorIndexConfig()),\n    );\n    current.sparseVector = new SparseVectorValueType(\n      new SparseVectorIndexType(false, new SparseVectorIndexConfig()),\n    );\n    current.intValue = new IntValueType(\n      new IntInvertedIndexType(false, new IntInvertedIndexConfig()),\n    );","sourceCodeStart":834,"sourceCodeEnd":870,"githubUrl":"https://github.com/chroma-core/chroma/blob/aecdd12c8a891610db8653630b066b32ceb678b5/clients/new-js/packages/chromadb/src/schema.ts#L834-L870","documentation":"Thrown by the private Schema.disableAllIndexesForKey() helper when asked to bulk-disable every index type on the reserved '#embedding' or '#document' key. The system owns these keys: disabling all indexes on '#document' would kill full-text search and on '#embedding' would kill vector search, which the schema model does not allow. As with the enable twin, the current public deleteIndex(key-only) path throws a different message first, so this text surfaces from internal or future bulk paths.","triggerScenarios":"Reaching disableAllIndexesForKey('#embedding') or disableAllIndexesForKey('#document') — e.g. a teardown script that disables all indexes per key, or a future client where deleteIndex(undefined, key) is allowed again.","commonSituations":"Test teardown that 'turns everything off' per key; migration scripts that normalize schemas and accidentally include system keys; code written against a hypothetical/older bulk API.","solutions":["Exclude '#embedding' and '#document' from bulk disable loops","To turn off FTS, use schema.deleteIndex(new FtsIndexConfig(), '#document')","Leave the vector index on '#embedding' alone — its deletion is explicitly unsupported"],"exampleFix":"// before\nkeys.forEach(k => disableAllForKey(k)); // throws for '#document'\n// after\nkeys.filter(k => !['#document', '#embedding'].includes(k)).forEach(k => disableAllForKey(k));","handlingStrategy":"validation","validationCode":"const SPECIAL_KEYS = new Set([\"#embedding\", \"#document\"]);\nfunction safeKeysForBulkDisable(keys) { return keys.filter(k => !SPECIAL_KEYS.has(k)); }","typeGuard":"const isUserKey = (k) => k !== \"#embedding\" && k !== \"#document\" && !k.startsWith(\"#\");","tryCatchPattern":"try { bulkDisable(key); } catch (e) { if (e instanceof Error && /managed automatically by the system/.test(e.message)) continue; else throw e; }","preventionTips":["Never include system keys in teardown/disable loops","Prefer deleting specific index configs over blanket key operations","Log which keys are skipped so cleanup scripts stay auditable"],"tags":["chromadb","schema","index-management","reserved-keys"],"backgroundTag":"reserved-key-misuse","analyzedSha":"aecdd12c8a891610db8653630b066b32ceb678b5","analyzedAt":"2026-08-16T21:53:27.228Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}