{"record":{"id":"77f28adb80768f45","repo":"XX-net/XX-Net","slug":"update-overwrite-fail-r","errorCode":null,"errorMessage":"update overwrite fail:%r","messagePattern":"update overwrite fail:%r","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"code/default/launcher/update_from_github.py","lineNumber":272,"sourceCode":"                dst_file = os.path.join(top_path, target_relate_path, filename)\n                if relate_path == 'code' and filename == 'app_info.json':\n                    continue\n\n                if not os.path.isfile(dst_file) or hash_file_sum(src_file) != hash_file_sum(dst_file):\n                    xlog.info(\"copy %s => %s\", src_file, dst_file)\n                    # modify by outofmemo, files in '/sdcard' are not allowed to chmod for Android\n                    # and shutil.copy() will call shutil.copymode()\n                    if sys.platform != 'win32' and os.path.isfile(\"/system/bin/dalvikvm\") == False and os.path.isfile(\n                            \"/system/bin/dalvikvm64\") == False and os.path.isfile(dst_file):\n                        st = os.stat(dst_file)\n                        shutil.copy(src_file, dst_file)\n                        if st.st_mode & stat.S_IEXEC:\n                            os.chmod(dst_file, st.st_mode)\n                    else:\n                        shutil.copyfile(src_file, dst_file)\n\n    except Exception as e:\n        xlog.warn(\"update overwrite fail:%r\", e)\n        progress[\"update_status\"] = \"Overwrite Fail:%r\" % e\n        raise e\n    xlog.info(\"update file finished.\")\n\n\ndef download_overwrite_new_version(xxnet_version, checkhash=1):\n    global update_progress\n\n    xxnet_url = 'https://codeload.github.com/XX-net/XX-Net/zip/%s' % xxnet_version\n    xxnet_zip_file = os.path.join(download_path, \"XX-Net-%s.zip\" % xxnet_version)\n    xxnet_unzip_path = os.path.join(download_path, \"XX-Net-%s\" % xxnet_version)\n\n    progress[\"update_status\"] = \"Downloading %s\" % xxnet_url\n    if not download_file(xxnet_url, xxnet_zip_file):\n        progress[\"update_status\"] = \"Download Fail.\"\n        raise Exception(\"download xxnet zip fail:%s\" % xxnet_zip_file)\n\n    if checkhash:","sourceCodeStart":254,"sourceCodeEnd":290,"githubUrl":"https://github.com/XX-net/XX-Net/blob/cfa5bc17b67676e467f37ec50766127e0ab5f0aa/code/default/launcher/update_from_github.py#L254-L290","documentation":"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.","triggerScenarios":"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.","commonSituations":"Self-update while the process still holds open .exe/.pyc files on Windows; install dir owned by another user; antivirus locking freshly written files.","solutions":["Stop XX-Net (or ensure the launcher can rename in-use files) before updating.","Fix permissions/ownership of the install directory.","Free disk space and retry update.","Exclude the XX-Net directory from antivirus real-time scanning."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    overwrite(version, unzip_path)\nexcept Exception as e:\n    log.exception('overwrite failed: %r', e)\n    progress['update_status'] = 'Overwrite Fail'\n    # schedule retry after process restart","preventionTips":["Stop dependent processes before overwrite.","Verify write permissions on install dir.","Keep enough free disk space for a full copy."],"tags":["filesystem","update","permissions","self-update"],"backgroundTag":"file-copy-permission-denied","analyzedSha":"cfa5bc17b67676e467f37ec50766127e0ab5f0aa","analyzedAt":"2026-08-27T19:28:28.225Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}