{"record":{"id":"ed511015c69e1755","repo":"Comfy-Org/ComfyUI","slug":"missing-file","errorCode":"MISSING_FILE","errorMessage":"Form must include a 'file' part or a known 'hash'.","messagePattern":"Form must include a 'file' part or a known 'hash'\\.","errorType":"http","errorClass":"UploadError","httpStatus":400,"severity":"error","filePath":"app/assets/api/upload.py","lineNumber":144,"sourceCode":"\n        elif fname == \"tags\":\n            tags_raw.append((await field.text()) or \"\")\n        elif fname == \"name\":\n            provided_name = (await field.text()) or None\n        elif fname == \"user_metadata\":\n            user_metadata_raw = (await field.text()) or None\n        elif fname == \"id\":\n            raise UploadError(\n                400,\n                \"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,","sourceCodeStart":126,"sourceCodeEnd":162,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/app/assets/api/upload.py#L126-L162","documentation":"Raised as LocalNetworkError (comfy_api_nodes/util/client.py:930) from the connection-failure handler when an aiohttp ClientConnectorError/OSError occurs AND the built-in connectivity diagnosis (_diagnose_connectivity probing google.com and baidu.com, 5s timeout) finds no internet access. The client distinguishes 'your machine is offline' from 'the API is down' — this error is the local-side verdict.","triggerScenarios":"Machine fully offline (wifi/ethernet down); DNS resolution broken system-wide; firewall or security software blocking all outbound HTTPS; the 5-second probe window expiring on very slow/unstable links so both probes fail.","commonSituations":"Laptops resuming from sleep before network reassociates; containerized environments without network egress; corporate firewalls whitelisting only specific hosts (google/baidu probes blocked even though the API host might be reachable); DNS misconfiguration.","solutions":["Verify general internet access from the same machine (browser or curl to any site)","Fix local networking: reconnect wifi, check DNS, restart router/VPN","If a firewall whitelists specific hosts, allow the probe domains or accept that diagnosis reads 'local' and allow the API host explicitly","Retry once the network is stable — the probes are best-effort over 5s, flaky links can false-positive"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import socket, urllib.request\nasync def preflight_network() -> bool:\n    try:\n        urllib.request.urlopen(\"https://www.baidu.com\", timeout=5)\n        return True\n    except OSError:\n        return False\nassert await preflight_network(), \"No internet — fix local network before running API nodes\"","typeGuard":"from comfy_api_nodes.util.common_exceptions import LocalNetworkError\n\ndef is_local_network_error(e: BaseException) -> bool:\n    return isinstance(e, LocalNetworkError)","tryCatchPattern":"from comfy_api_nodes.util.common_exceptions import LocalNetworkError\ntry:\n    result = await sync_op(...)\nexcept LocalNetworkError:\n    notify_user(\"Check internet connection\")\n    return","preventionTips":["Run a connectivity preflight before starting API-dependent workflows","In containers/CI, ensure outbound HTTPS is permitted (google.com or baidu.com reachability is used for diagnosis)","Retry once after network reassociation — probes are 5s best-effort"],"tags":["network","connectivity","offline","firewall"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}