vllm-project/vllm · error · AttributeError
Class {connector_name} not found in {connector_module_path}
Error message
Class {connector_name} not found in {connector_module_path} What it means
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.
Source
Thrown at vllm/distributed/kv_transfer/kv_connector/factory.py:111
return cls._registry[connector_name]()
@classmethod
def get_connector_class(
cls, kv_transfer_config: "KVTransferConfig"
) -> type[KVConnectorBaseType]:
connector_name = kv_transfer_config.kv_connector
if connector_name is None:
raise ValueError("Connector name is not set in KVTransferConfig")
connector_module_path = kv_transfer_config.kv_connector_module_path
if connector_module_path is not None and not connector_module_path:
raise ValueError("kv_connector_module_path cannot be an empty string.")
if connector_module_path:
# External module path takes priority over internal registry.
connector_module = importlib.import_module(connector_module_path)
try:
connector_cls = getattr(connector_module, connector_name)
except AttributeError as e:
raise AttributeError(
f"Class {connector_name} not found in {connector_module_path}"
) from e
connector_cls = cast(type[KVConnectorBaseType], connector_cls)
if not supports_kw(connector_cls, "kv_cache_config"):
msg = (
f"Connector {connector_cls.__name__} uses deprecated "
"2-argument constructor signature. External v1 KV "
"connectors must accept kv_cache_config as the third "
"constructor argument and pass it to super().__init__()."
)
logger.error(msg)
raise ValueError(msg)
elif connector_name in cls._registry:
connector_cls = cls._registry[connector_name]()
else:
raise ValueError(f"Unsupported connector type: {connector_name}")
return connector_cls
View on GitHub (pinned to c794754062)
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
Example fix
# before kv_connector="FlexKVConnectorV1Impl", kv_connector_module_path="flexkv.integration.vllm" # after kv_connector="FlexKVConnectorV1Impl", kv_connector_module_path="flexkv.integration.vllm.vllm_v1_adapter"
Defensive patterns
Strategy: validation
Validate before calling
import importlib
mod = importlib.import_module(kv_transfer_config.kv_connector_module_path)
assert hasattr(mod, kv_transfer_config.kv_connector), (
f"{kv_transfer_config.kv_connector} not in {kv_transfer_config.kv_connector_module_path}"
) Type guard
def module_exports(module_path: str, cls_name: str) -> bool:
try:
return hasattr(importlib.import_module(module_path), cls_name)
except ImportError:
return False Try / catch
try:
cls = KVConnectorFactory.get_connector_class(cfg)
except AttributeError as e:
raise SystemExit(f"External connector class missing: {e}") from e Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Connector {connector_cls.__name__} uses deprecated 2-argumen
- FlexKV is not installed. Please install it to use FlexKVConn
- hf3fs_fuse.io is not available. Please install the hf3fs_fus
- HTTP request failed: {0}
- JSON error: {0}
AI-assisted analysis of vllm-project/vllm@c794754062 (2026-08-14).
Data as JSON: /api/errors/6fe4f14031cd8cc8.
Report an issue: GitHub.