cjpais/Handy · error · anyhow::Error

Download failed from Hugging Face ({}) and {} mirror(s)

Error message

Download failed from Hugging Face ({}) and {} mirror(s)

What it means

The last-resort error after Hugging Face failed AND every mirror from catalog::mirror_fallbacks also failed (each mirror failure is logged as 'Mirror download failed ... {url}'). This closes the entire download flow for the model with both the HF cause ({hf_error}) and the mirror count.

Source

Thrown at src-tauri/src/managers/model.rs:2096

                {
                    Ok(true) => {
                        completed = true;
                        break;
                    }
                    Ok(false) => {
                        info!("Mirror download cancelled for: {}", model_id);
                        return Ok(());
                    }
                    Err(e) => {
                        warn!(
                            "Mirror download failed for {} from {}: {:?}",
                            model_id, mirror.url, e
                        );
                    }
                }
            }
            if !completed {
                return Err(anyhow::anyhow!(
                    "Download failed from Hugging Face ({}) and {} mirror(s)",
                    hf_error,
                    mirrors.len()
                ));
            }
        }

        cleanup.disarmed = true;
        self.update_download_status()?;
        self.cancel_flags.lock().unwrap().remove(&model_id);
        let _ = self.app_handle.emit("model-download-complete", &model_id);
        info!("HF model {} downloaded", model_id);
        Ok(())
    }

    /// Direct-HTTP download of a catalog model's file from a mirror into the
    /// models dir (HF-model resolution accepts that location too). Returns
    /// `Ok(true)` on completion, `Ok(false)` if cancelled (partial kept).

View on GitHub (pinned to 98a4d80cce)

Solutions

  1. Check the warn! logs above this error — each mirror's {:?} failure is recorded with its URL
  2. Verify both huggingface.co and blob.handy.computer are reachable (curl -I)
  3. Check local disk space and write permissions on the models directory
  4. If the network is fine, check system clock (TLS cert validation) and proxy config
  5. Retry when the network recovers; partial files resume automatically
Defensive patterns

Strategy: retry

Try / catch

// terminal error — surface hf_error plus each mirror's warn log; only user action (network fix) unblocks
return Err(anyhow::anyhow!("Download failed from Hugging Face ({}) and {} mirror(s)", hf_error, mirrors.len()));

Prevention

When it happens

Trigger: All egress blocked or broken: HF unreachable and blob.handy.computer (the mirror host) also unreachable; proxies/firewalls blocking both hosts; disk-full causing writes to fail on every source; TLS issues affecting all endpoints.

Common situations: Fully offline or firewalled environments; captive portals; proxy outages; system clock skew breaking TLS on every host simultaneously.

Related errors


AI-assisted analysis of cjpais/Handy@98a4d80cce (2026-08-16). Data as JSON: /api/errors/e7f4cb1778316daf. Report an issue: GitHub.