{"record":{"id":"db14b7046bba8b07","repo":"XX-net/XX-Net","slug":"get-readme-fail","errorCode":null,"errorMessage":"get README fail:","messagePattern":"get README fail:","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"code/default/launcher/setup.py","lineNumber":73,"sourceCode":"        try:\n            fd = open(readme_file, \"r\")\n            lines = fd.readlines()\n            p = re.compile(r'https://codeload.github.com/XX-net/XX-Net/zip/([0-9]+)\\.([0-9]+)\\.([0-9]+)')\n            for line in lines:\n                m = p.match(line)\n                if m:\n                    version = m.group(1) + \".\" + m.group(2) + \".\" + m.group(3)\n                    return m.group(0), version\n        except Exception as e:\n            xlog.exception(\"get version fail:%s\", e)\n        raise \"get_version_fail:\" % readme_file\n\n    readme_url = \"https://raw.githubusercontent.com/XX-net/XX-Net/master/README.md\"\n    readme_targe = os.path.join(download_path, \"README.md\")\n    if not os.path.isdir(download_path):\n        os.mkdir(download_path)\n    if not download_file(readme_url, readme_targe):\n        raise \"get README fail:\" + readme_url\n    xxnet_url, xxnet_version = get_xxnet_url_version(readme_targe)\n    xxnet_unzip_path = os.path.join(download_path, \"XX-Net-%s\" % xxnet_version)\n    xxnet_zip_file = os.path.join(download_path, \"XX-Net-%s.zip\" % xxnet_version)\n\n    if not download_file(xxnet_url, xxnet_zip_file):\n        raise \"download xxnet zip fail:\" + download_path\n\n    with zipfile.ZipFile(xxnet_zip_file, \"r\") as dz:\n        dz.extractall(download_path)\n        dz.close()\n\n\ndef install_xxnet_files():\n    def sha1_file(filename):\n        import hashlib\n\n        BLOCKSIZE = 65536\n        hasher = hashlib.sha1()","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/XX-net/XX-Net/blob/cfa5bc17b67676e467f37ec50766127e0ab5f0aa/code/default/launcher/setup.py#L55-L91","documentation":"In get_XXNet (launcher bootstrap), downloading https://raw.githubusercontent.com/XX-net/XX-Net/master/README.md failed (download_file returned falsy), and the code does `raise \"get README fail:\" + readme_url` — raising a string, which is itself a TypeError on Python 3. Root cause: no network access to raw.githubusercontent.com.","triggerScenarios":"First-run bootstrap on a machine that cannot reach raw.githubusercontent.com (blocked, proxied, DNS failure), so download_file returns False.","commonSituations":"Environments where GitHub raw content is firewalled (notably the target users of this tool), corporate proxies requiring auth, or transient network failures during setup.","solutions":["Ensure network access / set proxy environment variables (HTTP_PROXY/HTTPS_PROXY) before running the launcher","Retry the download (transient failures are common)","Download README.md manually to the expected path and re-run setup","Replace the string raise with a proper exception (RuntimeError) so the failure is debuggable"],"exampleFix":"# before\nif not download_file(readme_url, readme_targe):\n    raise \"get README fail:\" + readme_url\n\n# after\nif not download_file(readme_url, readme_targe):\n    raise RuntimeError(\"get README fail:\" + readme_url)","handlingStrategy":"retry","validationCode":"import socket\nsocket.create_connection(('raw.githubusercontent.com', 443), timeout=5)  # reachability precheck","typeGuard":null,"tryCatchPattern":"for attempt in range(3):\n    if download_file(readme_url, readme_targe):\n        break\n    time.sleep(2 ** attempt)\nelse:\n    raise RuntimeError('get README fail:' + readme_url)","preventionTips":["Set HTTP(S)_PROXY for restricted networks before bootstrap","Verify HTTP 200 and content before saving downloads","Cache a known-good README/release URL locally"],"tags":["download","network","launcher","bootstrap","python3"],"backgroundTag":"download-failed","analyzedSha":"cfa5bc17b67676e467f37ec50766127e0ab5f0aa","analyzedAt":"2026-08-27T19:28:28.225Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}