chroma-core/chroma · error · Error
Cannot disable all index types for key '${key}'. Please spec
Error message
Cannot disable all index types for key '${key}'. Please specify a specific index configuration. What it means
Thrown by Schema.deleteIndex() when you supply only a key (config undefined/null) — i.e. you asked to disable ALL index types for that key at once. The schema API currently requires you to name the specific index configuration you want to turn off, so blanket 'delete everything on this key' is rejected (a TODO in the source notes this may be relaxed later).
Source
Thrown at clients/new-js/packages/chromadb/src/schema.ts:641
// Temporarily disallow deleting sparse vector index (both globally and per-key)
if (config instanceof SparseVectorIndexConfig) {
throw new Error(
"Deleting sparse vector index is not currently supported.",
);
}
// FTS deletion is only allowed on #document key
if (
config instanceof FtsIndexConfig &&
(!keyProvided || key !== DOCUMENT_KEY)
) {
throw new Error("Deleting FTS index is only supported on #document key.");
}
// TODO: Consider removing this check in the future to allow disabling all indexes for a key
// Disallow disabling all index types for a key (config=undefined, key="some_key")
if (keyProvided && !configProvided && key) {
throw new Error(
`Cannot disable all index types for key '${key}'. Please specify a specific index configuration.`,
);
}
if (keyProvided && configProvided && key) {
this.setIndexForKey(key, config as IndexConfig, false);
} else if (!keyProvided && configProvided) {
this.setIndexInDefaults(config as IndexConfig, false);
}
return this;
}
serializeToJSON(): InternalSchema {
const defaults = this.serializeValueTypes(this.defaults);
const keys: Record<string, ValueTypesJson> = {};
for (const [keyName, valueTypes] of Object.entries(this.keys)) {View on GitHub (pinned to aecdd12c8a)
Solutions
- Pass the specific config you want to disable, e.g. schema.deleteIndex(new StringInvertedIndexConfig(), 'my_key')
- To disable several index types on one key, chain multiple deleteIndex calls, one per config class
- To remove the key's overrides entirely, rebuild the schema without that key rather than blanket-disabling
Example fix
// before schema.deleteIndex(undefined, "title"); // after schema.deleteIndex(new StringInvertedIndexConfig(), "title"); schema.deleteIndex(new FtsIndexConfig(), "#document");
Defensive patterns
Strategy: validation
Validate before calling
function assertDeleteIndexArgs(config, key) {
if ((config === undefined || config === null) && key) {
throw new TypeError(`deleteIndex needs a config for key '${key}'`);
}
} Type guard
const hasIndexConfig = (c) => c !== undefined && c !== null;
Try / catch
try { schema.deleteIndex(cfg, key); } catch (e) { if (e instanceof Error && /disable all index types/.test(e.message)) console.warn('Pass a specific IndexConfig to deleteIndex'); else throw e; } Prevention
- Never call deleteIndex with key only — always pair key with a config instance
- Encapsulate schema mutations behind typed wrapper functions
- Review the schema.ts guard list when upgrading the client, since the TODOs hint these restrictions may loosen
When it happens
Trigger: schema.deleteIndex(undefined, 'my_key') or schema.deleteIndex(null, 'title'). Fires when keyProvided && !configProvided && key (schema.ts:640).
Common situations: Coming from an ORM-style API where delete(key) removes all indexes on a column; trying to 'reset' a key to unindexed state in cleanup scripts between tests; iterating keys from schema serialization and calling deleteIndex for each without a config.
Related errors
- Deleting FTS index is only supported on #document key.
- Cannot enable all indexes for special key '${key}'. These ke
- Cannot disable all indexes for special key '${key}'. These k
- If sourceKey is provided then embeddingFunction must also be
- Bad request to ${input} with status: ${resp.statusText}
AI-assisted analysis of chroma-core/chroma@aecdd12c8a (2026-08-16).
Data as JSON: /api/errors/06778f59f05d1cc3.
Report an issue: GitHub.