XX-net/XX-Net · error

%s %s to %s:%d try_loop fail

Error message

%s %s to %s:%d try_loop fail

What it means

Every rule in rule_list was tried and none succeeded (each either returned, raised, or hit a continue), so try_loop gives up: it logs the failure and closes the client socket.

Source

Thrown at code/default/smart_router/local/smart_route.py:477

                xlog.info("%s %s:%d forward to socks", scense, host, port)
                if isinstance(sock, SocketWrap):
                    _sock = sock._sock
                else:
                    _sock = sock
                do_socks(_sock, host, port, client_address, left_buf)
                return
            elif rule == "black":
                xlog.info("%s to:%s:%d black", scense, host, port)
                sock.close()
                return
            else:
                xlog.error("%s %s:%d rule:%s unknown", scense, host, port, host, rule)
                sock.close()
                return
        except Exception as e:
            xlog.exception("%s %s to %s:%d except:%r", scense, rule, host, port, e)

    xlog.warn("%s %s to %s:%d try_loop fail", scense, rule_list, host, port)
    sock.close()
    return


def handle_ip_proxy(sock, ip, port, client_address):
    xlog.debug("handle_ip_proxy to %s:%d from:%s:%d", ip, port, client_address[0], client_address[1])

    if not isinstance(sock, SocketWrap):
        sock = SocketWrap(sock, client_address[0], client_address[1])

    if port == 443:
        try:
            host = get_sni(sock)
            if host and not utils.check_ip_valid(host):
                xlog.debug("ip connect to %s:%d translate to %s", ip, port, host)
                return handle_domain_proxy(sock, host, port, client_address)
        except SniNotExist as e:
            xlog.debug("ip:%s:%d get sni fail", ip, port)

View on GitHub (pinned to cfa5bc17b6)

Solutions

  1. Check basic connectivity to the target host:port from this machine
  2. Verify at least one proxy/route in rule_list is healthy
  3. Review routing rules for the domain and add a working fallback
  4. Inspect earlier per-rule error logs to see which transport failed and why
Defensive patterns

Strategy: fallback

Validate before calling

if not any(rule_alive(r) for r in rule_list): fail_fast_with_reason()

Try / catch

Catch per-rule exceptions; after exhaustion, close socket and surface which rules failed.

Prevention

When it happens

Trigger: All candidate transports (direct, proxy, gae, x-tunnel...) for host:port failed — e.g. destination unreachable AND all proxies broken — exhausting rule_list.

Common situations: Total network outage, all configured proxies down, destination host blocking all routes, or misconfigured rule list matching nothing usable.

Related errors


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