chroma-core/chroma · error · ChromaNotFoundError
The requested resource could not be found
Error message
The requested resource could not be found
What it means
Thrown by chromaFetch (chroma-fetch.ts:82) as a ChromaNotFoundError when the server returns HTTP 404: the addressed resource (collection, tenant, database, or route) does not exist. Note the library's own getCollection()/deleteCollection() surface this when the named collection is absent, and raw 404s from wrong URLs also map here.
Source
Thrown at clients/new-js/packages/chromadb/src/chroma-fetch.ts:82
case 400:
let status = "Bad Request";
try {
const responseBody = await response.json();
status = responseBody.message || status;
} catch {}
throw new ChromaClientError(
`Bad request to ${
(input as Request).url || "Chroma"
} with status: ${status}`,
);
case 401:
throw new ChromaUnauthorizedError(`Unauthorized`);
case 403:
throw new ChromaForbiddenError(
`You do not have permission to access the requested resource.`,
);
case 404:
throw new ChromaNotFoundError(
`The requested resource could not be found`,
);
case 409:
const conflictBody = await getErrorBody(response);
if (
conflictBody.error === "ConditionalWriteConflictError" ||
conflictBody.message === "conditional write conflict"
) {
throw new ChromaConditionalWriteConflictError(
conflictBody.message || "conditional write conflict",
);
}
throw new ChromaUniqueError(
conflictBody.message || "The resource already exists",
);
case 412:
const preconditionBody = await getErrorBody(response);
if (preconditionBody.error === "StaleReadError") {View on GitHub (pinned to aecdd12c8a)
Solutions
- List existing collections (await client.listCollections()) and compare names/IDs before operating.
- If the collection should exist, create it (getOrCreateCollection) or fix the name/ID typo.
- Verify the tenant/database in the client config actually exist for your key.
- Align client and server versions if the 404 comes from a missing API route.
Example fix
// before
const col = await client.getCollection({ name: "prod-data" }); // 404 if never created
// after
const col = await client.getOrCreateCollection({ name: "prod-data", embeddingFunction }); Defensive patterns
Strategy: validation
Validate before calling
const names = new Set((await client.listCollections()).map(c => c.name));
if (!names.has("docs")) {
await client.createCollection({ name: "docs", embeddingFunction });
} Try / catch
try {
return await client.getCollection({ name });
} catch (e) {
if (e instanceof ChromaNotFoundError) {
return await client.createCollection({ name, embeddingFunction }); // or return null
}
throw e;
} Prevention
- Prefer getOrCreateCollection() for idempotent provisioning.
- Re-check existence after environment resets (test teardown, DB recreation).
- Handle ChromaNotFoundError explicitly where a missing collection is expected.
When it happens
Trigger: Calling collection operations on a deleted or never-created collection name/ID; targeting a non-existent tenant or database in the path; hitting an API route that does not exist because the server is older than the client expects.
Common situations: Collections deleted by another process or teammate between list and use; fresh environments where seed collections were never created; typos in collection names; version skew exposing missing routes.
Related errors
- Could not connect to tenant ${tenant}. Are you sure it exist
- Could not connect to database ${database} for tenant ${tenan
- The resource already exists
- Collection {name} does not exist.
- Component not running
AI-assisted analysis of chroma-core/chroma@aecdd12c8a (2026-08-16).
Data as JSON: /api/errors/d7f07fd2925e46e0.
Report an issue: GitHub.