{"record":{"id":"150559d1628fc6a0","repo":"Comfy-Org/ComfyUI","slug":"task-cancelled-150559","errorCode":null,"errorMessage":"Task cancelled","messagePattern":"Task cancelled","errorType":"exception","errorClass":"ProcessingInterrupted","httpStatus":null,"severity":"warning","filePath":"comfy_api_nodes/util/upload_helpers.py","lineNumber":349,"sourceCode":"                            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                    raise Exception(f\"Failed to upload (HTTP {resp.status}).\")\n                request_logger.log_request_response(\n                    operation_id=operation_id,\n                    request_method=\"PUT\",\n                    request_url=upload_url,\n                    response_status_code=resp.status,\n                    response_headers=dict(resp.headers),\n                    response_content=\"File uploaded successfully.\",\n                )\n                return\n        except asyncio.CancelledError:\n            raise ProcessingInterrupted(\"Task cancelled\") from None\n        except (aiohttp.ClientError, OSError) as e:\n            if attempt <= max_retries:\n                request_logger.log_request_response(\n                    operation_id=operation_id,\n                    request_method=\"PUT\",\n                    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                )","sourceCodeStart":331,"sourceCodeEnd":367,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_api_nodes/util/upload_helpers.py#L331-L367","documentation":"Raised as ProcessingInterrupted('Task cancelled') when the whole upload operation is cancelled from outside — the outer try/except around the retry loop catches asyncio.CancelledError and re-raises it as ProcessingInterrupted. This is the catch-all for cancellation that arrives anywhere in upload_file_to_api_file_upload_url (URL fetch, PUT, response handling) rather than in the PUT await specifically.","triggerScenarios":"The asyncio task running upload_file_to_api_file_upload_url is cancelled while awaiting any step in the for-attempt loop (e.g., ComfyUI execution interrupt cancels the node task); except asyncio.CancelledError at upload_helpers.py:349 converts it to ProcessingInterrupted('Task cancelled').","commonSituations":"User interrupts the queue while an API node uploads; front-end cancels a pending prompt; orchestration code cancels a batch of node executions.","solutions":["Catch ProcessingInterrupted at the node boundary and stop execution cleanly; re-raise so ComfyUI records an interrupt.","Avoid swallowing CancelledError in custom wrappers around these upload helpers.","If cancellation is unexpected, audit surrounding code for task.cancel() calls or aggressive timeouts."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    await upload_file_to_comfyapi(cls, bio, name, mime)\nexcept ProcessingInterrupted:\n    raise  # record as interrupted, not failed","preventionTips":["Never suppress CancelledError in code wrapping these helpers","Propagate ProcessingInterrupted so the queue marks the run interrupted"],"tags":["async","cancellation","upload","comfyui"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}