{"record":{"id":"971e8c3109b78e06","repo":"XX-net/XX-Net","slug":"check-fail-s-except-r-971e8c","errorCode":null,"errorMessage":"check fail:%s except:%r","messagePattern":"check fail:(.+?) except:%r","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"code/default/x_tunnel/local/cloudfront_front/check_ip.py","lineNumber":87,"sourceCode":"                    continue\n\n    def write_ip(self, ip, host, handshake):\n        with self.lock:\n            self.out_fd.write(\"%s %s gws %d 0 0\\n\" % (ip, host, handshake))\n            self.out_fd.flush()\n\n    def checker(self):\n        while True:\n            try:\n                ip = self.get_ip()\n            except Exception as e:\n                xlog.info(\"no ip left\")\n                return\n\n            try:\n                res = self.check_ip.check_ip(ip, host=host)\n            except Exception as e:\n                xlog.warn(\"check fail:%s except:%r\", e)\n                continue\n\n            if not res or not res.ok:\n                xlog.debug(\"check fail:%s fail\", ip)\n                continue\n\n            self.write_ip(ip, res.domain, res.handshake_time)\n\n    def run(self):\n        for i in range(0, 10):\n            threading.Thread(target=self.checker).start()\n\n\ndef check_all_ip(check_ip):\n    check = CheckAllIp(check_ip, \"scan1.xx-net.org\")\n    check.run()\n\n","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/XX-net/XX-Net/blob/cfa5bc17b67676e467f37ec50766127e0ab5f0aa/code/default/x_tunnel/local/cloudfront_front/check_ip.py#L69-L105","documentation":"CloudFront (not CloudFlare) variant of the IP checker worker: check_ip raised for an IP/host pair and the IP is skipped. Same malformed format string as the cloudflare variant (only 'e' passed for two placeholders).","triggerScenarios":"checker() loop: check_ip(ip, host=host) raises (connect error, TLS failure).","commonSituations":"Scanning unverified CloudFront candidate IPs; some unreachable.","solutions":["Expected during scanning; no action","Fix format string to ('%s except:%r', ip, e)","Filter dead IPs first"],"exampleFix":"// before\nxlog.warn(\"check fail:%s except:%r\", e)\n// after\nxlog.warn(\"check fail:%s except:%r\", ip, e)","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    res = check_ip(ip, host=host)\nexcept Exception:\n    continue","preventionTips":["Expect failures scanning candidate IPs","Log ip with the exception"],"tags":["cloudfront","ip-check","exception","tooling"],"backgroundTag":"ip-health-check-failed","analyzedSha":"cfa5bc17b67676e467f37ec50766127e0ab5f0aa","analyzedAt":"2026-08-27T19:28:28.225Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}