{"record":{"id":"30f0a1504bb5c855","repo":"XX-net/XX-Net","slug":"get-update-file-s-fail","errorCode":null,"errorMessage":"get update file %s fail:","messagePattern":"get update file (.+?) fail:","errorType":"exception","errorClass":"IOError","httpStatus":null,"severity":"error","filePath":"code/default/launcher/update_from_github.py","lineNumber":201,"sourceCode":"        with open(readme_file) as fd:\n            content = fd.read()\n            p = re.compile(r'([0-9]+)\\.([0-9]+)\\.([0-9]+)')\n            m = p.match(content)\n            if m:\n                version = m.group(1) + \".\" + m.group(2) + \".\" + m.group(3)\n                return version\n    except:\n        xlog.warn(\"get_version_fail in update_from_github\")\n\n    return \"get_version_fail\"\n\n\ndef get_github_versions():\n    readme_url = \"https://raw.githubusercontent.com/XX-net/XX-Net/master/code/default/update_v5.txt\"\n    readme_target = os.path.join(download_path, \"version.txt\")\n\n    if not download_file(readme_url, readme_target):\n        raise IOError(\"get update file %s fail:\" % readme_url)\n\n    versions = parse_update_versions(readme_target)\n    return versions\n\n\ndef get_hash_sum(version):\n    versions = get_github_versions()\n    for v in versions:\n        if v[1] == version:\n            return v[2]\n\n\ndef hash_file_sum(filename):\n    import hashlib\n\n    BLOCKSIZE = 65536\n    hasher = hashlib.sha256()\n    try:","sourceCodeStart":183,"sourceCodeEnd":219,"githubUrl":"https://github.com/XX-net/XX-Net/blob/cfa5bc17b67676e467f37ec50766127e0ab5f0aa/code/default/launcher/update_from_github.py#L183-L219","documentation":"IOError raised by get_github_versions when download_file returns falsy for the update manifest URL (https://raw.githubusercontent.com/XX-net/XX-Net/master/code/default/update_v5.txt). Unlike the timeout exception, download_file swallows its own errors and returns False, so this IOError is the surfaced failure for any download problem (network, HTTP error, DNS).","triggerScenarios":"check_update / get_hash_sum / req_update_handler invoking get_github_versions while raw.githubusercontent.com is unreachable, blocked, or returns non-200.","commonSituations":"raw.githubusercontent.com blocked by GFW/DNS poisoning, offline machine, corporate proxy blocking GitHub, transient GitHub outage.","solutions":["Test access: curl the manifest URL; if blocked, configure a proxy in launcher settings or fix DNS","Retry later — GitHub raw access is frequently intermittent in restricted regions","Update manually (download release zip from GitHub mirrors) if auto-update consistently fails","Flush DNS / switch to a DNS resolver that answers correctly for raw.githubusercontent.com"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"import urllib.request\ntry:\n    urllib.request.urlopen('https://raw.githubusercontent.com/XX-net/XX-Net/master/code/default/update_v5.txt', timeout=10)\nexcept Exception:\n    raise RuntimeError('GitHub raw unreachable; configure proxy before updating')","typeGuard":null,"tryCatchPattern":"try:\n    versions = get_github_versions()\nexcept IOError as e:\n    if 'get update file' in str(e):\n        time.sleep(120)  # GitHub raw often intermittently blocked\n        versions = get_github_versions()\n    else:\n        raise","preventionTips":["Pre-check connectivity to raw.githubusercontent.com before enabling auto-update","Set a system/launcher proxy for GitHub in restricted regions","Update manually from release zips when auto-update persistently fails"],"tags":["launcher","update","github","download-failed"],"backgroundTag":"download-failed","analyzedSha":"cfa5bc17b67676e467f37ec50766127e0ab5f0aa","analyzedAt":"2026-08-27T19:28:28.225Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}