Mintplex-Labs/anything-llm · warning · Error
Could not find indexes.
Error message
Could not find indexes.
What it means
Thrown by System.totalIndexes when the GET to {fullApiUrl()}/system/system-vectors (optionally ?slug=...) returns non-2xx. It reads the vector database index count for a workspace or instance. The .catch() returns 0, so a failure is indistinguishable from a genuinely empty vector store.
Source
Thrown at frontend/src/models/system.js:29
supportEmail: "anythingllm_support_email",
customAppName: "anythingllm_custom_app_name",
canViewChatHistory: "anythingllm_can_view_chat_history",
deploymentVersion: "anythingllm_deployment_version",
},
ping: async function () {
return await fetch(`${API_BASE}/ping`)
.then((res) => res.json())
.then((res) => res?.online || false)
.catch(() => false);
},
totalIndexes: async function (slug = null) {
const url = new URL(`${fullApiUrl()}/system/system-vectors`);
if (!!slug) url.searchParams.append("slug", encodeURIComponent(slug));
return await fetch(url.toString(), {
headers: baseHeaders(),
})
.then((res) => {
if (!res.ok) throw new Error("Could not find indexes.");
return res.json();
})
.then((res) => res.vectorCount)
.catch(() => 0);
},
/**
* Checks if the onboarding is complete.
* @returns {Promise<boolean>}
*/
isOnboardingComplete: async function () {
return await fetch(`${API_BASE}/onboarding`)
.then((res) => {
if (!res.ok) throw new Error("Could not find onboarding information.");
return res.json();
})
.then((res) => res.onboardingComplete)
.catch(() => false);View on GitHub (pinned to 526360e320)
Solutions
- Check server logs for the /system/system-vectors handler, which surfaces the underlying vectorDB connection error.
- Verify VectorDatabase provider env vars are set and the embedding engine is selected in system settings.
- If passing a slug, confirm it matches a workspace returned by the workspaces listing endpoint.
- Distinguish a real 0 from an error by temporarily removing the .catch(() => 0) during debugging.
Example fix
// before
const count = await System.totalIndexes(slug); // 0 on error OR empty
// after (debug: let it throw to see the real cause)
const res = await fetch(`${fullApiUrl()}/system/system-vectors` + (slug ? `?slug=${encodeURIComponent(slug)}` : ""), { headers: baseHeaders() });
if (!res.ok) throw new Error(`vectors ${res.status}`);
const count = (await res.json()).vectorCount; Defensive patterns
Strategy: fallback
Validate before calling
// Validate slug shape if provided.
function validSlug(slug) {
return slug == null || (typeof slug === "string" && /^[\w-:]+$/.test(slug));
} Type guard
/** @param {any} n @returns {n is number} */
function isNonNegativeInt(n) { return Number.isInteger(n) && n >= 0; } Try / catch
const count = await System.totalIndexes(slug); const safe = isNonNegativeInt(count) ? count : 0; // 0 may be error OR empty
Prevention
- Do not assume 0 means empty — it may mean the request failed.
- For debugging, temporarily bypass the library catch to see the real error.
- Confirm vector DB provider env vars are set at deploy time.
When it happens
Trigger: Calling totalIndexes() or totalIndexes("my-workspace") when the vector database is unreachable/misconfigured (500), when the slug does not match any workspace, or when the auth token is rejected (401/403).
Common situations: Vector DB provider (Pinecone/Chroma/Qdrant/Weaviate) credentials are unset or wrong in env; the embedding engine is configured but the vector DB is not; the workspace slug was renamed and the stale slug is passed.
Related errors
- Failed to sync Confluence page content. ${reason}
- Failed to sync GitHub file content. ${reason}
- Failed to sync GitLab file content. ${reason}
- Failed to sync Gitea file content. ${reason}
- Failed to fetch document content
AI-assisted analysis of Mintplex-Labs/anything-llm@526360e320 (2026-08-13).
Data as JSON: /api/errors/c9623e9e192b5134.
Report an issue: GitHub.