n8n-io/n8n · error · OperationalError

Chroma getOrCreateCollection error: ${message}

Error message

Chroma getOrCreateCollection error: ${message}

What it means

ExtendedChroma.ensureCollection wraps any failure of ChromaClient/CloudClient.getOrCreateCollection in an OperationalError. The underlying message is appended. This is the first touchpoint with the Chroma server (or Chroma Cloud), so most connection/config problems surface here.

Source

Thrown at packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreChromaDB/VectorStoreChromaDB.node.ts:222

					});
				} else {
					// Use ChromaClient for self-hosted instances
					const { ChromaClient } = await ExtendedChroma.imports();
					const clientConfig = this.url ? { path: this.url, ...clientParams } : clientParams;

					this.index = new ChromaClient(clientConfig);
				}
			}

			try {
				this.collection = await this.index.getOrCreateCollection({
					name: this.collectionName,
					...(this.collectionMetadata && { metadata: this.collectionMetadata }),
					embeddingFunction: null,
				});
			} catch (error) {
				const message = error instanceof Error ? error.message : String(error);
				throw new OperationalError(`Chroma getOrCreateCollection error: ${message}`);
			}
		}

		if (!this.collection) {
			throw new OperationalError('Failed to initialize Chroma collection');
		}

		return this.collection;
	}

	async similaritySearchVectorWithScore(
		query: number[],
		k: number,
		filter?: this['FilterType'],
	): Promise<Array<[Document, number]>> {
		// Handle the case where query might actually be a nested array which is usually the case.

		let flatQuery: number[] = [];

View on GitHub (pinned to 5ac6606e81)

Solutions

  1. Verify the ChromaDB server URL is reachable from the n8n host (curl the /api/v1/heartbeat endpoint).
  2. For Chroma Cloud, confirm apiKey, tenant, and database are correct.
  3. Upgrade (or downgrade) the ChromaDB server to a version compatible with the langchain Chroma integration used here.
  4. Simplify the collection name to alphanumeric/hyphen/underscore and remove non-string metadata.
  5. Inspect the appended message — it usually states the exact server-side refusal.
Defensive patterns

Strategy: try-catch

Validate before calling

// Health-check Chroma before getOrCreateCollection.
try {
  await this.index.heartbeat(); // ChromaClient exposes heartbeat()
} catch {
  throw new Error('ChromaDB server is unreachable at the configured URL before collection init.');
}

Try / catch

try {
  this.collection = await this.index.getOrCreateCollection({
    name: this.collectionName,
    ...(this.collectionMetadata && { metadata: this.collectionMetadata }),
    embeddingFunction: null,
  });
} catch (error) {
  const message = error instanceof Error ? error.message : String(error);
  throw new OperationalError(`Chroma getOrCreateCollection error: ${message}`);
}

Prevention

When it happens

Trigger: this.index.getOrCreateCollection({ name, metadata?, embeddingFunction: null }) rejects — Chroma server unreachable, Cloud API key invalid, collection name has illegal characters, collection metadata rejected, or the Chroma version rejects embeddingFunction:null.

Common situations: ChromaDB server URL wrong or server down (self-hosted); Chroma Cloud apiKey/tenant/database incorrect; ChromaDB version incompatibility (older versions do not accept embeddingFunction:null); collection name contains spaces/special characters; collection metadata with non-string values; CORS/network issue from the n8n host.

Related errors


AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12). Data as JSON: /api/errors/42faa6700aaba1f8. Report an issue: GitHub.