Mintplex-Labs/anything-llm · error · Error

data?.error || "fastCRW returned an unsuccessful response."

Error message

data?.error || "fastCRW returned an unsuccessful response."

What it means

Thrown when fastCRW returns HTTP 200 but the JSON body carries `{ success: false }`. fastCRW signals application-level failure inside a successful HTTP response, so the `res.ok` check at line 1297 does not catch it. The message is `data.error` when fastCRW supplied one, otherwise the literal "fastCRW returned an unsuccessful response."

Source

Thrown at server/utils/agents/aibitat/plugins/web-browsing.js:1303

            }

            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)
              return `There was an error searching for content. ${error}`;

            const data = [];
            response.data?.forEach((searchResult) => {
              const { title, url, description } = searchResult;
              data.push({

View on GitHub (pinned to 526360e320)

Solutions

  1. Read data.error from the log line (the surrounding .catch logs `fastCRW Search Error: ${e.message}`) — fastCRW usually states the cause.
  2. Retry once; success:false is frequently transient (index reload, brief backend failure).
  3. Simplify the query and retry to rule out query-shape rejection.
  4. Check the fastCRW service health endpoint or admin dashboard.
  5. If persistent, relay the data.error text to the fastCRW maintainer.
Defensive patterns

Strategy: retry

Validate before calling

// Reject empty / whitespace-only queries before they reach fastCRW.
function assertValidQuery(query) {
  if (typeof query !== 'string' || query.trim().length === 0)
    throw new Error('fastCRW search requires a non-empty query string.');
}

Type guard

// Narrow a fastCRW payload before trusting it.
function isFastCrwSuccess(data) {
  return data != null && typeof data === 'object' && data.success === true;
}

Try / catch

// Distinguish success:false from network failure so retry logic only fires for transient cases.
try {
  const data = await fetchFastCrw(query);
  if (data?.success === false) {
    if (isTransient(data?.error)) await backoffRetry();
    else throw new Error(data?.error || 'fastCRW returned an unsuccessful response.');
  }
} catch (e) { /* surface to the agent as a soft search failure */ }

Prevention

When it happens

Trigger: fastCRW accepted the request but its search backend failed: index unavailable or rebuilding, query rejected as empty/invalid, internal timeout, or an upstream content source unreachable. The 200 + success:false envelope is the fastCRW convention.

Common situations: fastCRW index swap during maintenance; empty or all-stopword query string; fastCRW version bump tightening its payload contract; transient backend hiccup that a retry would clear.

Related errors


AI-assisted analysis of Mintplex-Labs/anything-llm@526360e320 (2026-08-13). Data as JSON: /api/errors/3a70f4eb36806702. Report an issue: GitHub.