XX-net/XX-Net · critical

get README fail:

Error message

get README fail:

What it means

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.

Source

Thrown at code/default/launcher/setup.py:73

        try:
            fd = open(readme_file, "r")
            lines = fd.readlines()
            p = re.compile(r'https://codeload.github.com/XX-net/XX-Net/zip/([0-9]+)\.([0-9]+)\.([0-9]+)')
            for line in lines:
                m = p.match(line)
                if m:
                    version = m.group(1) + "." + m.group(2) + "." + m.group(3)
                    return m.group(0), version
        except Exception as e:
            xlog.exception("get version fail:%s", e)
        raise "get_version_fail:" % readme_file

    readme_url = "https://raw.githubusercontent.com/XX-net/XX-Net/master/README.md"
    readme_targe = os.path.join(download_path, "README.md")
    if not os.path.isdir(download_path):
        os.mkdir(download_path)
    if not download_file(readme_url, readme_targe):
        raise "get README fail:" + readme_url
    xxnet_url, xxnet_version = get_xxnet_url_version(readme_targe)
    xxnet_unzip_path = os.path.join(download_path, "XX-Net-%s" % xxnet_version)
    xxnet_zip_file = os.path.join(download_path, "XX-Net-%s.zip" % xxnet_version)

    if not download_file(xxnet_url, xxnet_zip_file):
        raise "download xxnet zip fail:" + download_path

    with zipfile.ZipFile(xxnet_zip_file, "r") as dz:
        dz.extractall(download_path)
        dz.close()


def install_xxnet_files():
    def sha1_file(filename):
        import hashlib

        BLOCKSIZE = 65536
        hasher = hashlib.sha1()

View on GitHub (pinned to cfa5bc17b6)

Solutions

  1. Ensure network access / set proxy environment variables (HTTP_PROXY/HTTPS_PROXY) before running the launcher
  2. Retry the download (transient failures are common)
  3. Download README.md manually to the expected path and re-run setup
  4. Replace the string raise with a proper exception (RuntimeError) so the failure is debuggable

Example fix

# before
if not download_file(readme_url, readme_targe):
    raise "get README fail:" + readme_url

# after
if not download_file(readme_url, readme_targe):
    raise RuntimeError("get README fail:" + readme_url)
Defensive patterns

Strategy: retry

Validate before calling

import socket
socket.create_connection(('raw.githubusercontent.com', 443), timeout=5)  # reachability precheck

Try / catch

for attempt in range(3):
    if download_file(readme_url, readme_targe):
        break
    time.sleep(2 ** attempt)
else:
    raise RuntimeError('get README fail:' + readme_url)

Prevention

When it happens

Trigger: First-run bootstrap on a machine that cannot reach raw.githubusercontent.com (blocked, proxied, DNS failure), so download_file returns False.

Common situations: Environments where GitHub raw content is firewalled (notably the target users of this tool), corporate proxies requiring auth, or transient network failures during setup.

Related errors


AI-assisted analysis of XX-net/XX-Net@cfa5bc17b6 (2026-08-27). Data as JSON: /api/errors/db14b7046bba8b07. Report an issue: GitHub.