infiniflow/ragflow · error · ValueError

Querit urls must contain between 1 and 10 non-empty strings.

Error message

Querit urls must contain between 1 and 10 non-empty strings.

What it means

ValueError from _validate_contents_inputs() in the Querit contents tool. The 'urls' input must be a list of 1 to 10 non-empty strings after normalization (_normalize_contents_urls splits a comma-separated string). It fails when urls is not a list, is empty or has more than 10 entries, or any entry is a blank/non-string.

Source

Thrown at agent/tools/querit.py:374

def _build_contents_payload(urls: list[str], format: str, crawl_timeout: int, extras_meta: bool) -> dict[str, Any]:
    return {
        "urls": urls,
        "format": format,
        "crawlTimeout": crawl_timeout,
        "extrasMeta": extras_meta,
    }


def _normalize_contents_urls(urls: Any) -> Any:
    if isinstance(urls, str):
        return [url.strip() for url in urls.split(",") if url.strip()]
    return urls


def _validate_contents_inputs(urls: Any, format: Any, crawl_timeout: Any, extras_meta: Any) -> None:
    if not isinstance(urls, list) or not 1 <= len(urls) <= 10 or any(not isinstance(url, str) or not url.strip() for url in urls):
        raise ValueError("Querit urls must contain between 1 and 10 non-empty strings.")
    for url in urls:
        parsed = urlparse(url)
        if parsed.scheme not in {"http", "https"} or not parsed.netloc:
            raise ValueError("Querit urls must be absolute HTTP or HTTPS URLs.")
    if format not in QUERIT_CONTENT_FORMATS:
        raise ValueError("Querit format must be text, markdown, or html.")
    if type(crawl_timeout) is not int or not 1 <= crawl_timeout <= 60:
        raise ValueError("Querit crawl_timeout must be an integer from 1 to 60.")
    if type(extras_meta) is not bool:
        raise ValueError("Querit extras_meta must be a boolean.")


def _validate_contents_response(response_data: Any) -> None:
    if not isinstance(response_data, dict):
        raise TypeError("Querit API response must be a JSON object.")
    if "results" in response_data and not isinstance(response_data["results"], list):
        raise TypeError("Querit API response field results must be an array.")
    if "statuses" in response_data and not isinstance(response_data["statuses"], list):

View on GitHub (pinned to 554fb1133a)

Solutions

  1. Pass urls as a comma-separated string or a JSON array with 1-10 entries, each an absolute non-empty URL.
  2. Trim whitespace and drop empty elements before invoking (a CSV input 'a.com, ,b.com' becomes ['a.com','b.com'] only if you strip blanks yourself first).
  3. Split batches larger than 10 into multiple calls.
  4. If urls comes from an upstream component, add a non-empty guard before wiring it to Querit contents.

Example fix

# before
urls = ["https://a.com", "", " "]  # 2 blank entries -> ValueError

# after
urls = [u.strip() for u in url_string.split(",") if u.strip()][:10]
Defensive patterns

Strategy: validation

Validate before calling

from typing import Any
def normalize_querit_urls(urls: Any) -> list[str]:
    if isinstance(urls, str):
        urls = [u.strip() for u in urls.split(",") if u.strip()]
    assert isinstance(urls, list) and 1 <= len(urls) <= 10, "need 1-10 urls"
    return [u for u in urls if isinstance(u, str) and u.strip()]

Type guard

def is_valid_querit_urls(v: Any) -> bool:
    return (
        isinstance(v, list)
        and 1 <= len(v) <= 10
        and all(isinstance(u, str) and u.strip() for u in v)
    )

Try / catch

try:
    querit_contents._invoke(urls=urls)
except ValueError as e:
    if "between 1 and 10" in str(e):
        urls = normalize_querit_urls(urls)
        querit_contents._invoke(urls=urls)
    raise

Prevention

When it happens

Trigger: Invoking Querit contents with urls=[], urls containing 11 entries, an entry of '' or whitespace, urls passed as a raw number/None from workflow parameter binding, or a comma string like ', ,' that normalizes to an empty list.

Common situations: LLM-generated component inputs that emit an empty array when unsure; upstream node producing null urls; users pasting newline-separated URLs where the input form produced a single string without commas; exceeding the 10-URL batch cap.

Related errors


AI-assisted analysis of infiniflow/ragflow@554fb1133a (2026-08-15). Data as JSON: /api/errors/2f96c7349e0224f4. Report an issue: GitHub.