Mintplex-Labs/anything-llm · error

fetchError

Error message

fetchError

What it means

Forwarded upstream failure from the communityHubItem middleware: it awaits CommunityHub.getBundleItem(importId) and, when the result carries an error, returns HTTP 500 with that error text verbatim. The forwarded message distinguishes an unknown/invalid importId from a connectivity failure to the AnythingLLM hub, so the exact string matters for diagnosis.

Source

Thrown at server/utils/middleware/communityHubDownloadsEnabled.js:64

/**
 * Fetch the bundle item from the community hub.
 * Sets `response.locals.bundleItem` and `response.locals.bundleUrl`.
 */
async function communityHubItem(request, response, next) {
  const { importId } = reqBody(request);
  if (!importId)
    return response.status(500).json({
      success: false,
      error: "Import ID is required",
    });

  const {
    url,
    item,
    error: fetchError,
  } = await CommunityHub.getBundleItem(importId);
  if (fetchError)
    return response.status(500).json({
      success: false,
      error: fetchError,
    });

  response.locals.bundleItem = item;
  response.locals.bundleUrl = url;
  next();
}

module.exports = {
  communityHubItem,
  communityHubDownloadsEnabled,
};

View on GitHub (pinned to 3aec848f28)

Solutions

  1. Read the forwarded error text: 'not found'-style wording means bad importId, network wording means egress problem
  2. Re-copy the importId from the hub item page and retry
  3. Verify outbound connectivity from the container: curl -sS https://hub.anythingllm.com (or the configured hub host) and check proxy/DNS/firewall rules
  4. Retry after a wait if the hub itself is having an outage
Defensive patterns

Strategy: retry

Validate before calling

// pre-flight egress check before first hub import
class NotFound extends Error {}
// nothing caller-side can fully prevent an upstream 5xx — validate id + connectivity instead:
if (!/^[a-z0-9-]+$/i.test(importId)) throw new Error('Suspicious importId format');

Try / catch

for (let i = 0; i < 3; i++) {
  const res = await postImport(importId);
  if (res.ok) break;
  const { error } = await res.json();
  if (/not found|invalid/i.test(String(error))) throw new Error('Bad importId — do not retry');
  await backoff(i); // transient hub/network failure -> retry with jitter
}

Prevention

When it happens

Trigger: Calling a hub import route when the instance cannot reach the hub endpoint (outbound HTTPS blocked, DNS failure, corporate proxy), when the hub returns 5xx, or when the importId does not correspond to a real item.

Common situations: Self-hosted instance behind an egress firewall that whitelists only LLM providers; mistyped importId; hub temporarily degraded; TLS interception proxy rejecting the hub certificate.

Related errors


AI-assisted analysis of Mintplex-Labs/anything-llm@3aec848f28 (2026-08-18). Data as JSON: /api/errors/a3e2e679956a4f94. Report an issue: GitHub.