{"record":{"id":"db0e209791ea6499","repo":"XX-net/XX-Net","slug":"report-fail","errorCode":null,"errorMessage":"report fail.","messagePattern":"report fail\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"code/default/x_tunnel/local/proxy_session.py","lineNumber":276,"sourceCode":"        stat[\"version\"] = g.xxnet_version\n        stat[\"client_uuid\"] = g.client_uuid\n        timeout_count = g.stat[\"timeout_roundtrip\"] - self.last_state[\"timeout\"]\n        if timeout_count == 0:\n            return\n\n        stat[\"global\"][\"timeout\"] = timeout_count\n        stat[\"global\"][\"ipv6\"] = check_local_network.IPv6.is_ok()\n        stat[\"tls_relay_front\"][\"ip_dict\"] = g.tls_relay_front.ip_manager.ip_dict\n\n        report_dat = {\n            \"account\": str(g.config.login_account),\n            \"password\": str(g.config.login_password),\n            \"stat\": stat,\n        }\n        xlog.debug(\"start report_stat\")\n        status, info = call_api(\"/report_stat\", report_dat)\n        if not status:\n            xlog.warn(\"report fail.\")\n            return\n\n        self.last_state[\"timeout\"] = g.stat[\"timeout_roundtrip\"]\n        data = info[\"data\"]\n        g.tls_relay_front.set_ips(data[\"ips\"])\n\n    def get_stat(self, type=\"second\"):\n        self.traffic_speed_calculation()\n\n        res = {}\n        rtt = 0\n        recent_sent = 0\n        recent_received = 0\n        total_sent = 0\n        total_received = 0\n        for front in g.http_client.all_fronts:\n            if not front:\n                continue","sourceCodeStart":258,"sourceCodeEnd":294,"githubUrl":"https://github.com/XX-net/XX-Net/blob/cfa5bc17b67676e467f37ec50766127e0ab5f0aa/code/default/x_tunnel/local/proxy_session.py#L258-L294","documentation":"check_report_status periodically POSTs usage stats to the x-tunnel server via call_api('/report_stat', ...). If call_api returns a falsy status (network error, HTTP failure, or API-level error), it logs 'report fail.' and returns, skipping the update of last_state and the server-provided IP list (tls_relay_front.set_ips).","triggerScenarios":"The scheduled reporter thread calling /report_stat while the API endpoint is unreachable, returns 5xx, or the response fails validation, so call_api yields status=False.","commonSituations":"Transient Internet outages; API server maintenance; DNS issues; TLS interception middleboxes breaking the API call; long-running process where the auth cookie/token expired.","solutions":["Treat single failures as transient — the reporter retries on its next cycle; watch for consecutive failures.","Verify outbound HTTPS connectivity to the x-tunnel API host (curl the /report_stat endpoint).","Restart the tunnel if failures persist, which re-logins and refreshes credentials.","Check server status pages/maintenance windows if all clients report failure."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Let the periodic reporter retry; alert only on consecutive failures.","Keep outbound HTTPS to the API host unblocked (no TLS MITM).","Restart the tunnel after long offline periods to refresh credentials."],"tags":["network","api","reporting","retry"],"backgroundTag":"api-call-failed","analyzedSha":"cfa5bc17b67676e467f37ec50766127e0ab5f0aa","analyzedAt":"2026-08-27T19:28:28.225Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}