XX-net/XX-Net · error · GAE_Exception

605

605

Error message

status:%d

What it means

GAE_Exception 605 raised when the frontend's HTTP status is > 300 (and not one of the previously handled 404/503/403/405 cases). This covers unexpected redirects and other 3xx/4xx/5xx statuses that make the GAE response unusable; the status number is embedded in the message.

Source

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

            raise GAE_Exception(604, "appid out of quota:%s" % appid)

        server_type = response.getheader(b"Server", b"")
        if (b"gws" not in server_type and b"Google Frontend" not in server_type and b"GFE" not in server_type) or \
                response.status == 403 or response.status == 405:

            # some ip can connect, and server type can be gws
            # but can't use as GAE server
            # so we need remove it immediately

            xlog.warn("IP:%s not support GAE, headers:%s status:%d", response.ssl_sock.ip_str, response.headers,
                      response.status)
            response.worker.close("ip not support GAE")
            raise GAE_Exception(602, "ip not support GAE")

        response.gps = response.getheader(b"x-server", b"")

        if response.status > 300:
            raise GAE_Exception(605, "status:%d" % response.status)

        if response.status != 200:
            xlog.warn("GAE %s appid:%s status:%d", response.ssl_sock.ip_str,
                      appid, response.status)

        return response
    except GAE_Exception as e:
        if e.error_code not in (600, 603, 604) and hasattr(response, "ssl_sock"):
            front.ip_manager.recheck_ip(response.ssl_sock.ip_str, first_report=False)
        raise e


def request_gae_proxy(method, url, headers, body, timeout=None):
    headers = dict(headers)
    # make retry and time out
    time_request = time.time()

    # GAE urlfetch will not decode br if Accept-Encoding include gzip

View on GitHub (pinned to cfa5bc17b6)

Solutions

  1. Check the exact embedded status code to narrow the cause (302 vs 500 vs 410)
  2. Inspect your GAE app's handler for /_gh/ — it must answer with the GAE protocol, not redirects or errors
  3. Redeploy the app / update XX-Net if the app code is stale
  4. Retry; transient 5xx from the platform usually clears
Defensive patterns

Strategy: try-catch

Try / catch

try:
    resp = request_gae_proxy(...)
except GAE_Exception as e:
    if e.code == 605:
        status = int(str(e).split(':')[1])
        if status >= 500:
            resp = request_gae_proxy(...)  # transient server error
        else:
            raise  # redirect/config issue; don't retry blindly
    else:
        raise

Prevention

When it happens

Trigger: request_gae_proxy where the app or an intermediary returns e.g. 302 redirect, 410, or 500 — statuses the GAE protocol client cannot interpret as a valid app response.

Common situations: GAE app misconfigured (redirecting /_gh/), Google-serving region-specific error, app code throwing 500, partial platform incidents.

Related errors


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