{"record":{"id":"256bd7f675f726ba","repo":"XX-net/XX-Net","slug":"get-front-fail","errorCode":null,"errorMessage":"get_front fail","messagePattern":"get_front fail","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"code/default/x_tunnel/local/front_dispatcher.py","lineNumber":167,"sourceCode":"            continue\n\n        num += len(dispatcher.workers)\n\n        num += dispatcher.connection_manager.new_conn_pool.qsize()\n\n    return num\n\n\ndef request(method, host, path=\"/\", headers={}, data=\"\", timeout=100):\n    # xlog.debug(\"front request %s timeout:%d\", path, timeout)\n    start_time = time.time()\n\n    content, status, response = \"\", 603, {}\n    while time.time() - start_time < timeout:\n        start_get_front = time.time()\n        front = get_front(host, timeout)\n        if not front:\n            xlog.warn(\"get_front fail\")\n            return \"\", 602, {}\n\n        finished_get_front = time.time()\n        get_front_time = finished_get_front - start_get_front\n        if get_front_time > 0.1:\n            xlog.warn(\"get_front_time: %f for %s %s %s\", get_front_time, method, host, path)\n\n        if host == \"dns.xx-net.org\" and front == cloudflare_front and g.server_host:\n            # share the x-tunnel connection with dns.xx-net.org\n            # x-tunnel server will forward the request to dns.xx-net.org\n            if g.server_host:\n                host = g.server_host\n\n        headers[\"X-Async\"] = \"1\"\n        if len(data) < 84:\n            padding = utils.to_str(utils.generate_random_lowercase(random.randint(8, 64)))\n            headers[\"Padding\"] = padding\n","sourceCodeStart":149,"sourceCodeEnd":185,"githubUrl":"https://github.com/XX-net/XX-Net/blob/cfa5bc17b67676e467f37ec50766127e0ab5f0aa/code/default/x_tunnel/local/front_dispatcher.py#L149-L185","documentation":"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.","triggerScenarios":"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.","commonSituations":"First run with no working IP/front, all fronts blocked by GFW, or the front-scoring thread hasn't initialized yet.","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"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"if not get_front(host, timeout):\n    time.sleep(5)  # wait for fronts to become available before retrying","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ensure fronts are deployed and enabled before routing traffic","Watch front statistic thread health"],"tags":["x-tunnel","front","no-route"],"backgroundTag":"no-available-upstream","analyzedSha":"cfa5bc17b67676e467f37ec50766127e0ab5f0aa","analyzedAt":"2026-08-27T19:28:28.225Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}