XX-net/XX-Net · warning

set version %s not exist

Error message

set version %s not exist

What it means

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.

Source

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


def del_version(version):
    if version == get_current_version_dir():
        xlog.warn("try to delect current version.")
        return False

    try:
        shutil.rmtree(os.path.join(top_path, "code", version))
        return True
    except Exception as e:
        xlog.warn("deleting fail: %s", e)
        return False


def update_current_version(version):
    start_script = os.path.join(top_path, "code", version, "launcher", "start.py")
    if not os.path.isfile(start_script):
        xlog.warn("set version %s not exist", version)
        return False

    current_version_file = os.path.join(top_path, "code", "version.txt")
    with open(current_version_file, "w") as fd:
        fd.write(version)
    return True


def restart_xxnet(version=None):
    import module_init
    module_init.stop_all()

    import web_control
    web_control.stop()
    # New process will hold the listen port
    # We should close all listen port before create new process
    xlog.info("Close web control port.")

View on GitHub (pinned to cfa5bc17b6)

Solutions

  1. Check code/<version>/launcher/start.py actually exists on disk.
  2. Re-run the download/update for that version to complete extraction.
  3. Verify the exact version string (must equal the directory name under code/).
Defensive patterns

Strategy: validation

Validate before calling

import os
assert os.path.isfile(os.path.join(top_path,'code',version,'launcher','start.py')), 'incomplete version dir'

Type guard

def version_complete(v):
    return os.path.isfile(os.path.join(top_path,'code',v,'launcher','start.py'))

Prevention

When it happens

Trigger: Switching to a version whose directory is incomplete (failed unzip/overwrite) or a typo'd version string with no matching directory under code/.

Common situations: Calling set-current after a partially failed update; version dir renamed or deleted manually; trailing whitespace in the version parameter.

Related errors


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