{"record":{"id":"77ce4098e397c718","repo":"Comfy-Org/ComfyUI","slug":"unable-to-connect-to-the-network-please-check-you-77ce40","errorCode":null,"errorMessage":"Unable to connect to the network. Please check your internet connection and try again.","messagePattern":"Unable to connect to the network\\. Please check your internet connection and try again\\.","errorType":"exception","errorClass":"LocalNetworkError","httpStatus":null,"severity":"error","filePath":"comfy_api_nodes/util/upload_helpers.py","lineNumber":373,"sourceCode":"                    request_url=upload_url,\n                    request_headers=headers or None,\n                    request_data=f\"[File data {len(data)} bytes]\",\n                    error_message=f\"{type(e).__name__}: {str(e)} (will retry)\",\n                )\n                await sleep_with_interrupt(\n                    delay,\n                    cls,\n                    wait_label,\n                    start_ts,\n                    None,\n                    display_callback=_display_time_progress if wait_label else None,\n                )\n                delay *= retry_backoff\n                continue\n\n            diag = await _diagnose_connectivity()\n            if not diag[\"internet_accessible\"]:\n                raise LocalNetworkError(\n                    \"Unable to connect to the network. Please check your internet connection and try again.\"\n                ) from e\n            raise ApiServerError(\"The API service appears unreachable at this time.\") from e\n        finally:\n            stop_evt.set()\n            if monitor_task:\n                monitor_task.cancel()\n                with contextlib.suppress(Exception):\n                    await monitor_task\n            if sess:\n                with contextlib.suppress(Exception):\n                    await sess.close()\n\n\ndef _generate_operation_id(method: str, url: str, attempt: int, op_uuid: str) -> str:\n    try:\n        parsed = urlparse(url)\n        slug = (parsed.path.rsplit(\"/\", 1)[-1] or parsed.netloc or \"upload\").strip(\"/\").replace(\"/\", \"_\")","sourceCodeStart":355,"sourceCodeEnd":391,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_api_nodes/util/upload_helpers.py#L355-L391","documentation":"LocalNetworkError raised when the PUT fails with aiohttp.ClientError or OSError, retries are exhausted, and _diagnose_connectivity() reports the machine cannot reach the internet. It distinguishes 'your machine is offline' from 'the API service is down' so users get an actionable message. It chains from the original transport exception.","triggerScenarios":"except (aiohttp.ClientError, OSError) fires after max_retries (e.g., aiohttp.ClientConnectorError DNS failure, connection refused), then _diagnose_connectivity() returns internet_accessible=False and LocalNetworkError is raised at upload_helpers.py:373.","commonSituations":"Machine lost Wi-Fi/Ethernet mid-workflow; DNS resolution broken; firewall or proxy blocking outbound HTTPS; corporate network requiring a proxy that aiohttp is not configured to use; VPN dropped.","solutions":["Verify internet connectivity (curl https://example.com) and reconnect the network, then re-run the workflow.","Check DNS (nslookup the API host) and proxy settings — set HTTPS_PROXY if your network requires it.","Temporarily disable VPN/firewall rules that may block the ComfyUI process's outbound traffic.","If on a locked-down network, allowlist the ComfyUI API upload endpoints."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"import socket, urllib.request\n\ndef internet_ok(host: str = \"https://example.com\", timeout: float = 3.0) -> bool:\n    try:\n        urllib.request.urlopen(host, timeout=timeout)\n        return True\n    except OSError:\n        return False","typeGuard":null,"tryCatchPattern":"from comfy_api_nodes.util.common_exceptions import LocalNetworkError\ntry:\n    await upload_image_to_comfyapi(cls, image)\nexcept LocalNetworkError:\n    show_user(\"No internet connection — check network and retry\")","preventionTips":["Verify connectivity before running API-node workflows","Configure HTTPS_PROXY on restricted networks","Avoid starting long batch jobs on unstable connections"],"tags":["network","connectivity","upload","diagnostics"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}