unslothai/unsloth · error · RuntimeError
{label} unavailable for {repo_id}
Error message
{label} unavailable for {repo_id} What it means
Terminal error in _retry_metadata_fetch (hf_download worker): fetching Hugging Face metadata (model_info/dataset_info) failed on both attempts — first with a short timeout, then a retry after _METADATA_RETRY_DELAY with a longer timeout — and the second attempt's exception was already re-raised inside the loop. This final raise is a defensive unreachable-in-practice branch; in practice you see the underlying exception (network error, HTTPError for a missing/gated repo, token failure), not this message. If this string ever surfaces, it means fetch() returned without returning (misbehaving fetch callable).
Source
Thrown at studio/backend/hub/workers/hf_download.py:203
def _hf_token_arg(hf_token: str | None) -> HfTokenArg:
return hf_token if hf_token else False
def _retry_metadata_fetch(repo_id: str, fetch, *, label: str):
for attempt, timeout in enumerate((_METADATA_REQUEST_TIMEOUT, _METADATA_RETRY_TIMEOUT)):
try:
return fetch(timeout)
except Exception as e:
if attempt == 1:
raise
print(
f"{label} request failed for {repo_id} " f"({type(e).__name__}: {e}); retrying.",
file = sys.stderr,
)
time.sleep(_METADATA_RETRY_DELAY)
raise RuntimeError(f"{label} unavailable for {repo_id}")
def _model_info_with_retry(repo_id: str, hf_token: str | None):
from huggingface_hub import model_info as hf_model_info
return _retry_metadata_fetch(
repo_id,
lambda timeout: hf_model_info(
repo_id,
token = _hf_token_arg(hf_token),
timeout = timeout,
files_metadata = True,
),
label = "Metadata",
)
def _dataset_info_with_retry(repo_id: str, hf_token: str | None):
from huggingface_hub import HfApiView on GitHub (pinned to 203007d190)
Solutions
- Reproduce the metadata call directly: `python -c "from huggingface_hub import model_info; model_info('<repo_id>')"` — the real error surfaces there.
- For auth/gated errors, set a valid token with access (huggingface-cli login / HF_TOKEN) and accept the model's license on the Hub.
- For network errors, fix connectivity/proxy (HTTPS_PROXY), or check https://status.huggingface.co for outages.
- Confirm the repo_id exists and is spelled correctly (owner/name).
Example fix
# before: repo_id='meta-llama/Llama-3-8b' (gated, no token)
# after
export HF_TOKEN=hf_xxx # token for an account that accepted the license
python -c "from huggingface_hub import model_info; print(model_info('meta-llama/Llama-3-8b', token=True))" Defensive patterns
Strategy: retry
Validate before calling
import socket, urllib.request
def hub_reachable(timeout: float = 5.0) -> bool:
try:
urllib.request.urlopen("https://huggingface.co/api/whoami-v2", timeout=timeout)
return True
except Exception:
return False
def repo_exists(repo_id: str, token: str | None = None) -> bool:
from huggingface_hub import model_info
try:
model_info(repo_id, token=token, timeout=10)
return True
except Exception:
return False Try / catch
from huggingface_hub.utils import HfHubHTTPError
for attempt in range(3):
try:
info = _model_info_with_retry(repo_id, token)
break
except HfHubHTTPError as e:
if e.response.status_code == 429 and attempt < 2:
time.sleep(2 ** attempt * 5) # rate-limited: back off and retry
continue
if e.response.status_code in (401, 403):
raise RuntimeError(f"access denied for {repo_id}: check HF token / gated license")
raise
except (ConnectionError, TimeoutError):
if attempt < 2:
continue
raise RuntimeError(f"hub unreachable for {repo_id}: check network/proxy") Prevention
- Validate repo_id and token (whoami + model_info probe) before queueing a download job.
- Watch stderr for '<label> request failed ... retrying' — it carries the real exception class.
- Set sane proxy env (HTTPS_PROXY) and DNS in containers; treat 429s with exponential backoff, auth errors without retry.
When it happens
Trigger: Worker downloading a model whose metadata call keeps failing: offline/blocked network, HuggingFace Hub outage or rate-limiting (429), nonexistent repo_id (401/404), or a gated repo with a missing/invalid token. The retryable path prints '<label> request failed for <repo> ...; retrying.' to stderr first.
Common situations: Air-gapped or proxied environments where huggingface.co is unreachable; expired HF token or gated model (Llama etc.) without accepted license; repo renamed/deleted after the job was queued; DNS failures in containers.
Related errors
- VirusTotal upload failed after {attempts} attempt(s): {last_
- Could not refresh ChatGPT authorization. Please retry.
- Could not reach ChatGPT Codex.
- Could not verify STT model '{model_id}'. Check that the repo
- llama-server embedder POST {path} failed after retry
AI-assisted analysis of unslothai/unsloth@203007d190 (2026-08-15).
Data as JSON: /api/errors/9c95e07378c1e76c.
Report an issue: GitHub.