{"record":{"id":"6fe4f14031cd8cc8","repo":"vllm-project/vllm","slug":"class-connector-name-not-found-in-connector-mod","errorCode":null,"errorMessage":"Class {connector_name} not found in {connector_module_path}","messagePattern":"Class (.+?) not found in (.+?)","errorType":"exception","errorClass":"AttributeError","httpStatus":null,"severity":"error","filePath":"vllm/distributed/kv_transfer/kv_connector/factory.py","lineNumber":111,"sourceCode":"        return cls._registry[connector_name]()\n\n    @classmethod\n    def get_connector_class(\n        cls, kv_transfer_config: \"KVTransferConfig\"\n    ) -> type[KVConnectorBaseType]:\n        connector_name = kv_transfer_config.kv_connector\n        if connector_name is None:\n            raise ValueError(\"Connector name is not set in KVTransferConfig\")\n        connector_module_path = kv_transfer_config.kv_connector_module_path\n        if connector_module_path is not None and not connector_module_path:\n            raise ValueError(\"kv_connector_module_path cannot be an empty string.\")\n        if connector_module_path:\n            # External module path takes priority over internal registry.\n            connector_module = importlib.import_module(connector_module_path)\n            try:\n                connector_cls = getattr(connector_module, connector_name)\n            except AttributeError as e:\n                raise AttributeError(\n                    f\"Class {connector_name} not found in {connector_module_path}\"\n                ) from e\n            connector_cls = cast(type[KVConnectorBaseType], connector_cls)\n            if not supports_kw(connector_cls, \"kv_cache_config\"):\n                msg = (\n                    f\"Connector {connector_cls.__name__} uses deprecated \"\n                    \"2-argument constructor signature. External v1 KV \"\n                    \"connectors must accept kv_cache_config as the third \"\n                    \"constructor argument and pass it to super().__init__().\"\n                )\n                logger.error(msg)\n                raise ValueError(msg)\n        elif connector_name in cls._registry:\n            connector_cls = cls._registry[connector_name]()\n        else:\n            raise ValueError(f\"Unsupported connector type: {connector_name}\")\n        return connector_cls\n","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/vllm-project/vllm/blob/c794754062d49a8fdb63ab3c5215b488b865030c/vllm/distributed/kv_transfer/kv_connector/factory.py#L93-L129","documentation":"The factory imported the external module given by kv_connector_module_path, but getattr(module, connector_name) raised AttributeError: the module has no attribute with the connector class name from kv_connector. The original AttributeError is re-raised with a clearer message.","triggerScenarios":"kv_connector_module_path points to a valid Python module, but the class named by kv_connector is absent — wrong class name, class not imported into that module's namespace (__init__.py missing the re-export), or the module installed is a different version.","commonSituations":"External connector package where the class lives in a submodule but kv_connector_module_path names the package; renaming the connector class without updating configs; stale installed version of the external package.","solutions":["Verify the class exists: python -c \"import my_pkg.connectors as m; print(m.MyConnector)\"","Fix the name in kv_connector to the exact class name, or fix the module path to the module that defines/re-exports the class","Reinstall/upgrade the external connector package so the expected class is present"],"exampleFix":"# before\nkv_connector=\"FlexKVConnectorV1Impl\", kv_connector_module_path=\"flexkv.integration.vllm\"\n\n# after\nkv_connector=\"FlexKVConnectorV1Impl\", kv_connector_module_path=\"flexkv.integration.vllm.vllm_v1_adapter\"","handlingStrategy":"validation","validationCode":"import importlib\nmod = importlib.import_module(kv_transfer_config.kv_connector_module_path)\nassert hasattr(mod, kv_transfer_config.kv_connector), (\n    f\"{kv_transfer_config.kv_connector} not in {kv_transfer_config.kv_connector_module_path}\"\n)","typeGuard":"def module_exports(module_path: str, cls_name: str) -> bool:\n    try:\n        return hasattr(importlib.import_module(module_path), cls_name)\n    except ImportError:\n        return False","tryCatchPattern":"try:\n    cls = KVConnectorFactory.get_connector_class(cfg)\nexcept AttributeError as e:\n    raise SystemExit(f\"External connector class missing: {e}\") from e","preventionTips":["Smoke-test the module/class pair in CI for external connectors","Re-export connector classes from the package __init__ named in the module path","Pin versions of external connector packages"],"tags":["kv-transfer","import","external-connector","vllm"],"backgroundTag":null,"analyzedSha":"c794754062d49a8fdb63ab3c5215b488b865030c","analyzedAt":"2026-08-14T21:17:39.825Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}