XX-net/XX-Net · error

download %s fail

Error message

download %s fail

What it means

Final warning after download_file exhausts all retry attempts for a URL; the function returns falsy and the caller (download_unzip) aborts. This is the terminal signal that the library archive could not be fetched.

Source

Thrown at code/default/gae_proxy/local/download_gae_lib.py:97

                        chunk = req.read(chunk_len)
                        if not chunk:
                            break
                        fp.write(chunk)
                        downloaded += len(chunk)
                        left -= len(chunk)

            if downloaded != file_size:
                xlog.warn("download size:%d, need size:%d, download fail.", downloaded, file_size)
                os.remove(filename)
                continue
            else:
                xlog.info("download %s to %s success.", org_url, filename)
                return True
        except Exception as e:
            xlog.warn("download %s to %s fail:%r", org_url, filename, e)
            continue
    xlog.warn("download %s fail", org_url)


def download_unzip(url, extract_path):
    if os.path.isdir(extract_path):
        return True

    data_root = os.path.join(top_path, 'data')
    download_path = os.path.join(data_root, 'downloads')
    if not os.path.isdir(download_path):
        os.mkdir(download_path)

    fn = url.split("/")[-1]
    dfn = os.path.join(download_path, fn)

    if not download_file(url, dfn):
        xlog.warn("download file %s fail.", url)
        return

View on GitHub (pinned to cfa5bc17b6)

Solutions

  1. Verify internet/proxy connectivity (the XX-Net proxy must itself be able to reach the web)
  2. Retry later / on a stable network
  3. Manually download the file and unzip it into the expected directory
  4. Check firewall/antivirus blocking python.exe outbound
Defensive patterns

Strategy: fallback

Validate before calling

import os
if not os.path.isdir(extract_path):  # pre-place libs to skip download entirely
    raise SystemExit('libs missing and download unavailable — install manually')

Prevention

When it happens

Trigger: Every retry attempt raised an exception or produced a short download; the loop finishes and this line logs the URL that failed.

Common situations: Machine fully offline at first run, proxy misconfigured so all outbound HTTPS fails, the host serving the lib files is blocked or moved.

Related errors


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