{"record":{"id":"5d61679e6426bf39","repo":"XX-net/XX-Net","slug":"get-version-fail-s","errorCode":null,"errorMessage":"get_version_fail:%s","messagePattern":"get_version_fail:(.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"code/default/launcher/update_from_github.py","lineNumber":177,"sourceCode":"def parse_update_versions(readme_file):\n    versions = []\n    try:\n        fd = open(readme_file, \"rb\")\n        lines = fd.readlines()\n        p = re.compile(br'https://codeload.github.com/XX-net/XX-Net/zip/([0-9]+)\\.([0-9]+)\\.([0-9]+) ([0-9a-fA-F]*)')\n        for line in lines:\n            m = p.match(line)\n            if m:\n                version = m.group(1) + b\".\" + m.group(2) + b\".\" + m.group(3)\n                hashsum = m.group(4).lower()\n                versions.append([m.group(0), version, hashsum])\n                versions = utils.to_str(versions)\n                if len(versions) == 2:\n                    return versions\n    except Exception as e:\n        xlog.exception(\"xxnet_version fail:%r\", e)\n\n    raise Exception(\"get_version_fail:%s\" % readme_file)\n\n\ndef current_version():\n    readme_file = os.path.join(root_path, \"version.txt\")\n    try:\n        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","sourceCodeStart":159,"sourceCodeEnd":195,"githubUrl":"https://github.com/XX-net/XX-Net/blob/cfa5bc17b67676e467f37ec50766127e0ab5f0aa/code/default/launcher/update_from_github.py#L159-L195","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Delete the cached version.txt (in the download path) and retry the update","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","Update XX-Net manually if the manifest format changed in the repo","Check disk space and permissions on the download directory"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import os, json\ndef valid_manifest(path):\n    if not os.path.exists(path) or os.path.getsize(path) == 0:\n        return False\n    try:\n        v = json.load(open(path))\n        return isinstance(v, list) and len(v) == 2\n    except Exception:\n        return False","typeGuard":null,"tryCatchPattern":"try:\n    versions = get_github_versions()\nexcept Exception as e:\n    if 'get_version_fail' in str(e):\n        os.remove(os.path.join(download_path, 'version.txt'))  # clear bad cache\n        versions = get_github_versions()\n    else:\n        raise","preventionTips":["Inspect the manifest file content before parsing when debugging updates","Clear stale/partial version.txt between update attempts","Guard against HTML error pages saved as the manifest"],"tags":["launcher","update","parse-error","manifest"],"backgroundTag":"config-parse-failed","analyzedSha":"cfa5bc17b67676e467f37ec50766127e0ab5f0aa","analyzedAt":"2026-08-27T19:28:28.225Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}