{"record":{"id":"2cdcf04c3e1e0569","repo":"Comfy-Org/ComfyUI","slug":"empty-upload","errorCode":"EMPTY_UPLOAD","errorMessage":"Uploaded file is empty.","messagePattern":"Uploaded file is empty\\.","errorType":"http","errorClass":"UploadError","httpStatus":400,"severity":"error","filePath":"app/assets/api/upload.py","lineNumber":154,"sourceCode":"                \"UNSUPPORTED_FIELD\",\n                \"Client-provided 'id' is not supported. Asset IDs are assigned by the server.\",\n            )\n        elif fname == \"mime_type\":\n            provided_mime_type = ((await field.text()) or \"\").strip() or None\n        elif fname == \"preview_id\":\n            provided_preview_id = ((await field.text()) or \"\").strip() or None\n    if not file_present and not (provided_hash and provided_hash_exists):\n        raise UploadError(\n            400, \"MISSING_FILE\", \"Form must include a 'file' part or a known 'hash'.\"\n        )\n\n    if (\n        file_present\n        and file_written == 0\n        and not (provided_hash and provided_hash_exists)\n    ):\n        delete_temp_file_if_exists(tmp_path)\n        raise UploadError(400, \"EMPTY_UPLOAD\", \"Uploaded file is empty.\")\n\n    return ParsedUpload(\n        file_present=file_present,\n        file_written=file_written,\n        file_client_name=file_client_name,\n        tmp_path=tmp_path,\n        tags_raw=tags_raw,\n        provided_name=provided_name,\n        user_metadata_raw=user_metadata_raw,\n        provided_hash=provided_hash,\n        provided_hash_exists=provided_hash_exists,\n        provided_mime_type=provided_mime_type,\n        provided_preview_id=provided_preview_id,\n    )\n\n\ndef delete_temp_file_if_exists(tmp_path: str | None) -> None:\n    \"\"\"Safely remove a temp file and its parent directory if empty.\"\"\"","sourceCodeStart":136,"sourceCodeEnd":172,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/app/assets/api/upload.py#L136-L172","documentation":"Raised as ApiServerError (comfy_api_nodes/util/client.py:943) when the request could not connect AND the diagnosis shows the internet is reachable (at least one of google.com/baidu.com responded), meaning the failure sits at the API host or the path to it. The message names default_base_url() and suggests a service-side outage.","triggerScenarios":"API host down or restarting during a provider deploy; DNS for the API domain failing while general internet works; the API host's /health probe failing (>=500) or being unreachable; datacenter/regional outage between the user and the API.","commonSituations":"Provider outages and maintenance windows; API domain DNS propagation issues after provider migration; routing/peering problems affecting only the API host; provider rate-limiting at TCP/connection level.","solutions":["Check the provider's status page for an active incident","Retry after a wait — connection-level outages are usually transient","Verify DNS resolution of the API host from your machine (nslookup/dig) if outages are not reported","Report to the provider if it persists while their status page is green"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":"from comfy_api_nodes.util.common_exceptions import ApiServerError\n\ndef is_api_server_error(e: BaseException) -> bool:\n    return isinstance(e, ApiServerError)","tryCatchPattern":"from comfy_api_nodes.util.common_exceptions import ApiServerError\ntry:\n    result = await sync_op(...)\nexcept ApiServerError:\n    await asyncio.sleep(30)\n    result = await sync_op(...)  # transient outage retry\n# cap retries; check provider status page if persistent","preventionTips":["Catch NetworkError subtypes explicitly to separate local vs server causes","Check the provider status page before debugging your own setup","Add exponential backoff with a retry cap for connection-level failures"],"tags":["network","outage","provider","api-server"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}