{"record":{"id":"ba46d1f95cf89f6e","repo":"XX-net/XX-Net","slug":"download-s-fail-ba46d1","errorCode":null,"errorMessage":"download %s fail","messagePattern":"download (.+?) fail","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"code/default/launcher/update.py","lineNumber":186,"sourceCode":"    import os\n    global update_content, update_dict\n\n    current_path = os.path.dirname(os.path.abspath(__file__))\n    download_path = os.path.abspath(os.path.join(current_path, os.pardir, os.pardir, 'data', 'downloads'))\n    if not os.path.isdir(download_path):\n        os.mkdir(download_path)\n\n    try:\n        for source in update_dict[\"modules\"][module][\"versions\"][new_version][\"sources\"]:\n            url = source[\"url\"]\n            filename = module + \"-\" + new_version + \".zip\"\n\n            file_path = os.path.join(download_path, filename)\n\n            if os.path.isfile(file_path) and sha1_file(file_path) == update_dict[\"modules\"][module][\"versions\"][new_version][\"sha1\"]:\n                pass\n            elif not download_file(url, file_path):\n                xlog.warn(\"download %s fail\", url)\n                continue\n\n            sha1 = sha1_file(file_path)\n            if update_dict[\"modules\"][module][\"versions\"][new_version][\"sha1\"] != sha1:\n                xlog.warn(\"download %s sha1 wrong\", url)\n                continue\n\n            module_path = os.path.abspath(os.path.join(current_path, os.pardir, os.pardir, module))\n            if not os.path.isdir(module_path):\n                os.mkdir(module_path)\n\n            version_path = os.path.join(module_path, new_version)\n            if os.path.isdir(version_path):\n                xlog.error(\"module dir exist:%s, download exist.\", version_path)\n                return\n\n            with zipfile.ZipFile(file_path, \"r\") as dz:\n                dz.extractall(module_path)","sourceCodeStart":168,"sourceCodeEnd":204,"githubUrl":"https://github.com/XX-net/XX-Net/blob/cfa5bc17b67676e467f37ec50766127e0ab5f0aa/code/default/launcher/update.py#L168-L204","documentation":"While iterating module download URLs, download_file(url, file_path) returned False and the launcher logs 'download %s fail' and continues to the next candidate URL. This is a per-URL network failure, not fatal; other mirrors may still succeed.","triggerScenarios":"download_module calling download_file for a module URL when the request raises/times out or returns a non-200 status inside update_from_github.download_file, causing it to return False.","commonSituations":"One mirror unreachable (GFW blocking, server down, DNS failure, proxy misconfigured); the loop usually recovers via the next URL in the list.","solutions":["Check network/proxy connectivity: can you curl the logged URL?","Retry the update later — the downloader tries multiple mirrors and transient failures are common","Verify the launcher's own proxy settings are correct (a broken local proxy breaks update downloads)","If all URLs fail, inspect update_from_github.download_file logs for the underlying exception"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"def url_reachable(url, timeout=10):\n    import urllib.request\n    try:\n        urllib.request.urlopen(urllib.request.Request(url, method='HEAD'), timeout=timeout)\n        return True\n    except Exception:\n        return False","typeGuard":null,"tryCatchPattern":"for url in urls:\n    try:\n        download_file(url, path)\n        break\n    except Exception as e:\n        log.warning('download failed %s: %r', url, e)\n        continue","preventionTips":["Provide multiple mirror URLs (the downloader already continues to the next)","Check the local proxy before triggering updates","Retry updates on flaky networks instead of investigating immediately"],"tags":["network","download","update"],"backgroundTag":"download-failed","analyzedSha":"cfa5bc17b67676e467f37ec50766127e0ab5f0aa","analyzedAt":"2026-08-27T19:28:28.225Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}