unslothai/unsloth · error · TimeoutError

load timed out (last progress: {prog})

Error message

load timed out (last progress: {prog})

What it means

Thrown by fetchYoutubeTranscript (youtube-api.ts:21-43) when POST /api/youtube/transcript fails and the response body has no FastAPI `detail` field (or the body failed to parse as JSON). The status is embedded in the message, e.g. 'Could not fetch the transcript (403)'. The backend proxies YouTube's caption endpoints, so most failures originate upstream of the studio backend.

Source

Thrown at scripts/compare_engines.py:49

def _median(xs):
    return sorted(xs)[len(xs) // 2]


def bench_pytorch(repo, gguf, resolutions, steps, seed, iters):
    import torch
    from core.inference.diffusion import DiffusionBackend

    rows = []
    backend = DiffusionBackend()
    for speed in ("off", "default"):
        backend.begin_load(repo, gguf_filename = gguf, speed_mode = speed)
        deadline = time.time() + 1800  # 30 min: never hang on a stuck download/load
        while backend.load_progress().get("phase") != "ready":
            prog = backend.load_progress()
            if prog.get("phase") == "error":
                raise RuntimeError(prog)
            if time.time() > deadline:
                raise TimeoutError(f"load timed out (last progress: {prog})")
            time.sleep(0.5)
        for res in resolutions:

            def gen():
                torch.cuda.synchronize()
                t0 = time.time()
                backend.generate(
                    prompt = PROMPT,
                    width = res,
                    height = res,
                    steps = steps,
                    guidance = 0.0,
                    seed = seed,
                    batch_size = 1,
                )
                torch.cuda.synchronize()
                return time.time() - t0

View on GitHub (pinned to 203007d190)

Solutions

  1. Verify the URL is a plain youtube.com/watch?v=… video URL and that the video has captions enabled.
  2. Widen the `languages` preference list (e.g. add 'en') or pass [] to accept any available language.
  3. If 403/429: the backend IP is rate-limited by YouTube — wait or route egress differently; retry after a backoff.
  4. Check backend logs for the upstream YouTube error to see the exact refusal reason.
  5. If the video simply has no captions, there is no fix — the transcript cannot be fetched.

Example fix

// before
await fetchYoutubeTranscript(url, ['de'], signal);

// after — fall back to any available caption language
await fetchYoutubeTranscript(url, ['de', 'en'], signal).catch((e) => {
  if (/\(404\)$/.test(e.message)) return fetchYoutubeTranscript(url, [], signal);
  throw e;
});
Defensive patterns

Strategy: try-catch

Validate before calling

function normalizeYoutubeUrl(input: string): string | null {
  try {
    const u = new URL(input);
    if (u.hostname.replace(/^www\./, '') !== 'youtube.com' && u.hostname.replace(/^www\./, '') !== 'youtu.be') return null;
    return u.toString();
  } catch { return null; }
}

Type guard

function isTranscriptFetchError(e: unknown): e is Error {
  return e instanceof Error && /^Could not fetch the transcript \(\d+\)$/.test(e.message);
}

Try / catch

try {
  const t = await fetchYoutubeTranscript(url, ['en'], signal);
} catch (error) {
  const status = Number(/\((\d+)\)$/.exec((error as Error).message)?.[1]);
  if (status === 404) { /* no captions for these languages — retry with [] */ }
  else if (status === 429 || status === 403) { /* YouTube throttle: back off and retry later */ }
  else toast.error((error as Error).message);
}

Prevention

When it happens

Trigger: POST /api/youtube/transcript with a URL that is not a valid video (400), a video with captions disabled or no captions in the requested languages (404), YouTube rate-limiting or blocking the backend's IP (403/429), or the backend lacking outbound access to youtube.com (502/empty body).

Common situations: Passing a Shorts/playlist URL instead of a video URL; requesting languages the video has no captions for; running the backend from a datacenter IP that YouTube blocks; transcripts disabled by the uploader; regional restrictions.

Understand the failure class

Related errors


AI-assisted analysis of unslothai/unsloth@203007d190 (2026-08-15). Data as JSON: /api/errors/8d75ff6818cbcc5c. Report an issue: GitHub.