XX-net/XX-Net · error · Exception

get_version_fail:%s

Error message

get_version_fail:%s

What it means

Raised by parse_update_versions when it cannot read the downloaded version manifest and extract a 2-element version list. The outer except logs 'xxnet_version fail' and rethrows with the manifest path. Causes include missing/unreadable file, JSON/parse failure, or wrong content shape.

Source

Thrown at code/default/launcher/update_from_github.py:177

def parse_update_versions(readme_file):
    versions = []
    try:
        fd = open(readme_file, "rb")
        lines = fd.readlines()
        p = re.compile(br'https://codeload.github.com/XX-net/XX-Net/zip/([0-9]+)\.([0-9]+)\.([0-9]+) ([0-9a-fA-F]*)')
        for line in lines:
            m = p.match(line)
            if m:
                version = m.group(1) + b"." + m.group(2) + b"." + m.group(3)
                hashsum = m.group(4).lower()
                versions.append([m.group(0), version, hashsum])
                versions = utils.to_str(versions)
                if len(versions) == 2:
                    return versions
    except Exception as e:
        xlog.exception("xxnet_version fail:%r", e)

    raise Exception("get_version_fail:%s" % readme_file)


def current_version():
    readme_file = os.path.join(root_path, "version.txt")
    try:
        with open(readme_file) as fd:
            content = fd.read()
            p = re.compile(r'([0-9]+)\.([0-9]+)\.([0-9]+)')
            m = p.match(content)
            if m:
                version = m.group(1) + "." + m.group(2) + "." + m.group(3)
                return version
    except:
        xlog.warn("get_version_fail in update_from_github")

    return "get_version_fail"

View on GitHub (pinned to cfa5bc17b6)

Solutions

  1. Delete the cached version.txt (in the download path) and retry the update
  2. Open the manifest file and verify it contains the expected two version strings; if it's an HTML error page, GitHub access is being intercepted
  3. Update XX-Net manually if the manifest format changed in the repo
  4. Check disk space and permissions on the download directory
Defensive patterns

Strategy: validation

Validate before calling

import os, json
def valid_manifest(path):
    if not os.path.exists(path) or os.path.getsize(path) == 0:
        return False
    try:
        v = json.load(open(path))
        return isinstance(v, list) and len(v) == 2
    except Exception:
        return False

Try / catch

try:
    versions = get_github_versions()
except Exception as e:
    if 'get_version_fail' in str(e):
        os.remove(os.path.join(download_path, 'version.txt'))  # clear bad cache
        versions = get_github_versions()
    else:
        raise

Prevention

When it happens

Trigger: Calling get_github_versions -> parse_update_versions(path) when version.txt doesn't exist, was truncated (e.g. download timed out mid-file), or its content doesn't contain the expected 2-string array.

Common situations: Corrupted or partial download of update_v5.txt, GitHub serving an error page into the file, manifest format changed in a newer repo layout, disk full.

Related errors


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