{"record":{"id":"7446f994a0714152","repo":"infiniflow/ragflow","slug":"querit-crawl-timeout-must-be-an-integer-from-1-to","errorCode":null,"errorMessage":"Querit crawl_timeout must be an integer from 1 to 60.","messagePattern":"Querit crawl_timeout must be an integer from 1 to 60\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"agent/tools/querit.py","lineNumber":382,"sourceCode":"\n\ndef _normalize_contents_urls(urls: Any) -> Any:\n    if isinstance(urls, str):\n        return [url.strip() for url in urls.split(\",\") if url.strip()]\n    return urls\n\n\ndef _validate_contents_inputs(urls: Any, format: Any, crawl_timeout: Any, extras_meta: Any) -> None:\n    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):\n        raise ValueError(\"Querit urls must contain between 1 and 10 non-empty strings.\")\n    for url in urls:\n        parsed = urlparse(url)\n        if parsed.scheme not in {\"http\", \"https\"} or not parsed.netloc:\n            raise ValueError(\"Querit urls must be absolute HTTP or HTTPS URLs.\")\n    if format not in QUERIT_CONTENT_FORMATS:\n        raise ValueError(\"Querit format must be text, markdown, or html.\")\n    if type(crawl_timeout) is not int or not 1 <= crawl_timeout <= 60:\n        raise ValueError(\"Querit crawl_timeout must be an integer from 1 to 60.\")\n    if type(extras_meta) is not bool:\n        raise ValueError(\"Querit extras_meta must be a boolean.\")\n\n\ndef _validate_contents_response(response_data: Any) -> None:\n    if not isinstance(response_data, dict):\n        raise TypeError(\"Querit API response must be a JSON object.\")\n    if \"results\" in response_data and not isinstance(response_data[\"results\"], list):\n        raise TypeError(\"Querit API response field results must be an array.\")\n    if \"statuses\" in response_data and not isinstance(response_data[\"statuses\"], list):\n        raise TypeError(\"Querit API response field statuses must be an array.\")\n\n\ndef _validate_search_inputs(\n    count: Any,\n    chunks_per_doc: Any,\n    time_range: Any,\n    site_include: Any,","sourceCodeStart":364,"sourceCodeEnd":400,"githubUrl":"https://github.com/infiniflow/ragflow/blob/554fb1133ac3861732235ad9c377eb5e0a770665/agent/tools/querit.py#L364-L400","documentation":"ValueError from _validate_contents_inputs(): the crawl_timeout parameter must be an int (bools excluded, note the deliberate use of type() is int) between 1 and 60 seconds. Floats like 2.5, numeric strings like '30', booleans, or out-of-range values raise.","triggerScenarios":"crawl_timeout=2.5 (float from a slider/LLM), crawl_timeout=\"30\" (string from a form field), crawl_timeout=True (bool passes isinstance(int) but fails the strict type() check), crawl_timeout=0 or 90 (out of the 1..60 range).","commonSituations":"UI inputs returning strings; agent parameter interpolation producing '30' instead of 30; users copying a 120-second timeout from another crawler config; JSON configs where the value was written unquoted but as 30.0.","solutions":["Set crawl_timeout to an integer literal between 1 and 60 (e.g. 30).","Coerce in your caller: int(float(value)) then clamp to [1, 60] before invoking.","Remember True/False are rejected — pass real integers.","For slow sites, keep timeout <= 60 and handle pagination/fetch retries yourself."],"exampleFix":"# before\ncrawl_timeout = \"30\"  # str -> ValueError\n\n# after\ncrawl_timeout = int(float(\"30\"))\ncrawl_timeout = max(1, min(60, crawl_timeout))","handlingStrategy":"validation","validationCode":"def safe_crawl_timeout(v) -> int:\n    n = int(float(v)) if str(v).replace('.','',1).isdigit() else 30\n    return max(1, min(60, n))","typeGuard":"def is_valid_crawl_timeout(v) -> bool:\n    return type(v) is int and 1 <= v <= 60","tryCatchPattern":"try:\n    querit_contents._invoke(urls=urls, crawl_timeout=t)\nexcept ValueError as e:\n    if \"crawl_timeout\" in str(e):\n        t = 30; querit_contents._invoke(urls=urls, crawl_timeout=t)\n    raise","preventionTips":["Coerce form/env inputs with int() and clamp to 1..60 before the call.","Remember booleans and floats fail the strict type() check.","Use a UI numeric input with min=1 max=60 step=1."],"tags":["validation","input","querit","timeout"],"backgroundTag":null,"analyzedSha":"554fb1133ac3861732235ad9c377eb5e0a770665","analyzedAt":"2026-08-15T09:20:16.380Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}