{"record":{"id":"e9bbe970ec332ee6","repo":"binary-husky/gpt_academic","slug":"searxng","errorCode":null,"errorMessage":"Searxng（在线搜索服务）当前使用人数太多，请稍后。","messagePattern":"Searxng（在线搜索服务）当前使用人数太多，请稍后。","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"warning","filePath":"crazy_functions/Internet_GPT.py","lineNumber":164,"sourceCode":"        'X-Forwarded-For': get_auth_ip(),\n        'X-Real-IP': get_auth_ip()\n    }\n    results = []\n    response = requests.post(url, params=params, headers=headers, proxies=proxies, timeout=30)\n    if response.status_code == 200:\n        json_result = response.json()\n        for result in json_result['results']:\n            item = {\n                \"title\": result.get(\"title\", \"\"),\n                \"source\": result.get(\"engines\", \"unknown\"),\n                \"content\": result.get(\"content\", \"\"),\n                \"link\": result[\"url\"],\n            }\n            results.append(item)\n        return results\n    else:\n        if response.status_code == 429:\n            raise ValueError(\"Searxng（在线搜索服务）当前使用人数太多，请稍后。\")\n        else:\n            raise ValueError(\"在线搜索失败，状态码: \" + str(response.status_code) + '\\t' + response.content.decode('utf-8'))\n\n\ndef scrape_text(url, proxies) -> str:\n    \"\"\"Scrape text from a webpage\n\n    Args:\n        url (str): The URL to scrape text from\n\n    Returns:\n        str: The scraped text\n    \"\"\"\n    from loguru import logger\n    headers = {\n        'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.61 Safari/537.36',\n        'Content-Type': 'text/plain',\n    }","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/binary-husky/gpt_academic/blob/d6bde0fa54373309bd05823a49bda8da019d2c77/crazy_functions/Internet_GPT.py#L146-L182","documentation":"The SearxNG instance answered HTTP 429, which means the request was rate limited or blocked by its bot limiter. The client raises this localized ValueError instead of parsing the body.","triggerScenarios":"search_optimizer sends several optimized queries in quick succession, multiple users share SEARXNG_URLS, or the limiter associates requests with the same forged X-Forwarded-For/X-Real-IP produced by get_auth_ip().","commonSituations":"Using public SearxNG instances; running parallel agents; SearxNG limiter is enabled without trusting the client; all requests appear to come from one IP; search volume exceeds the instance's configured limit.","solutions":["Wait and retry with exponential backoff, or try another URL from SEARXNG_URLS.","Reduce the number of optimized queries and avoid parallel search plugins.","Use a self-hosted SearxNG instance and configure its limiter for this client.","Ensure the configured URL, proxy, and forwarded-header behavior match the deployment.","Monitor 429 frequency and adjust SearxNG's bot_detection settings or quotas."],"exampleFix":"# before\nresponse = requests.post(url, params=params, headers=headers, proxies=proxies, timeout=30)\nif response.status_code == 429:\n    raise ValueError(\"Searxng（在线搜索服务）当前使用人数太多，请稍后。\")\n\n# after\nfor attempt in range(3):\n    response = requests.post(url, params=params, headers=headers, proxies=proxies, timeout=30)\n    if response.status_code != 429:\n        break\n    time.sleep(2 ** attempt)\n","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    return searxng_request(query, proxies, categories)\nexcept ValueError as e:\n    if \"当前使用人数太多\" in str(e):\n        wait = min(30, 2 ** attempt)\n        time.sleep(wait)\n        return searxng_request(query, proxies, categories)\n    raise\n","preventionTips":["Stagger search requests instead of firing all optimized queries together.","Use a self-hosted or dedicated SearxNG instance for automation.","Rotate healthy SEARXNG_URLS only after a real 429.","Respect Retry-After when the instance supplies it."],"tags":["searxng","rate-limit","http-429","search"],"backgroundTag":null,"analyzedSha":"d6bde0fa54373309bd05823a49bda8da019d2c77","analyzedAt":"2026-08-14T22:48:35.038Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}