{"record":{"id":"9c95e07378c1e76c","repo":"unslothai/unsloth","slug":"label-unavailable-for-repo-id","errorCode":null,"errorMessage":"{label} unavailable for {repo_id}","messagePattern":"(.+?) unavailable for (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"studio/backend/hub/workers/hf_download.py","lineNumber":203,"sourceCode":"\n\ndef _hf_token_arg(hf_token: str | None) -> HfTokenArg:\n    return hf_token if hf_token else False\n\n\ndef _retry_metadata_fetch(repo_id: str, fetch, *, label: str):\n    for attempt, timeout in enumerate((_METADATA_REQUEST_TIMEOUT, _METADATA_RETRY_TIMEOUT)):\n        try:\n            return fetch(timeout)\n        except Exception as e:\n            if attempt == 1:\n                raise\n            print(\n                f\"{label} request failed for {repo_id} \" f\"({type(e).__name__}: {e}); retrying.\",\n                file = sys.stderr,\n            )\n            time.sleep(_METADATA_RETRY_DELAY)\n    raise RuntimeError(f\"{label} unavailable for {repo_id}\")\n\n\ndef _model_info_with_retry(repo_id: str, hf_token: str | None):\n    from huggingface_hub import model_info as hf_model_info\n    return _retry_metadata_fetch(\n        repo_id,\n        lambda timeout: hf_model_info(\n            repo_id,\n            token = _hf_token_arg(hf_token),\n            timeout = timeout,\n            files_metadata = True,\n        ),\n        label = \"Metadata\",\n    )\n\n\ndef _dataset_info_with_retry(repo_id: str, hf_token: str | None):\n    from huggingface_hub import HfApi","sourceCodeStart":185,"sourceCodeEnd":221,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/studio/backend/hub/workers/hf_download.py#L185-L221","documentation":"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).","triggerScenarios":"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.","commonSituations":"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.","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)."],"exampleFix":"# before: repo_id='meta-llama/Llama-3-8b' (gated, no token)\n# after\nexport HF_TOKEN=hf_xxx   # token for an account that accepted the license\npython -c \"from huggingface_hub import model_info; print(model_info('meta-llama/Llama-3-8b', token=True))\"","handlingStrategy":"retry","validationCode":"import socket, urllib.request\n\ndef hub_reachable(timeout: float = 5.0) -> bool:\n    try:\n        urllib.request.urlopen(\"https://huggingface.co/api/whoami-v2\", timeout=timeout)\n        return True\n    except Exception:\n        return False\n\ndef repo_exists(repo_id: str, token: str | None = None) -> bool:\n    from huggingface_hub import model_info\n    try:\n        model_info(repo_id, token=token, timeout=10)\n        return True\n    except Exception:\n        return False","typeGuard":null,"tryCatchPattern":"from huggingface_hub.utils import HfHubHTTPError\nfor attempt in range(3):\n    try:\n        info = _model_info_with_retry(repo_id, token)\n        break\n    except HfHubHTTPError as e:\n        if e.response.status_code == 429 and attempt < 2:\n            time.sleep(2 ** attempt * 5)  # rate-limited: back off and retry\n            continue\n        if e.response.status_code in (401, 403):\n            raise RuntimeError(f\"access denied for {repo_id}: check HF token / gated license\")\n        raise\n    except (ConnectionError, TimeoutError):\n        if attempt < 2:\n            continue\n        raise RuntimeError(f\"hub unreachable for {repo_id}: check network/proxy\")","preventionTips":["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."],"tags":["network","huggingface-hub","retry","hf-download","authentication"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}