n8n-io/n8n · error · NodeOperationError
Error connecting to ChromaDB: ${message}
Error message
Error connecting to ChromaDB: ${message} What it means
Catch-all NodeOperationError in `getVectorStoreClient` for any failure from `getChromaLibConfig` or `ExtendedChroma.fromExistingCollection`. The original error message is appended. This wraps the LangChain-side Chroma construction that binds the embeddings function, the URL, and the existing collection name into a VectorStore instance.
Source
Thrown at packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreChromaDB/VectorStoreChromaDB.node.ts:405
loadFields: retrieveFields,
insertFields,
sharedFields,
async getVectorStoreClient(context, _filter, embeddings, itemIndex) {
const collection = context.getNodeParameter('chromaCollection', itemIndex, '', {
extractValue: true,
});
if (typeof collection !== 'string') {
throw new NodeOperationError(context.getNode(), 'Collection must be a string');
}
try {
const config = await getChromaLibConfig(context, collection, itemIndex);
return await ExtendedChroma.fromExistingCollection(embeddings, config);
} catch (error) {
const message = error instanceof Error ? error.message : 'Unknown error';
throw new NodeOperationError(context.getNode(), `Error connecting to ChromaDB: ${message}`, {
itemIndex,
});
}
},
async populateVectorStore(context, embeddings, documents, itemIndex) {
const collection = context.getNodeParameter('chromaCollection', itemIndex, '', {
extractValue: true,
});
if (typeof collection !== 'string') {
throw new NodeOperationError(context.getNode(), 'Collection must be a string');
}
const options = context.getNodeParameter('options', itemIndex, {});
const clearCollection = options.clearCollection === true;
if (clearCollection) {View on GitHub (pinned to 5ac6606e81)
Solutions
- Read the appended `message` — it usually says whether the collection is missing or the connection failed.
- If the collection is missing, create it first (insert mode) or pick an existing one from the dropdown.
- Verify the credential's URL and API key still match the running ChromaDB.
- Retry after confirming ChromaDB is reachable from the n8n host.
Example fix
// before
try {
const config = await getChromaLibConfig(context, collection, itemIndex);
return await ExtendedChroma.fromExistingCollection(embeddings, config);
} catch (error) {
const message = error instanceof Error ? error.message : 'Unknown error';
throw new NodeOperationError(context.getNode(), `Error connecting to ChromaDB: ${message}`, { itemIndex });
}
// after: classify the common 'collection not found' case so the user gets a fix
} catch (error) {
const message = error instanceof Error ? error.message : 'Unknown error';
const notFound = /does not exist|not found/i.test(message);
throw new NodeOperationError(
context.getNode(),
`Error connecting to ChromaDB: ${message}`,
{
itemIndex,
description: notFound
? `Collection "${collection}" does not exist. Run the node in Insert mode to create it.`
: 'Verify the ChromaDB URL and credentials.',
},
);
} Defensive patterns
Strategy: validation
Validate before calling
// Confirm the collection exists before binding it to ExtendedChroma.
async function ensureCollectionExists(client: ChromaClient, name: string): Promise<void> {
const names = (await client.listCollections()).map((c) => (typeof c === 'string' ? c : c.name));
if (!names.includes(name)) {
throw new Error(`Collection "${name}" does not exist; run the node in Insert mode first.`);
}
} Type guard
function isMissingCollectionError(error: unknown): boolean {
return error instanceof Error && /does not exist|not found/i.test(error.message);
} Try / catch
try {
const config = await getChromaLibConfig(context, collection, itemIndex);
return await ExtendedChroma.fromExistingCollection(embeddings, config);
} catch (error) {
const message = error instanceof Error ? error.message : 'Unknown error';
throw new NodeOperationError(context.getNode(), `Error connecting to ChromaDB: ${message}`, {
itemIndex,
description: isMissingCollectionError(error)
? `Collection "${collection}" does not exist. Run in Insert mode to create it.`
: 'Verify the ChromaDB URL and credentials.',
});
} Prevention
- Use the dropdown to pick existing collections rather than typing names.
- Run Insert mode once to create a collection before Load/Retrieve.
- Verify the credential still points at the right ChromaDB instance.
When it happens
Trigger: The named collection does not exist on the server (so fromExistingCollection cannot bind); the collection exists but has incompatible metadata; the URL/auth config cannot be assembled from the credential; the underlying ChromaClient throws during the first lazy call.
Common situations: User typed a collection name that does not exist yet; collection was deleted between workflow save and run; switching from one credential to another pointing at a different ChromaDB instance; SDK version change altering the fromExistingCollection signature.
Related errors
- Error inserting documents into ChromaDB: ${errorMessage}
- Failed to list ChromaDB collections: ${errorMessage}
- Collection must be a string
- ChromaDB embedding dimension mismatch: ${displayMessage}
- Error: ${error.message}
AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12).
Data as JSON: /api/errors/75a5d7a471d04a1c.
Report an issue: GitHub.