{"record":{"id":"b82f399115d2fbda","repo":"sgl-project/sglang","slug":"mooncakestore-with-standalone-storage-true-require","errorCode":null,"errorMessage":"MooncakeStore with standalone_storage=True requires MooncakeHostTensorAllocator. Please set standalone_storage=False or upgrade Mooncake by 'pip install mooncake-transfer-engine --upgrade'.","messagePattern":"MooncakeStore with standalone_storage=True requires MooncakeHostTensorAllocator\\. Please set standalone_storage=False or upgrade Mooncake by 'pip install mooncake-transfer-engine --upgrade'\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/mem_cache/storage/mooncake_store/mooncake_store.py","lineNumber":460,"sourceCode":"            if device_name and device_name.strip().startswith(\"{\"):\n                try:\n                    device_config = json.loads(device_name)\n                    if storage_config and hasattr(storage_config, \"tp_rank\"):\n                        tp_rank = storage_config.tp_rank\n                        # Try both integer and string keys since JSON parsing may convert keys\n                        device_name = device_config.get(tp_rank, \"\")\n                        if not device_name:\n                            device_name = device_config.get(str(tp_rank), \"\")\n                    else:\n                        device_name = \"\"\n                except (json.JSONDecodeError, AttributeError):\n                    logger.warning(\n                        f\"Failed to parse device_name as JSON: {device_name}\"\n                    )\n                    device_name = \"\"\n            if self.config.standalone_storage:\n                if not isinstance(mem_pool.allocator, MooncakeHostTensorAllocator):\n                    raise RuntimeError(\n                        \"MooncakeStore with standalone_storage=True requires MooncakeHostTensorAllocator. \"\n                        \"Please set standalone_storage=False \"\n                        \"or upgrade Mooncake by 'pip install mooncake-transfer-engine --upgrade'.\"\n                    )\n                required_bytes = self._standalone_required_bytes(mem_pool)\n                ret_code = self.store.setup_dummy(\n                    required_bytes,\n                    DEFAULT_LOCAL_BUFFER_SIZE,  # Zero copy interface does not need local buffer\n                    self.config.client_server_address,\n                )\n            else:\n                try:\n                    from sglang.srt.distributed.parallel_state import (\n                        get_mooncake_transfer_engine,\n                    )\n\n                    self._shared_mooncake_transfer_engine = (\n                        get_mooncake_transfer_engine()","sourceCodeStart":442,"sourceCodeEnd":478,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/mem_cache/storage/mooncake_store/mooncake_store.py#L442-L478","documentation":"standalone_storage=True requires the host pool to be allocated by MooncakeHostTensorAllocator (memory owned/registered by the transfer engine via setup_dummy), but the pool's allocator is a different type, so initialization aborts.","triggerScenarios":"Configuring MooncakeStore with standalone_storage=True while the host KV pool uses the default (mmap/other) allocator instead of MooncakeHostTensorAllocator.","commonSituations":"Enabling the standalone-storage option on an older Mooncake/SGLang combination; forgetting to set the allocator type in server args when enabling standalone storage.","solutions":["Set standalone_storage=False","Or configure the host pool to use MooncakeHostTensorAllocator (correct server flag/env)","Or pip install mooncake-transfer-engine --upgrade so the required allocator path is available"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"assert not cfg.standalone_storage or isinstance(pool.allocator, MooncakeHostTensorAllocator), \\\n    'standalone_storage=True needs MooncakeHostTensorAllocator'","typeGuard":"def standalone_ok(pool, standalone: bool) -> bool:\n    return (not standalone) or isinstance(\n        getattr(pool, 'allocator', None), MooncakeHostTensorAllocator\n    )","tryCatchPattern":"try:\n    ms = MooncakeStore(...)\nexcept RuntimeError as e:\n    if 'standalone_storage=True requires' in str(e):\n        cfg.standalone_storage = False\n        ms = MooncakeStore(cfg)  # fallback mode\n    else:\n        raise","preventionTips":["Match standalone_storage flag with the configured allocator","Pin compatible versions of mooncake-transfer-engine and SGLang"],"tags":["mooncake","allocator","standalone-storage","config"],"backgroundTag":"incompatible-configuration","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}