{"record":{"id":"e3a52f659d5c1113","repo":"XX-net/XX-Net","slug":"download-file-s-fail","errorCode":null,"errorMessage":"download file %s fail.","messagePattern":"download file (.+?) fail\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"code/default/gae_proxy/local/download_gae_lib.py","lineNumber":113,"sourceCode":"            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\n    try:\n        os.mkdir(extract_path)\n        with zipfile.ZipFile(dfn, \"r\") as dz:\n            dz.extractall(extract_path)\n            dz.close()\n        xlog.info(\"Extract %s to %s success.\", fn, extract_path)\n    except Exception as e:\n        xlog.warn(\"unzip %s fail:%r\", dfn, e)\n        shutil.rmtree(extract_path)\n        raise e\n    os.remove(dfn)\n\n\ndef check_lib_or_download():\n    lib_path = os.path.abspath(os.path.join(current_path, os.pardir, \"server\", \"lib\"))\n","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/XX-net/XX-Net/blob/cfa5bc17b67676e467f37ec50766127e0ab5f0aa/code/default/gae_proxy/local/download_gae_lib.py#L95-L131","documentation":"download_unzip reports that its inner download_file call failed for the given archive URL, then returns without extracting. The GAE library (e.g. openssl/goagent libs) is therefore not installed.","triggerScenarios":"check_lib_or_download() -> download_unzip(url, extract_path) where download_file returns False (all retries exhausted).","commonSituations":"First launch without network, blocked download host, corporate proxy blocking the archive URL.","solutions":["Restore network/proxy connectivity and restart so check_lib_or_download runs again","Manually download the archive and extract it to extract_path so the isdir() check short-circuits","Check the preceding xlog lines for the underlying network error"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"import os\n# skip download when already extracted\ndone = os.path.isdir(extract_path)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Vendor the required lib archives with your deployment","Monitor first-run connectivity before invoking check_lib_or_download"],"tags":["download","gae-proxy","setup"],"backgroundTag":"dependency-download-failed","analyzedSha":"cfa5bc17b67676e467f37ec50766127e0ab5f0aa","analyzedAt":"2026-08-27T19:28:28.225Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}