XX-net/XX-Net · error

update overwrite fail:%r

Error message

update overwrite fail:%r

What it means

overwrite() copies the unzipped new version tree over the current install (preserving exec bits on some platforms); any filesystem error during copy/chmod raises, is logged with this message, sets progress update_status to 'Overwrite Fail', and re-raises.

Source

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

                dst_file = os.path.join(top_path, target_relate_path, filename)
                if relate_path == 'code' and filename == 'app_info.json':
                    continue

                if not os.path.isfile(dst_file) or hash_file_sum(src_file) != hash_file_sum(dst_file):
                    xlog.info("copy %s => %s", src_file, dst_file)
                    # modify by outofmemo, files in '/sdcard' are not allowed to chmod for Android
                    # and shutil.copy() will call shutil.copymode()
                    if sys.platform != 'win32' and os.path.isfile("/system/bin/dalvikvm") == False and os.path.isfile(
                            "/system/bin/dalvikvm64") == False and os.path.isfile(dst_file):
                        st = os.stat(dst_file)
                        shutil.copy(src_file, dst_file)
                        if st.st_mode & stat.S_IEXEC:
                            os.chmod(dst_file, st.st_mode)
                    else:
                        shutil.copyfile(src_file, dst_file)

    except Exception as e:
        xlog.warn("update overwrite fail:%r", e)
        progress["update_status"] = "Overwrite Fail:%r" % e
        raise e
    xlog.info("update file finished.")


def download_overwrite_new_version(xxnet_version, checkhash=1):
    global update_progress

    xxnet_url = 'https://codeload.github.com/XX-net/XX-Net/zip/%s' % xxnet_version
    xxnet_zip_file = os.path.join(download_path, "XX-Net-%s.zip" % xxnet_version)
    xxnet_unzip_path = os.path.join(download_path, "XX-Net-%s" % xxnet_version)

    progress["update_status"] = "Downloading %s" % xxnet_url
    if not download_file(xxnet_url, xxnet_zip_file):
        progress["update_status"] = "Download Fail."
        raise Exception("download xxnet zip fail:%s" % xxnet_zip_file)

    if checkhash:

View on GitHub (pinned to cfa5bc17b6)

Solutions

  1. Stop XX-Net (or ensure the launcher can rename in-use files) before updating.
  2. Fix permissions/ownership of the install directory.
  3. Free disk space and retry update.
  4. Exclude the XX-Net directory from antivirus real-time scanning.
Defensive patterns

Strategy: try-catch

Try / catch

try:
    overwrite(version, unzip_path)
except Exception as e:
    log.exception('overwrite failed: %r', e)
    progress['update_status'] = 'Overwrite Fail'
    # schedule retry after process restart

Prevention

When it happens

Trigger: Destination files locked (running XX-Net binaries on Windows), permission denied in the install dir, path too long, or disk full while copying extracted files.

Common situations: Self-update while the process still holds open .exe/.pyc files on Windows; install dir owned by another user; antivirus locking freshly written files.

Related errors


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