chroma-core/chroma · error · Error

Cannot disable all indexes for special key '${key}'. These k

Error message

Cannot disable all indexes for special key '${key}'. These keys are managed automatically by the system.

What it means

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.

Source

Thrown at clients/new-js/packages/chromadb/src/schema.ts:852

    // Sparse vector indexes require both sourceKey and embeddingFunction,
    // so they cannot be auto-enabled and must be configured explicitly
    current.sparseVector = new SparseVectorValueType(
      new SparseVectorIndexType(false, new SparseVectorIndexConfig()),
    );
    current.intValue = new IntValueType(
      new IntInvertedIndexType(true, new IntInvertedIndexConfig()),
    );
    current.floatValue = new FloatValueType(
      new FloatInvertedIndexType(true, new FloatInvertedIndexConfig()),
    );
    current.boolean = new BoolValueType(
      new BoolInvertedIndexType(true, new BoolInvertedIndexConfig()),
    );
  }

  private disableAllIndexesForKey(key: string): void {
    if (key === EMBEDDING_KEY || key === DOCUMENT_KEY) {
      throw new Error(
        `Cannot disable all indexes for special key '${key}'. These keys are managed automatically by the system.`,
      );
    }

    const current = (this.keys[key] = ensureValueTypes(this.keys[key]));
    current.string = new StringValueType(
      new FtsIndexType(false, new FtsIndexConfig()),
      new StringInvertedIndexType(false, new StringInvertedIndexConfig()),
    );
    current.floatList = new FloatListValueType(
      new VectorIndexType(false, new VectorIndexConfig()),
    );
    current.sparseVector = new SparseVectorValueType(
      new SparseVectorIndexType(false, new SparseVectorIndexConfig()),
    );
    current.intValue = new IntValueType(
      new IntInvertedIndexType(false, new IntInvertedIndexConfig()),
    );

View on GitHub (pinned to aecdd12c8a)

Solutions

  1. Exclude '#embedding' and '#document' from bulk disable loops
  2. To turn off FTS, use schema.deleteIndex(new FtsIndexConfig(), '#document')
  3. Leave the vector index on '#embedding' alone — its deletion is explicitly unsupported

Example fix

// before
keys.forEach(k => disableAllForKey(k)); // throws for '#document'
// after
keys.filter(k => !['#document', '#embedding'].includes(k)).forEach(k => disableAllForKey(k));
Defensive patterns

Strategy: validation

Validate before calling

const SPECIAL_KEYS = new Set(["#embedding", "#document"]);
function safeKeysForBulkDisable(keys) { return keys.filter(k => !SPECIAL_KEYS.has(k)); }

Type guard

const isUserKey = (k) => k !== "#embedding" && k !== "#document" && !k.startsWith("#");

Try / catch

try { bulkDisable(key); } catch (e) { if (e instanceof Error && /managed automatically by the system/.test(e.message)) continue; else throw e; }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of chroma-core/chroma@aecdd12c8a (2026-08-16). Data as JSON: /api/errors/cc918294d67c2e0a. Report an issue: GitHub.