{"record":{"id":"b6a721ae4b389c45","repo":"XX-net/XX-Net","slug":"download-s-fail","errorCode":null,"errorMessage":"download %s fail","messagePattern":"download (.+?) fail","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"code/default/gae_proxy/local/download_gae_lib.py","lineNumber":97,"sourceCode":"\n                        chunk = req.read(chunk_len)\n                        if not chunk:\n                            break\n                        fp.write(chunk)\n                        downloaded += len(chunk)\n                        left -= len(chunk)\n\n            if downloaded != file_size:\n                xlog.warn(\"download size:%d, need size:%d, download fail.\", downloaded, file_size)\n                os.remove(filename)\n                continue\n            else:\n                xlog.info(\"download %s to %s success.\", org_url, filename)\n                return True\n        except Exception as e:\n            xlog.warn(\"download %s to %s fail:%r\", org_url, filename, e)\n            continue\n    xlog.warn(\"download %s fail\", org_url)\n\n\ndef download_unzip(url, extract_path):\n    if os.path.isdir(extract_path):\n        return True\n\n    data_root = os.path.join(top_path, 'data')\n    download_path = os.path.join(data_root, 'downloads')\n    if not os.path.isdir(download_path):\n        os.mkdir(download_path)\n\n    fn = url.split(\"/\")[-1]\n    dfn = os.path.join(download_path, fn)\n\n    if not download_file(url, dfn):\n        xlog.warn(\"download file %s fail.\", url)\n        return\n","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/XX-net/XX-Net/blob/cfa5bc17b67676e467f37ec50766127e0ab5f0aa/code/default/gae_proxy/local/download_gae_lib.py#L79-L115","documentation":"Final warning after download_file exhausts all retry attempts for a URL; the function returns falsy and the caller (download_unzip) aborts. This is the terminal signal that the library archive could not be fetched.","triggerScenarios":"Every retry attempt raised an exception or produced a short download; the loop finishes and this line logs the URL that failed.","commonSituations":"Machine fully offline at first run, proxy misconfigured so all outbound HTTPS fails, the host serving the lib files is blocked or moved.","solutions":["Verify internet/proxy connectivity (the XX-Net proxy must itself be able to reach the web)","Retry later / on a stable network","Manually download the file and unzip it into the expected directory","Check firewall/antivirus blocking python.exe outbound"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"import os\nif not os.path.isdir(extract_path):  # pre-place libs to skip download entirely\n    raise SystemExit('libs missing and download unavailable — install manually')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pre-install lib archives so the isdir() check short-circuits downloads","Have a manual download fallback documented for offline machines"],"tags":["download","retries-exhausted","network"],"backgroundTag":"download-retries-exhausted","analyzedSha":"cfa5bc17b67676e467f37ec50766127e0ab5f0aa","analyzedAt":"2026-08-27T19:28:28.225Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}