XX-net/XX-Net · warning
download size:%d, need size:%d, download fail.
Error message
download size:%d, need size:%d, download fail.
What it means
Logged when a chunked HTTP download finishes but the total bytes written do not equal the Content-Length recorded for that URL. The downloader loops URLs and continues to the next candidate, so this is a size-mismatch failure of one mirror, not necessarily a total failure.
Source
Thrown at code/default/launcher/update_from_github.py:146
left = file_size
downloaded = 0
with open(filename, 'wb') as fp:
while global_var.running:
chunk_len = min(65536, left)
if not chunk_len:
break
chunk = req.read(chunk_len)
if not chunk:
break
fp.write(chunk)
downloaded += len(chunk)
progress[url]["downloaded"] = downloaded
left -= len(chunk)
if downloaded != progress[url]["size"]:
xlog.warn("download size:%d, need size:%d, download fail.", downloaded, progress[url]["size"])
continue
else:
progress[url]["status"] = "finished"
return True
except Exception as e:
xlog.exception("download %s to %s fail:%r", url, filename, e)
continue
progress[url]["status"] = "failed"
return False
def parse_update_versions(readme_file):
versions = []
try:
fd = open(readme_file, "rb")
lines = fd.readlines()
p = re.compile(br'https://codeload.github.com/XX-net/XX-Net/zip/([0-9]+)\.([0-9]+)\.([0-9]+) ([0-9a-fA-F]*)')View on GitHub (pinned to cfa5bc17b6)
Solutions
- Check network/proxy stability and retry the update (the loop already tries the next URL).
- Verify the URL list in get_github_versions() is reachable with curl -I and compare Content-Length.
- If a specific mirror is persistently bad, remove/replace that URL in the version metadata.
- Ensure disk space on the download path.
Defensive patterns
Strategy: retry
Try / catch
// treat download_file as fallible; it already rotates URLs
if not download_file(url_list, filename):
raise UpdateDownloadError('all mirrors failed for %s' % filename) Prevention
- Monitor progress[url]['status'] instead of assuming success.
- Run updates on a stable network path.
- Pre-check disk space before update.
When it happens
Trigger: download_file() completes its read loop (or breaks early on a short stream) and downloaded != progress[url]['size']; typical with truncated responses from GitHub/raw.githubusercontent mirrors, proxies closing early, or a redirect page returned instead of the binary.
Common situations: Updating XX-Net behind an unstable proxy or firewall where GitHub responses are cut off; a mirror returning an HTML error page with a different Content-Length; disk full mid-write.
Related errors
AI-assisted analysis of XX-net/XX-Net@cfa5bc17b6 (2026-08-27).
Data as JSON: /api/errors/42a761ab3f6ef2ff.
Report an issue: GitHub.