{"record":{"id":"de8be1a3d3f71f9c","repo":"sgl-project/sglang","slug":"weight-path-does-not-exist-local-path","errorCode":null,"errorMessage":"Weight path does not exist: {local_path}","messagePattern":"Weight path does not exist: (.+?)","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/weights/source.py","lineNumber":195,"sourceCode":"        return selected\n    if source.subfolder is None:\n        return files\n    prefix = source.subfolder.rstrip(\"/\") + \"/\"\n    selected = tuple(path for path in files if path.startswith(prefix))\n    if not selected:\n        raise FileNotFoundError(\n            f\"Weight subfolder {source.subfolder!r} was not found in {source.repo_id}\"\n        )\n    return selected\n\n\ndef resolve_weight_inventory(source: WeightSource) -> WeightInventory:\n    \"\"\"List source files and pin a remote source to an immutable revision.\"\"\"\n    if source.kind == \"local\":\n        assert source.local_path is not None\n        local_path = Path(source.local_path)\n        if not local_path.exists():\n            raise FileNotFoundError(f\"Weight path does not exist: {local_path}\")\n        if local_path.is_file():\n            files = (local_path.name,)\n        else:\n            files = tuple(\n                path.relative_to(local_path).as_posix()\n                for path in sorted(local_path.rglob(\"*\"))\n                if path.is_file()\n            )\n        return WeightInventory(\n            source=source,\n            resolved_revision=None,\n            files=files,\n        )\n\n    assert source.repo_id is not None\n    model_info = HfApi().model_info(\n        source.repo_id,\n        revision=source.revision,","sourceCodeStart":177,"sourceCodeEnd":213,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/weights/source.py#L177-L213","documentation":"For a local WeightSource, resolve_weight_inventory stats the configured local_path and it does not exist on disk. The local branch never touches the network, so this is purely a filesystem miss.","triggerScenarios":"Passing a local directory or file path that was moved/removed; relative path resolved against a different CWD; symlink to a missing target.","commonSituations":"Scripts run from a different working directory; paths from config files stale after data relocation; containers without mounted weights.","solutions":["Verify the absolute path exists (os.path.abspath is applied before the check)","Fix relative paths or run from the intended CWD","Mount/copy the weights to the expected location"],"exampleFix":"# before\nresolve_weight(\"./checkpoints/model\")  # run from wrong cwd\n# after\nresolve_weight(os.path.expanduser(\"~/models/checkpoints/model\"))","handlingStrategy":"validation","validationCode":"import os\nfrom pathlib import Path\n\np = Path(os.path.abspath(os.path.expanduser(source)))\nassert p.exists(), f\"missing weight path: {p}\"","typeGuard":null,"tryCatchPattern":"try:\n    inv = resolve_weight_inventory(src)\nexcept FileNotFoundError as e:\n    logger.error(\"local weights missing: %s\", e)\n    raise","preventionTips":["Expand and absolutize user paths before resolution","Fail fast in CLI startup on missing weight directories"],"tags":["local-filesystem","weights","path-not-found"],"backgroundTag":"path-not-found","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}