{"record":{"id":"dcfb6fd84ad73e6f","repo":"vllm-project/vllm","slug":"kv-connector-module-path-cannot-be-an-empty-string","errorCode":null,"errorMessage":"kv_connector_module_path cannot be an empty string.","messagePattern":"kv_connector_module_path cannot be an empty string\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"vllm/distributed/kv_transfer/kv_connector/factory.py","lineNumber":104,"sourceCode":"            connector_name: Name of the registered connector.\n\n        Returns:\n            The connector class.\n        \"\"\"\n        if connector_name not in cls._registry:\n            raise ValueError(f\"Connector '{connector_name}' is not registered.\")\n        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)","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/vllm-project/vllm/blob/c794754062d49a8fdb63ab3c5215b488b865030c/vllm/distributed/kv_transfer/kv_connector/factory.py#L86-L122","documentation":"kv_connector_module_path was set to an empty string, which the factory treats as an invalid value (None means 'use registry', a non-empty string means 'import this module'). An empty string is almost always a serialization/template artifact rather than an intentional choice, so it is rejected explicitly.","triggerScenarios":"Passing kv_connector_module_path=\"\" in --kv-transfer-config JSON or in a programmatically built KVTransferConfig; often from templated configs where the field is filled conditionally.","commonSituations":"Helm/YAML templates that render an empty module path; env-var-driven configs that expand to empty; copying an example config and blanking the field instead of deleting it.","solutions":["Remove the kv_connector_module_path key (or set it to null) when using a built-in connector","Set it to the real importable module path when using an external connector, e.g. \"my_pkg.connectors\""],"exampleFix":"# before\n{\"kv_connector\": \"NixlConnector\", \"kv_connector_module_path\": \"\"}\n\n# after\n{\"kv_connector\": \"NixlConnector\"}\n# or\n{\"kv_connector\": \"MyConnector\", \"kv_connector_module_path\": \"my_pkg.connectors\"}","handlingStrategy":"validation","validationCode":"path = kv_transfer_config.kv_connector_module_path\nif path is not None and not path:\n    kv_transfer_config.kv_connector_module_path = None  # normalize empty to None","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Normalize empty-string optional fields to None when templating configs","Lint rendered configs for empty-valued keys before deployment"],"tags":["kv-transfer","config","validation","vllm"],"backgroundTag":null,"analyzedSha":"c794754062d49a8fdb63ab3c5215b488b865030c","analyzedAt":"2026-08-14T21:17:39.825Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}