{"record":{"id":"17dc1e2e073900bf","repo":"sgl-project/sglang","slug":"resolved-lora-weight-selected-file-r-was-not-dow","errorCode":null,"errorMessage":"Resolved LoRA weight {selected_file!r} was not downloaded to {local_path}","messagePattern":"Resolved LoRA weight (.+?) was not downloaded to (.+?)","errorType":"validation","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/utils/hf_diffusers_utils.py","lineNumber":680,"sourceCode":"            return source.local_path\n        return os.path.join(source.local_path, selected_file)\n\n    assert source.repo_id is not None\n    allow_patterns = [\"*.json\", selected_file]\n    selected_parent = os.path.dirname(selected_file)\n    if selected_parent:\n        allow_patterns.insert(1, f\"{selected_parent}/*.json\")\n    local_path = maybe_download_model(\n        source.repo_id,\n        local_dir,\n        download,\n        is_lora=True,\n        allow_patterns=allow_patterns,\n        revision=resolved_weight.inventory.resolved_revision or source.revision,\n    )\n    target = os.path.join(local_path, selected_file)\n    if not os.path.isfile(target):\n        raise FileNotFoundError(\n            f\"Resolved LoRA weight {selected_file!r} was not downloaded to {local_path}\"\n        )\n    return target\n\n\ndef verify_model_config_and_directory(model_path: str) -> dict[str, Any]:\n    \"\"\"\n    Verify that the model directory contains a valid diffusers configuration.\n\n    Args:\n        model_path: Path to the model directory\n\n    Returns:\n        The loaded model configuration as a dictionary\n    \"\"\"\n\n    # Check for model_index.json which is required for diffusers models\n    config_path = os.path.join(model_path, \"model_index.json\")","sourceCodeStart":662,"sourceCodeEnd":698,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/utils/hf_diffusers_utils.py#L662-L698","documentation":"maybe_download_lora downloads the resolved LoRA repo snapshot into local_path and then verifies selected_file landed on disk. If the expected file is missing after download (filtered out by allow_patterns, partial download, unexpected repo layout), FileNotFoundError.","triggerScenarios":"Calling load_lora_adapter on a remote LoRA repo where the resolved selected_file does not match the downloaded allow_patterns, or the download silently failed / was interrupted.","commonSituations":"HF repo restructured so the weight sits outside the patterns; flaky network yielding an incomplete snapshot; revision mismatch between resolve and download steps.","solutions":["Retry once after clearing the partial HF cache entry for the LoRA repo","Verify the file exists in the repo at the resolved revision (huggingface-cli repo-files or web UI) and that its path matches the selected weight name","Pre-download the LoRA locally and pass the local path + exact weight_name"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"import os\nassert os.path.isfile(os.path.join(local_path, selected_file)), 'download incomplete'","typeGuard":null,"tryCatchPattern":"for attempt in range(2):\n    try:\n        return maybe_download_lora(...)\n    except FileNotFoundError:\n        clear_hf_cache_entry(repo); continue","preventionTips":["Pre-download LoRAs locally before serving","Verify repo file layout matches selected weight paths"],"tags":["lora","download","cache"],"backgroundTag":"model-download-incomplete","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}