{"record":{"id":"c0212485bd8cb56e","repo":"binary-husky/gpt_academic","slug":"error-c02124","errorCode":null,"errorMessage":"没有找到可用的镜像站点","messagePattern":"没有找到可用的镜像站点","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"crazy_functions/review_fns/data_sources/scihub_source.py","lineNumber":116,"sourceCode":"        for mirror in self.MIRRORS:\n            try:\n                test_response = requests.get(\n                    mirror,\n                    headers=self.headers,\n                    proxies=self.proxies,\n                    timeout=10\n                )\n                if test_response.status_code == 200:\n                    working_mirrors.append(mirror)\n                    logger.info(f\"镜像 {mirror} 可用\")\n                    if len(working_mirrors) >= 5:  # 找到5个可用镜像就够了\n                        break\n            except Exception as e:\n                logger.debug(f\"镜像 {mirror} 不可用: {str(e)}\")\n                continue\n\n        if not working_mirrors:\n            raise Exception(\"没有找到可用的镜像站点\")\n\n        logger.info(f\"找到 {len(working_mirrors)} 个可用镜像，开始尝试下载...\")\n\n        # 使用可用的镜像进行下载\n        for mirror in working_mirrors:\n            try:\n                res = requests.post(\n                    mirror,\n                    headers=self.headers,\n                    data=self.payload,\n                    proxies=self.proxies,\n                    timeout=self.timeout\n                )\n                if res.ok:\n                    logger.info(f\"成功使用镜像站点: {mirror}\")\n                    self.url = mirror  # 更新当前使用的镜像\n                    time.sleep(1)  # 降低等待时间以提高效率\n                    return res","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/binary-husky/gpt_academic/blob/d6bde0fa54373309bd05823a49bda8da019d2c77/crazy_functions/review_fns/data_sources/scihub_source.py#L98-L134","documentation":"SciHubSource probes its list of mirror URLs with a quick GET (10s timeout) and keeps those returning HTTP 200; if none pass, it raises Exception('没有找到可用的镜像站点'). This is an environment/network outcome — every known SciHub mirror is unreachable, blocked, or answering non-200 from the current host.","triggerScenarios":"Calling the SciHub download path when every mirror in the built-in list times out (10s), resolves to a dead domain, returns 403/captcha pages, or when the host has no internet egress to those domains. Proxies configured via self.proxies can also route probes into a block page.","commonSituations":"ISP/country-level blocking of scihub domains; mirrors rotating frequently so the hardcoded list is stale; corporate proxy or DNS filtering; running in CI/cloud sandboxes with restricted egress.","solutions":["Check basic connectivity: curl -I https://sci-hub.se (and the other mirrors) from the same host; if all are blocked, configure self.proxies with a working proxy.","Update the mirror list in scihub_source.py to currently-live domains (they change often).","If a proxy is already configured, verify it actually works for these domains — a broken proxy makes every probe fail.","As a fallback, obtain the paper through the arXiv/publisher source instead of SciHub."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"import requests\n\ndef any_mirror_reachable(mirrors, timeout=10, proxies=None) -> bool:\n    return any(\n        requests.get(m, timeout=timeout, proxies=proxies).status_code == 200\n        for m in mirrors\n    )","typeGuard":null,"tryCatchPattern":"try:\n    pdf = scihub.download(doi)\nexcept Exception as e:\n    if '没有找到可用的镜像站点' in str(e):\n        logger.warning('SciHub unreachable from this network; falling back to arXiv')\n        pdf = await arxiv_source.download_pdf(paper_id, dirpath)  # fallback path\n    else:\n        raise","preventionTips":["Provide and test a working proxy before enabling the SciHub source.","Keep the mirror list configurable so it can be refreshed without code changes.","Always implement an open-access fallback (arXiv/unpaywall) in download pipelines."],"tags":["scihub","network","mirrors","proxy","blocking"],"backgroundTag":null,"analyzedSha":"d6bde0fa54373309bd05823a49bda8da019d2c77","analyzedAt":"2026-08-14T22:48:35.038Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}