Comfy-Org/ComfyUI · warning · ProcessingInterrupted

Task cancelled

Error message

Task cancelled

What it means

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.

Source

Thrown at comfy_api_nodes/util/upload_helpers.py:349

                            wait_label,
                            start_ts,
                            None,
                            display_callback=_display_time_progress if wait_label else None,
                        )
                        delay *= retry_backoff
                        continue
                    raise Exception(f"Failed to upload (HTTP {resp.status}).")
                request_logger.log_request_response(
                    operation_id=operation_id,
                    request_method="PUT",
                    request_url=upload_url,
                    response_status_code=resp.status,
                    response_headers=dict(resp.headers),
                    response_content="File uploaded successfully.",
                )
                return
        except asyncio.CancelledError:
            raise ProcessingInterrupted("Task cancelled") from None
        except (aiohttp.ClientError, OSError) as e:
            if attempt <= max_retries:
                request_logger.log_request_response(
                    operation_id=operation_id,
                    request_method="PUT",
                    request_url=upload_url,
                    request_headers=headers or None,
                    request_data=f"[File data {len(data)} bytes]",
                    error_message=f"{type(e).__name__}: {str(e)} (will retry)",
                )
                await sleep_with_interrupt(
                    delay,
                    cls,
                    wait_label,
                    start_ts,
                    None,
                    display_callback=_display_time_progress if wait_label else None,
                )

View on GitHub (pinned to 1c6d8d45b3)

Solutions

  1. Catch ProcessingInterrupted at the node boundary and stop execution cleanly; re-raise so ComfyUI records an interrupt.
  2. Avoid swallowing CancelledError in custom wrappers around these upload helpers.
  3. If cancellation is unexpected, audit surrounding code for task.cancel() calls or aggressive timeouts.
Defensive patterns

Strategy: try-catch

Try / catch

try:
    await upload_file_to_comfyapi(cls, bio, name, mime)
except ProcessingInterrupted:
    raise  # record as interrupted, not failed

Prevention

When it happens

Trigger: 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').

Common situations: User interrupts the queue while an API node uploads; front-end cancels a pending prompt; orchestration code cancels a batch of node executions.

Related errors


AI-assisted analysis of Comfy-Org/ComfyUI@1c6d8d45b3 (2026-08-14). Data as JSON: /api/errors/150559d1628fc6a0. Report an issue: GitHub.