Mintplex-Labs/anything-llm · warning · Error

There was no content to be collected or read.

Error message

There was no content to be collected or read.

What it means

Thrown when the collector returned `{ success: true }` but `content` is null, undefined, or an empty string. Distinct from 423: the fetch itself succeeded, but no extractable text was produced. The throw is unconditional — there is no introspection line and no fallback — so the agent sees a hard failure with no diagnostic context.

Source

Thrown at server/utils/agents/aibitat/plugins/web-scraping.js:114

           */
          scrape: async function (url) {
            this.super.introspect(
              `${this.caller}: Scraping the content of ${url}`
            );
            const { success, content } =
              await new CollectorApi().getLinkContent(url);

            if (!success) {
              this.super.introspect(
                `${this.caller}: could not scrape ${url}. I can't use this page's content.`
              );
              throw new Error(
                `URL could not be scraped and no content was found.`
              );
            }

            if (!content || content?.length === 0) {
              throw new Error("There was no content to be collected or read.");
            }

            this.reportUrlCitation(url, content);
            const { TokenManager } = require("../../../helpers/tiktoken");
            const tokenEstimate = new TokenManager(
              this.super.model
            ).countFromString(content);
            if (
              tokenEstimate <
              Provider.contextLimit(this.super.provider, this.super.model)
            ) {
              this.super.introspect(
                `${this.caller}: Looking over the content of the page. ~${tokenEstimate} tokens.`
              );
              return content;
            }

            this.super.introspect(

View on GitHub (pinned to 526360e320)

Solutions

  1. Open the URL and confirm there is selectable, copyable text (not only media, canvas, or embedded apps).
  2. Try the printer-friendly or text-mode version of the page.
  3. If the content lives in a PDF or image, route the URL through a collector reader with OCR enabled.
  4. Inspect the collector's raw reader output for this URL to see what (if anything) it extracted before stripping.
  5. Let the agent fall back to the search snippet instead of attempting full page content.
Defensive patterns

Strategy: validation

Validate before calling

// Reject obviously non-text URLs before scraping.
const NON_TEXT_EXT = /\.(png|jpe?g|gif|svg|mp4|webm|mp3|wav|pdf|zip|exe|dmg)$/i;
function looksLikeTextUrl(url) {
  try { return !NON_TEXT_EXT.test(new URL(url).pathname); }
  catch { return false; }
}

Type guard

// Guarantee non-empty string content before continuing.
function hasReadableContent(content) {
  return typeof content === 'string' && content.trim().length > 0;
}

Try / catch

// Distinguish 'nothing extracted' from 'fetch failed' so the agent can pick a different source.
if (!success) throw new Error('URL could not be scraped and no content was found.');
if (!hasReadableContent(content)) {
  this.super.introspect(`${this.caller}: ${url} returned no extractable text; skipping.`);
  return null;
}

Prevention

When it happens

Trigger: Target page returned 200 with an empty body; page is an image/video/gallery with no text track; collector reader extracted only whitespace; page is a frameset or redirect shell with no real text; parser silently dropped the entire payload.

Common situations: Scraping a media gallery, a video page, or a raw file-download URL; scraping a canvas/WebGL-rendered page whose text the collector cannot read; reader post-processing stripped all boilerplate and left nothing; the URL serves HTML but text is injected client-side after the collector snapshots.

Related errors


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