{"record":{"id":"401168210b0abb97","repo":"XX-net/XX-Net","slug":"set-version-s-not-exist","errorCode":null,"errorMessage":"set version %s not exist","messagePattern":"set version (.+?) not exist","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"code/default/launcher/update_from_github.py","lineNumber":365,"sourceCode":"\n\ndef del_version(version):\n    if version == get_current_version_dir():\n        xlog.warn(\"try to delect current version.\")\n        return False\n\n    try:\n        shutil.rmtree(os.path.join(top_path, \"code\", version))\n        return True\n    except Exception as e:\n        xlog.warn(\"deleting fail: %s\", e)\n        return False\n\n\ndef update_current_version(version):\n    start_script = os.path.join(top_path, \"code\", version, \"launcher\", \"start.py\")\n    if not os.path.isfile(start_script):\n        xlog.warn(\"set version %s not exist\", version)\n        return False\n\n    current_version_file = os.path.join(top_path, \"code\", \"version.txt\")\n    with open(current_version_file, \"w\") as fd:\n        fd.write(version)\n    return True\n\n\ndef restart_xxnet(version=None):\n    import module_init\n    module_init.stop_all()\n\n    import web_control\n    web_control.stop()\n    # New process will hold the listen port\n    # We should close all listen port before create new process\n    xlog.info(\"Close web control port.\")\n","sourceCodeStart":347,"sourceCodeEnd":383,"githubUrl":"https://github.com/XX-net/XX-Net/blob/cfa5bc17b67676e467f37ec50766127e0ab5f0aa/code/default/launcher/update_from_github.py#L347-L383","documentation":"update_current_version(version) verifies code/<version>/launcher/start.py exists before switching; if missing it logs this and returns False without touching version.txt.","triggerScenarios":"Switching to a version whose directory is incomplete (failed unzip/overwrite) or a typo'd version string with no matching directory under code/.","commonSituations":"Calling set-current after a partially failed update; version dir renamed or deleted manually; trailing whitespace in the version parameter.","solutions":["Check code/<version>/launcher/start.py actually exists on disk.","Re-run the download/update for that version to complete extraction.","Verify the exact version string (must equal the directory name under code/)."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import os\nassert os.path.isfile(os.path.join(top_path,'code',version,'launcher','start.py')), 'incomplete version dir'","typeGuard":"def version_complete(v):\n    return os.path.isfile(os.path.join(top_path,'code',v,'launcher','start.py'))","tryCatchPattern":null,"preventionTips":["Only switch to versions that fully downloaded and unzipped.","Use exact directory names from code/.","Re-run a failed update before switching versions."],"tags":["version-management","missing-file","update"],"backgroundTag":"version-directory-missing","analyzedSha":"cfa5bc17b67676e467f37ec50766127e0ab5f0aa","analyzedAt":"2026-08-27T19:28:28.225Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}