{"record":{"id":"5f4374804610ab19","repo":"sgl-project/sglang","slug":"expert-pack-or-manifest-is-missing-self-path","errorCode":null,"errorMessage":"expert-pack or manifest is missing: {self.path}, {self.manifest_path}","messagePattern":"expert-pack or manifest is missing: (.+?), (.+?)","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"critical","filePath":"python/sglang/srt/layers/moe/expert_pack.py","lineNumber":260,"sourceCode":"        expected_top_k: int,\n        expected_source_sha256: str | None = None,\n        expected_model_identity_sha256: str | None = None,\n        expected_config_sha256: str | None = None,\n        cache_vram_mib: int = 20 * 1024,\n        cache_vram_reserve_mib: int = 3 * 1024,\n        stage_slots: int = 8,\n        read_splits: int = READ_SPLITS,\n        direct_io: bool = False,\n        stats_flush_interval: int = 0,\n        verify_pack_sha256: bool = False,\n        stats_path: str | os.PathLike[str] | None = None,\n    ) -> None:\n        self.path = Path(pack_path).resolve()\n        self.manifest_path = Path(\n            manifest_path or str(self.path) + \".manifest.json\"\n        ).resolve()\n        if not self.path.is_file() or not self.manifest_path.is_file():\n            raise FileNotFoundError(\n                f\"expert-pack or manifest is missing: {self.path}, {self.manifest_path}\"\n            )\n        self.manifest = json.loads(self.manifest_path.read_text(encoding=\"utf-8\"))\n        if not self.manifest.get(\"complete\"):\n            raise ValueError(\"expert-pack manifest is not complete\")\n\n        with self.path.open(\"rb\", buffering=0) as stream:\n            self.header = ExpertPackHeader.read(stream)\n            entries = [\n                ExpertPackEntry.read(stream) for _ in range(self.header.index_count)\n            ]\n\n        expected_dimensions = (expected_layers, expected_experts, expected_top_k)\n        actual_dimensions = (\n            self.header.num_layers,\n            self.header.num_experts,\n            self.header.top_k,\n        )","sourceCodeStart":242,"sourceCodeEnd":278,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/layers/moe/expert_pack.py#L242-L278","documentation":"ExpertPackStore.__init__ raises FileNotFoundError when either the pack file (self.path) or its sidecar manifest (default: <pack>.manifest.json) does not exist as a regular file. Both files are mandatory: the pack holds the binary data, the manifest holds completeness and checksum metadata.","triggerScenarios":"Constructing ExpertPackStore(\"experts.pack\") where experts.pack or experts.pack.manifest.json is missing, moved, or is a directory/symlink-to-nowhere; or passing a manifest_path that doesn't exist.","commonSituations":"Wrong or relative path resolved against a different CWD (paths are .resolve()'d); manifest not copied alongside the pack during distribution; typos in filenames; pack still being written (manifest written last).","solutions":["Check both paths exist and re-copy the missing manifest sidecar next to the pack","Use absolute paths or resolve relative to a known base directory instead of CWD","If the pack was mid-export, wait for the packer to finish writing the manifest before loading"],"exampleFix":"# before\nstore = ExpertPackStore(\"weights/mymodel.expertpack\")  # manifest not copied\n\n# after\nfrom pathlib import Path\nbase = Path(\"/models/mymodel\")\nstore = ExpertPackStore(base / \"mymodel.expertpack\",\n                        manifest_path=base / \"mymodel.expertpack.manifest.json\")","handlingStrategy":"validation","validationCode":"from pathlib import Path\n\ndef pack_and_manifest_exist(pack_path, manifest_path=None):\n    p = Path(pack_path).resolve()\n    m = Path(manifest_path or str(p) + \".manifest.json\").resolve()\n    return p.is_file() and m.is_file(), p, m","typeGuard":null,"tryCatchPattern":"try:\n    store = ExpertPackStore(pack_path)\nexcept FileNotFoundError as e:\n    logger.error(\"missing pack artifacts: %s\", e)\n    raise","preventionTips":["Distribute the pack and its .manifest.json sidecar together","Build paths from an absolute base directory, not CWD-relative strings","Before loading, assert both files exist and the manifest marks complete=true"],"tags":["moe","expert-pack","file-not-found","manifest","path-resolution"],"backgroundTag":"file-not-found","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}