{"record":{"id":"a7e6bff07d0c84f1","repo":"Comfy-Org/ComfyUI","slug":"the-api-service-appears-unreachable-at-this-time","errorCode":null,"errorMessage":"The API service appears unreachable at this time.","messagePattern":"The API service appears unreachable at this time\\.","errorType":"exception","errorClass":"ApiServerError","httpStatus":null,"severity":"error","filePath":"comfy_api_nodes/util/upload_helpers.py","lineNumber":376,"sourceCode":"                    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(\"/\", \"_\")\n    except Exception:\n        slug = \"upload\"\n    return f\"{method}_{slug}_{op_uuid}_try{attempt}\"","sourceCodeStart":358,"sourceCodeEnd":394,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_api_nodes/util/upload_helpers.py#L358-L394","documentation":"ApiServerError raised when the upload transport fails and retries are exhausted, but _diagnose_connectivity() shows the internet itself is reachable — i.e., the local network is fine and the ComfyUI API service (or its upload endpoint) is unreachable or rejecting connections. Chained from the original aiohttp.ClientError/OSError.","triggerScenarios":"aiohttp.ClientError/OSError after max_retries while general internet connectivity checks pass; diag['internet_accessible'] is True so ApiServerError('The API service appears unreachable at this time.') is raised at upload_helpers.py:376.","commonSituations":"ComfyUI API backend outage or maintenance; regional CDN issues; upload endpoint specifically blocked/down while the rest of the site works; transient provider-side failures that outlast the built-in retry window; S3/presigned-upload host unreachable.","solutions":["Wait a few minutes and retry — provider outages usually resolve; the helper already exhausted its retry budget.","Check the ComfyUI API status page or forums for incidents.","Inspect request_logger entries for the underlying ClientError to confirm which host is failing.","If persistent, capture the chained exception detail and report it to the API service."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"from comfy_api_nodes.util.common_exceptions import ApiServerError\ntry:\n    await upload_image_to_comfyapi(cls, image)\nexcept ApiServerError:\n    await asyncio.sleep(60)\n    await upload_image_to_comfyapi(cls, image)  # one manual backoff retry","preventionTips":["Treat as transient provider unavailability; back off longer than the built-in retries","Watch provider status pages during incidents","Log the chained cause for support reports"],"tags":["network","api","server-error","upload"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}