Mintplex-Labs/anything-llm · error · Error
${res.status} - ${res.statusText}. params: ${JSON.stringify(
Error message
${res.status} - ${res.statusText}. params: ${JSON.stringify({ auth: this.middleTruncate(process.env.AGENT_CRW_API_KEY, 5), q: query })} What it means
Thrown by the fastCRW search integration when the POST to `${baseUrl}/v1/search` returns a non-2xx HTTP status. The promise chain checks `res.ok` and, on failure, throws an Error embedding `res.status`, `res.statusText`, a middle-truncated `AGENT_CRW_API_KEY` (so an operator can match a key without leaking it), and the query. fastCRW is an internal/hosted search backend authenticated via a Bearer token.
Source
Thrown at server/utils/agents/aibitat/plugins/web-browsing.js:1297
baseUrl = baseUrl.toString();
} catch (e) {
this.super.handlerProps.log(
`invalid fastCRW Search URL: ${e.message}`
);
}
}
const { response, error } = await fetch(`${baseUrl}/v1/search`, {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${process.env.AGENT_CRW_API_KEY}`,
},
body: JSON.stringify({ query }),
})
.then((res) => {
if (res.ok) return res.json();
throw new Error(
`${res.status} - ${res.statusText}. params: ${JSON.stringify({ auth: this.middleTruncate(process.env.AGENT_CRW_API_KEY, 5), q: query })}`
);
})
.then((data) => {
if (data?.success === false)
throw new Error(
data?.error || "fastCRW returned an unsuccessful response."
);
return { response: data, error: null };
})
.catch((e) => {
this.super.handlerProps.log(
`fastCRW Search Error: ${e.message}`
);
return { response: null, error: e.message };
});
if (error)View on GitHub (pinned to 526360e320)
Solutions
- Read the status code in the message and the truncated key — confirm the key in your env matches a valid fastCRW credential.
- If 401/403, rotate or re-issue AGENT_CRW_API_KEY with the fastCRW provider.
- If 429, back off and let the agent's outer loop retry (this error is caught by the surrounding .catch and surfaced to the LLM as a soft failure).
- Verify the fastCRW base URL is reachable and is actually a fastCRW /v1/search endpoint (curl the POST with the same Bearer token).
- If 5xx, check the fastCRW service health/dashboard before retrying.
Defensive patterns
Strategy: try-catch
Validate before calling
// Before calling fastCRW, confirm the env is wired.
function assertFastCrwEnv() {
if (!process.env.AGENT_CRW_API_KEY)
throw new Error('AGENT_CRW_API_KEY is not set; fastCRW search will return 401.');
if (!process.env.AGENT_CRW_BASE_URL && !defaultBaseUrl)
throw new Error('fastCRW base URL is not configured.');
}
// call assertFastCrwEnv() before the fetch at web-browsing.js:1287 Try / catch
// The surrounding .catch already converts the throw to a soft result.
// Keep the {response, error} shape so callers never see a raw exception:
const { response, error } = await fetch(url, opts)
.then(res => res.ok ? res.json() : Promise.reject(new Error(`${res.status} ${res.statusText}`)))
.then(data => ({ response: data, error: null }))
.catch(e => ({ response: null, error: e.message }));
if (error) return `There was an error searching for content. ${error}`; Prevention
- Validate AGENT_CRW_API_KEY and the CRW base URL at server boot, not only when the agent first searches.
- Never log the full API key — keep the middleTruncate pattern that is already in the message.
- Treat 429 as transient: let the agent retry the search rather than failing the whole turn.
- Run a smoke-test search against fastCRW in your health check.
When it happens
Trigger: fastCRW returns 401 (AGENT_CRW_API_KEY missing/wrong), 403 (key lacks scope), 404 (baseUrl points at a host with no /v1/search), 429 (rate limit), or 5xx (fastCRW service degraded). Only fires when `res.ok === false` — a 200 with a failed body is a different error (421).
Common situations: AGENT_CRW_API_KEY env var unset or expired between deploys; the CRW base URL misconfigured to point at a stale or wrong host; free/quota tier exceeded; a corporate proxy returns 407/502; fastCRW itself is mid-deploy.
Related errors
- ${res.status} - ${res.statusText}. params: ${JSON.stringify(
- Search failed.
- Cohere:getModelCapabilities - ${res.statusText}
- Catalog request failed with status ${response.status}
- data?.error || "fastCRW returned an unsuccessful response."
AI-assisted analysis of Mintplex-Labs/anything-llm@526360e320 (2026-08-13).
Data as JSON: /api/errors/0f2b3cb39a921d37.
Report an issue: GitHub.