XX-net/XX-Net · error
get_front fail
Error message
get_front fail
What it means
front_dispatcher.request() could not obtain any usable front (get_front returned None) within the timeout for the target host, so it gives up with status 602. It means no front (GAE/IP/cloudflare...) is currently available/alive.
Source
Thrown at code/default/x_tunnel/local/front_dispatcher.py:167
continue
num += len(dispatcher.workers)
num += dispatcher.connection_manager.new_conn_pool.qsize()
return num
def request(method, host, path="/", headers={}, data="", timeout=100):
# xlog.debug("front request %s timeout:%d", path, timeout)
start_time = time.time()
content, status, response = "", 603, {}
while time.time() - start_time < timeout:
start_get_front = time.time()
front = get_front(host, timeout)
if not front:
xlog.warn("get_front fail")
return "", 602, {}
finished_get_front = time.time()
get_front_time = finished_get_front - start_get_front
if get_front_time > 0.1:
xlog.warn("get_front_time: %f for %s %s %s", get_front_time, method, host, path)
if host == "dns.xx-net.org" and front == cloudflare_front and g.server_host:
# share the x-tunnel connection with dns.xx-net.org
# x-tunnel server will forward the request to dns.xx-net.org
if g.server_host:
host = g.server_host
headers["X-Async"] = "1"
if len(data) < 84:
padding = utils.to_str(utils.generate_random_lowercase(random.randint(8, 64)))
headers["Padding"] = padding
View on GitHub (pinned to cfa5bc17b6)
Solutions
- Wait/run the front statistic thread so fronts get scored and enabled
- Check that fronts were fetched (config/fronts not empty) and cloudflare/IP fronts are enabled
- If behind a firewall, verify outbound 443 connectivity
- Retry the request later; front_dispatcher loops fronts each attempt
Defensive patterns
Strategy: retry
Validate before calling
if not get_front(host, timeout):
time.sleep(5) # wait for fronts to become available before retrying Prevention
- Ensure fronts are deployed and enabled before routing traffic
- Watch front statistic thread health
When it happens
Trigger: All fronts are in cooldown/dead (e.g. after mass 403s), front list empty because no fronts were deployed, or g.server_host fronts unreachable.
Common situations: First run with no working IP/front, all fronts blocked by GFW, or the front-scoring thread hasn't initialized yet.
Related errors
- get_front_time: %f for %s %s %s
- front retry %s%s
- XTunnelNotRunning
- ConnectionPipe remove sock e:%r
- proxy handler read error %r
AI-assisted analysis of XX-net/XX-Net@cfa5bc17b6 (2026-08-27).
Data as JSON: /api/errors/256bd7f675f726ba.
Report an issue: GitHub.