{"record":{"id":"559531f516647eba","repo":"sgl-project/sglang","slug":"no-cached-files-for-repo-id-match-allow-pattern","errorCode":null,"errorMessage":"No cached files for {repo_id} match {allow_patterns or '**/*'}","messagePattern":"No cached files for (.+?) match (.+?)","errorType":"exception","errorClass":"LocalEntryNotFoundError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/utils/hf_diffusers_utils.py","lineNumber":1201,"sourceCode":"    if envs.SGLANG_USE_MODELSCOPE.get():\n        from modelscope import snapshot_download as _ms_snapshot_download\n\n        # ModelScope validates cached files on every online snapshot request and\n        # has no force_download argument. Dropping it preserves the caller's\n        # intended online revalidation without leaking Hub-specific kwargs.\n        kwargs.pop(\"force_download\", None)\n        ms_kwargs = {\n            \"model_id\": repo_id,\n            \"local_dir\": str(local_dir) if local_dir is not None else None,\n            \"ignore_patterns\": ignore_patterns,\n            \"allow_patterns\": allow_patterns,\n            \"local_files_only\": local_files_only,\n            \"max_workers\": max_workers,\n        }\n        ms_kwargs.update(kwargs)\n        local_path = _ms_snapshot_download(**ms_kwargs)\n        if local_files_only and not _snapshot_has_files(local_path, allow_patterns):\n            raise LocalEntryNotFoundError(\n                f\"No cached files for {repo_id} match {allow_patterns or '**/*'}\"\n            )\n        return local_path\n    else:\n        from huggingface_hub import snapshot_download as _hf_snapshot_download\n\n        hf_kwargs = {\n            \"repo_id\": repo_id,\n            \"local_dir\": local_dir,\n            \"ignore_patterns\": ignore_patterns,\n            \"allow_patterns\": allow_patterns,\n            \"local_files_only\": local_files_only,\n            \"max_workers\": max_workers,\n            \"etag_timeout\": 60,\n        }\n        hf_kwargs.update(kwargs)\n        return _hf_snapshot_download(**hf_kwargs)\n","sourceCodeStart":1183,"sourceCodeEnd":1219,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/utils/hf_diffusers_utils.py#L1183-L1219","documentation":"snapshot_download with local_files_only=True found a cached snapshot directory but no files inside it match the allow_patterns, so it raises LocalEntryNotFoundError. This is the offline-cache equivalent of a missing repo/file set: the cache exists but lacks the needed artifacts.","triggerScenarios":"Running with local_files_only=True (offline mode / HF_HUB_OFFLINE=1) when the cache was populated with a narrower allow_patterns set, a partial/interrupted download, or the patterns simply don't match the repo layout (e.g. '*.safetensors' when weights are in a subfolder).","commonSituations":"Air-gapped or offline inference boxes, CI caching only tokenizer files, glob patterns missing subdirectories (need '**/*.safetensors'), stale cache from an earlier partial pull.","solutions":["Broaden allow_patterns to match the actual layout (use '**/*.safetensors' or include subfolders)","Re-download online once to fully populate the cache, then rerun offline","Inspect the cached snapshot dir (ls ~/.cache/huggingface/hub/models--.../snapshots/*/) to see what's actually there","Clear the corrupt/partial snapshot and re-pull if the cache is incomplete"],"exampleFix":"// before\npath = snapshot_download(repo_id, allow_patterns=[\"*.safetensors\"], local_files_only=True)\n// after\npath = snapshot_download(repo_id, allow_patterns=[\"**/*.safetensors\", \"*.json\"], local_files_only=True)","handlingStrategy":"validation","validationCode":"import glob, os\nsnap = local_cache_dir  # known snapshot path\nif not glob.glob(os.path.join(snap, \"**/*.safetensors\"), recursive=True):\n    raise RuntimeError(\"cache incomplete; run online download first\")","typeGuard":null,"tryCatchPattern":"try:\n    p = snapshot_download(repo_id, allow_patterns=pats, local_files_only=True)\nexcept LocalEntryNotFoundError:\n    p = snapshot_download(repo_id, allow_patterns=pats)  # online fill","preventionTips":["Use '**/*.glob' patterns to cover subfolders","Fully populate caches before offline runs","Verify snapshot contents after pre-download steps"],"tags":["offline-cache","snapshot-download","huggingface","modelscope"],"backgroundTag":"cache-miss-offline","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}