invoke-ai/InvokeAI · error · DownloadJobCancelledException

Download interrupted. Resume required.

Error message

Download interrupted. Resume required.

What it means

DownloadJobCancelledException raised by _do_download in InvokeAI's download service when a download loop ends before all expected bytes were written (job.bytes < job.total_bytes). The service flags the job with resume_required=True so the partial file can be resumed rather than restarted, pauses the job, and cancels the current download attempt. It signals an interrupted network transfer, not a logic error.

Source

Thrown at invokeai/app/services/download/download_default.py:619

        report_delta = job.total_bytes / 100  # report every 1% change
        last_report_bytes = 0

        # DOWNLOAD LOOP
        with open(in_progress_path, open_mode) as file:
            for data in resp.iter_content(chunk_size=DOWNLOAD_CHUNK_SIZE):
                if job.cancelled:
                    raise DownloadJobCancelledException("Job was cancelled at caller's request")

                job.bytes += file.write(data)
                if (job.bytes - last_report_bytes >= report_delta) or (job.bytes >= job.total_bytes):
                    last_report_bytes = job.bytes
                    self._signal_job_progress(job)

        if job.total_bytes > 0 and job.bytes < job.total_bytes:
            job.resume_required = True
            job.resume_message = "Download interrupted. Resume required."
            job.pause()
            raise DownloadJobCancelledException("Download interrupted. Resume required.")

        # if we get here we are done and can rename the file to the original dest
        self._logger.debug(f"{job.source}: saved to {job.download_path} (bytes={job.bytes})")
        in_progress_path.rename(job.download_path)

    def _validate_url(self, url: str) -> None:
        """Refuse to fetch URLs that point at addresses only the server can reach."""
        validate_download_url(str(url), allow_private_urls=self._app_config.allow_private_download_urls)

    def _reject_unsafe_redirect(self, response: requests.Response, *args: Any, **kwargs: Any) -> requests.Response:
        """Response hook: vet each redirect target before `requests` follows it."""
        if response.is_redirect or response.is_permanent_redirect:
            location = response.headers.get("location")
            if location:
                try:
                    self._validate_url(urljoin(response.url, location))
                except Exception:
                    response.close()

View on GitHub (pinned to 0b6a024f2f)

Solutions

  1. Retry the download; the job is marked resume_required so the service resumes from job.bytes instead of restarting
  2. Check network stability / disable VPN or proxy and retry
  3. Delete the partial in-progress file if resume repeatedly fails, forcing a clean restart
  4. Check server-side availability of the source URL (may be a truncated/failed response from the host)

Example fix

// before: restarting the whole download on any failure
download_and_install(source)

// after: let InvokeAI resume the partial download
try:
    download_and_install(source)
except DownloadJobCancelledException:
    # job.resume_required is True; re-enqueue the job to resume from job.bytes
    queue_download(job.source, resume=True)
Defensive patterns

Strategy: retry

Validate before calling

None

Type guard

def is_resume_required(job) -> bool:
    return getattr(job, "resume_required", False) and job.total_bytes > 0 and job.bytes < job.total_bytes

Try / catch

try:
    service.download(job)
except DownloadJobCancelledException as e:
    if "Resume required" in str(e):
        requeue_job_with_resume(job)  # resumes from job.bytes
    else:
        raise

Prevention

When it happens

Trigger: A network connection drops or the read stream ends prematurely mid-download while job.total_bytes > 0 and fewer bytes than expected were written in _do_download (invoked via _download_next_item).

Common situations: Flaky Wi-Fi or VPN drops during model downloads; remote host (e.g. HuggingFace/CDN) closes the connection early; proxy timeouts; long downloads on unstable connections; sleeping laptops mid-transfer.

Related errors


AI-assisted analysis of invoke-ai/InvokeAI@0b6a024f2f (2026-08-29). Data as JSON: /api/errors/0a562215c790f8c0. Report an issue: GitHub.