{"record":{"id":"cd0f549b578d355b","repo":"sgl-project/sglang","slug":"failed-to-load-config-from-file-path-str-e","errorCode":null,"errorMessage":"Failed to load config from {file_path}: {str(e)}","messagePattern":"Failed to load config from (.+?): (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/mem_cache/storage/mooncake_store/mooncake_store.py","lineNumber":121,"sourceCode":"    standalone_storage: bool\n    client_server_address: str\n    enable_ssd_offload: bool = False\n    ssd_offload_path: Optional[str] = None\n    tenant_id: str = DEFAULT_TENANT_ID\n\n    @staticmethod\n    def from_file() -> \"MooncakeStoreConfig\":\n        \"\"\"Load the config from a JSON file.\"\"\"\n        if not envs.SGLANG_HICACHE_MOONCAKE_CONFIG_PATH.is_set():\n            raise RuntimeError(\n                f\"Config file path not set. Please set {envs.SGLANG_HICACHE_MOONCAKE_CONFIG_PATH.name}\"\n            )\n        file_path = envs.SGLANG_HICACHE_MOONCAKE_CONFIG_PATH.get()\n        try:\n            with open(file_path) as fin:\n                config = json.load(fin)\n        except Exception as e:\n            raise RuntimeError(f\"Failed to load config from {file_path}: {str(e)}\")\n\n        if (\n            \"master_server_address\" not in config\n            and \"client_server_address\" not in config\n        ):\n            raise ValueError(\n                \"Either master_server_address or client_server_address is required in config file\"\n            )\n\n        return MooncakeStoreConfig(\n            local_hostname=config.get(\n                \"local_hostname\", envs.MOONCAKE_LOCAL_HOSTNAME.default\n            ),\n            metadata_server=config.get(\n                \"metadata_server\", envs.MOONCAKE_TE_META_DATA_SERVER.default\n            ),\n            global_segment_size=_parse_global_segment_size(\n                config.get(","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/mem_cache/storage/mooncake_store/mooncake_store.py#L103-L139","documentation":"The JSON file pointed to by SGLANG_HICACHE_MOONCAKE_CONFIG_PATH could not be opened or parsed (json.load raised). The message includes the path and the underlying exception text (FileNotFoundError, PermissionError, or JSONDecodeError).","triggerScenarios":"from_file() with a nonexistent/wrong path, unreadable file, malformed JSON (trailing commas, comments), or an empty file.","commonSituations":"Typo in the env var path; config mounted at a different path in the container; JSON written by hand with comments or single quotes.","solutions":["Validate the path exists and is readable","python -m json.tool config.json to find the syntax error","Fix the JSON and restart; check mount paths in containers"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"import json, os\np = os.environ.get('SGLANG_HICACHE_MOONCAKE_CONFIG_PATH')\nif p:\n    assert os.path.isfile(p) and os.access(p, os.R_OK), f'unreadable: {p}'\n    json.load(open(p))  # raises early with precise JSONDecodeError","typeGuard":null,"tryCatchPattern":"try:\n    cfg = MooncakeStoreConfig.from_file()\nexcept RuntimeError as e:\n    if 'Failed to load config from' in str(e):\n        show_config_lint_error(e.__cause__)  # actionable JSON error\n        raise","preventionTips":["Run python -m json.tool on config in CI","Mount configs read-only into containers at fixed paths"],"tags":["config","json","file-io","mooncake"],"backgroundTag":"config-file-parse-failed","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}