Mintplex-Labs/anything-llm · error · Error
${message}
Error message
${message} What it means
Server-side validation echo. After the client-side guards pass, Workspace.update(slug, updateData) is called; if the API responds with a truthy message field (the server's rejection text), that message is rethrown verbatim and toasted. The thrown text is therefore whatever the backend said — not a fixed string.
Source
Thrown at frontend/src/components/WorkspaceChat/ChatContainer/PromptInput/LLMSelector/index.jsx:105
setHasChanges(false);
const isRouter = selectedLLMProvider === "anythingllm-router";
if (isRouter && !selectedRouterId)
throw new Error(t("model-router.chat.select-router-error"));
const updateData = isRouter
? { chatProvider: selectedLLMProvider, router_id: selectedRouterId }
: {
chatProvider: selectedLLMProvider,
chatModel: validatedModelSelection(selectedLLMModel),
};
if (!isRouter && !updateData.chatModel)
throw new Error(t("model-router.chat.invalid-model"));
const { message } = await Workspace.update(slug, updateData);
if (!!message) throw new Error(message);
window.dispatchEvent(new Event(SAVE_LLM_SELECTOR_EVENT));
} catch (error) {
console.error(error);
showToast(error.message, "error", { clear: true });
} finally {
setSaving(false);
}
}
const providerName =
WORKSPACE_LLM_PROVIDERS.find((p) => p.value === selectedLLMProvider)
?.name || selectedLLMProvider;
if (loading) {
return (
<div
id="llm-selector-modal"
className="w-full h-[388px] flex flex-col items-center justify-center gap-2"View on GitHub (pinned to 3aec848f28)
Solutions
- Read the toast — it contains the server's exact rejection reason
- Reload the page to refresh provider/model lists and retry with a currently valid selection
- Check the server logs for the corresponding workspace update failure
- Confirm the workspace still exists and your session is still authenticated
Defensive patterns
Strategy: try-catch
Validate before calling
const updateData = isRouter
? { chatProvider, router_id: selectedRouterId }
: { chatProvider, chatModel: validatedModelSelection(selectedLLMModel) };
if (!PROVIDER_IDS.includes(updateData.chatProvider)) throw new Error("Unknown provider — refresh and reselect"); Try / catch
const { message } = await Workspace.update(slug, updateData);
if (!!message) {
showToast(message, "error", { clear: true });
if (/not found|no longer/i.test(message)) refreshWorkspaceList();
return;
} Prevention
- Treat a truthful message field in the response as the server's rejection channel — always check it
- Keep frontend provider/model catalogs sourced from the server to avoid out-of-sync ids
- Re-fetch workspace state after failures instead of retrying stale payloads
When it happens
Trigger: chatProvider/chatModel pair rejected server-side (unsupported provider id, model not in the server's list, invalid router_id); workspace slug not found; DB update validation failure; session expiry causing an error-shaped response.
Common situations: Frontend provider list out of sync with backend after a partial upgrade; stale tab posting an old provider/model id; workspace deleted or renamed in another session; permission changes on the user.
Related errors
- Select a router
- Invalid model selection
- Failed to load available flows
- Invalid path name
- AnthropicLLM::getChatCompletion failed to communicate with A
AI-assisted analysis of Mintplex-Labs/anything-llm@3aec848f28 (2026-08-18).
Data as JSON: /api/errors/864c74957e2d345b.
Report an issue: GitHub.