XX-net/XX-Net · warning

body len:%d %s %s

Error message

body len:%d %s %s

What it means

pack_request warns whenever the (possibly deflated) request body exceeds 10 MB before being forwarded to GAE. It is informational size tracking, not a failure — the request is still sent with the computed Content-Length.

Source

Thrown at code/default/gae_proxy/local/gae_handler.py:239

def return_fail_message(wfile):
    html = generate_message_html(
        '504 GAEProxy Proxy Time out', '连接超时,先休息一会再来!')
    send_response(wfile, 504, body=utils.to_bytes(html))
    return


def pack_request(method, url, headers, body, timeout):
    headers = dict(headers)
    if isinstance(body, bytes) and body:
        if len(body) < 10 * 1024 * 1024 and b'Content-Encoding' not in headers:
            # 可以压缩
            zbody = deflate(body)
            if len(zbody) < len(body):
                body = zbody
                headers[b'Content-Encoding'] = b'deflate'
        if len(body) > 10 * 1024 * 1024:
            xlog.warn("body len:%d %s %s", len(body), method, url)
        headers[b'Content-Length'] = utils.to_bytes(str(len(body)))

    # GAE don't allow set `Host` header
    if b'Host' in headers:
        del headers[b'Host']

    kwargs = {}
    # gae 用的参数
    if front.config.GAE_PASSWORD:
        kwargs[b'password'] = front.config.GAE_PASSWORD

    # kwargs['options'] =
    kwargs[b'validate'] = front.config.GAE_VALIDATE
    if url.endswith(b".js"):
        kwargs[b'maxsize'] = front.config.JS_MAXSIZE
    else:
        kwargs[b'maxsize'] = front.config.AUTORANGE_MAXSIZE
    kwargs[b'timeout'] = str(timeout)

View on GitHub (pinned to cfa5bc17b6)

Solutions

  1. Expect upstream GAE/App Engine size limits to reject the upload; upload directly or via another channel
  2. Compress/large-file split on the application side
  3. Ignore if you knowingly upload large bodies — the log is informational
Defensive patterns

Strategy: validation

Validate before calling

if len(body) > 10 * 1024 * 1024:
    raise ValueError('body too large for GAE upload path')

Prevention

When it happens

Trigger: A POST/PUT whose body, even after deflate compression, is larger than 10*1024*1024 bytes, e.g. large uploads through the proxy.

Common situations: Uploading big files via the local proxy; App Engine request limits (~32MB, often lower) may reject such requests upstream.

Related errors


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