{"record":{"id":"8d8d05ed97d9f561","repo":"unclecode/crawl4ai","slug":"url-blocked","errorCode":null,"errorMessage":"URL blocked","messagePattern":"URL blocked","errorType":"exception","errorClass":"EgressBlocked","httpStatus":400,"severity":"error","filePath":"deploy/docker/egress_broker.py","lineNumber":96,"sourceCode":"        elif ip in _6TO4:\n            forms.append(ipaddress.IPv4Address((int(ip) >> 80) & 0xFFFFFFFF))\n    return forms\n\n\ndef is_forbidden_ip(ip_str: str) -> bool:\n    \"\"\"True if the IP (or any embedded transition form) is not globally routable.\"\"\"\n    try:\n        ip = ipaddress.ip_address(ip_str)\n    except ValueError:\n        return True\n    return any(not form.is_global for form in _embedded_v4_forms(ip))\n\n\ndef _resolve(host: str, port: int):\n    try:\n        return socket.getaddrinfo(host, port, proto=socket.IPPROTO_TCP)\n    except socket.gaierror:\n        raise EgressBlocked()\n\n\ndef assert_host_allowed(host: str, port: int = 0) -> None:\n    \"\"\"Resolve `host` and reject if ANY answer is non-global. Opaque on failure.\"\"\"\n    if ALLOW_INTERNAL:\n        return\n    if not host:\n        raise EgressBlocked()\n    low = host.lower()\n    if low in _BLOCKED_HOSTNAMES or low.startswith(\"host.docker.internal\"):\n        raise EgressBlocked()\n    for *_, sockaddr in _resolve(host, port):\n        if is_forbidden_ip(sockaddr[0]):\n            raise EgressBlocked()\n\n\ndef resolve_and_pin(url: str) -> PinnedTarget:\n    \"\"\"Resolve `url` once, reject if any answer is non-global, and pin one IP.","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/unclecode/crawl4ai/blob/7e801521428ee12509994d39151006f64055ebe3/deploy/docker/egress_broker.py#L78-L114","documentation":"Error \"URL blocked\" thrown in unclecode/crawl4ai.","triggerScenarios":"Thrown at deploy/docker/egress_broker.py:96 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a URL that is permitted by the egress policy (public http/https hosts only).","If the host must be allowed, update the egress allowlist configuration on the server."],"exampleFix":"# Avoid private/loopback IPs; crawl public URLs only","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7e801521428ee12509994d39151006f64055ebe3","analyzedAt":"2026-08-14T20:46:20.673Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}