{"record":{"id":"8adb3fb765082ce1","repo":"chroma-core/chroma","slug":"cannot-modify-embedding-currently-not-supported","errorCode":null,"errorMessage":"Cannot modify #embedding. Currently not supported","messagePattern":"Cannot modify #embedding\\. Currently not supported","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"clients/new-js/packages/chromadb/src/schema.ts","lineNumber":596,"sourceCode":"      this.setIndexForKey(key, config as IndexConfig, true);\n    }\n\n    return this;\n  }\n\n  deleteIndex(config?: IndexConfig, key?: string): this {\n    const configProvided = config !== undefined && config !== null;\n    const keyProvided = key !== undefined && key !== null;\n\n    if (!configProvided && !keyProvided) {\n      throw new Error(\n        \"Cannot disable all indexes. Must specify either config or key.\",\n      );\n    }\n\n    // Disallow using special internal key #embedding\n    if (keyProvided && key && key === EMBEDDING_KEY) {\n      throw new Error(\"Cannot modify #embedding. Currently not supported\");\n    }\n\n    // Only allow #document with FtsIndexConfig (to disable FTS)\n    if (\n      keyProvided &&\n      key === DOCUMENT_KEY &&\n      !(config instanceof FtsIndexConfig)\n    ) {\n      throw new Error(\n        `Cannot delete index on special key '${key}' with this config. Only FtsIndexConfig is allowed for #document.`,\n      );\n    }\n\n    // Disallow any key starting with # (except #document which allows FTS deletion)\n    if (keyProvided && key && key.startsWith(\"#\") && key !== DOCUMENT_KEY) {\n      throw new Error(\n        \"key cannot begin with '#'. Keys starting with '#' are reserved for system use.\",\n      );","sourceCodeStart":578,"sourceCodeEnd":614,"githubUrl":"https://github.com/chroma-core/chroma/blob/aecdd12c8a891610db8653630b066b32ceb678b5/clients/new-js/packages/chromadb/src/schema.ts#L578-L614","documentation":"'#embedding' holds the collection's vectors and is configured automatically by the Schema class, so deleteIndex refuses to touch it: modification of '#embedding' is currently not supported at all. Vector index settings are changed by applying a new global config via createIndex, never by deleting the '#embedding' index.","triggerScenarios":"schema.deleteIndex(cfg, '#embedding'); schema.deleteIndex(undefined, '#embedding'); iterating Object.keys(schema.keys) and calling deleteIndex on every key including system keys.","commonSituations":"Programmatic teardown loops over all schema keys; attempting to disable vector search by deleting the embedding index (separately blocked by the vector-delete restriction).","solutions":["Do not target '#embedding' with deleteIndex; removing the embedding key's index is not supported.","To change vector index settings, apply a new global config: createIndex(new VectorIndexConfig(...)) with no key.","To fully remove it, recreate the collection with a schema built without the vector index."],"exampleFix":"// before\nschema.deleteIndex(cfg, '#embedding');\n\n// after\nschema.createIndex(new VectorIndexConfig()); // reconfigure globally instead of deleting","handlingStrategy":"validation","validationCode":"function deleteIndexGuarded(schema: Schema, config: IndexConfig, key: string): void {\n  if (key === '#embedding') {\n    throw new Error('#embedding cannot be modified — apply a global VectorIndexConfig instead');\n  }\n  schema.deleteIndex(config, key);\n}","typeGuard":"const isProtectedKey = (key: string): boolean => key === '#embedding';","tryCatchPattern":"try {\n  schema.deleteIndex(config, key);\n} catch (e) {\n  if (e instanceof Error && e.message === 'Cannot modify #embedding. Currently not supported') {\n    // skip system keys during teardown\n  } else {\n    throw e;\n  }\n}","preventionTips":["Always exclude '#embedding' from delete/modify loops.","Change vector index behavior via global createIndex, never by deleting the embedding index."],"tags":["schema","index-config","reserved-key","chroma"],"backgroundTag":"invalid-index-configuration","analyzedSha":"aecdd12c8a891610db8653630b066b32ceb678b5","analyzedAt":"2026-08-16T21:53:27.228Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}