{"record":{"id":"0ebc4f0cec12d25a","repo":"vllm-project/vllm","slug":"ec-transfer-config-must-be-set-to-create-a-connect","errorCode":null,"errorMessage":"ec_transfer_config must be set to create a connector","messagePattern":"ec_transfer_config must be set to create a connector","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"vllm/distributed/ec_transfer/ec_connector/factory.py","lineNumber":43,"sourceCode":"        \"\"\"Register a connector with a lazy-loading module and class name.\"\"\"\n        if name in cls._registry:\n            raise ValueError(f\"Connector '{name}' is already registered.\")\n\n        def loader() -> type[ECConnectorBase]:\n            module = importlib.import_module(module_path)\n            return getattr(module, class_name)\n\n        cls._registry[name] = loader\n\n    @classmethod\n    def create_connector(\n        cls,\n        config: \"VllmConfig\",\n        role: ECConnectorRole,\n    ) -> ECConnectorBase:\n        ec_transfer_config = config.ec_transfer_config\n        if ec_transfer_config is None:\n            raise ValueError(\"ec_transfer_config must be set to create a connector\")\n        connector_cls = cls.get_connector_class(ec_transfer_config)\n        logger.info(\n            \"Creating connector with name: %s and engine_id: %s\",\n            connector_cls.__name__,\n            ec_transfer_config.engine_id,\n        )\n        # Connector is explicitly separated into two roles.\n        # Scheduler connector:\n        # - Co-locate with scheduler process\n        # - Should only be used inside the Scheduler class\n        # Worker connector:\n        # - Co-locate with worker process\n        return connector_cls(config, role)\n\n    @classmethod\n    def get_connector_class(\n        cls, ec_transfer_config: \"ECTransferConfig\"\n    ) -> type[ECConnectorBase]:","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/vllm-project/vllm/blob/c794754062d49a8fdb63ab3c5215b488b865030c/vllm/distributed/ec_transfer/ec_connector/factory.py#L25-L61","documentation":"ECConnectorFactory.create_connector() needs config.ec_transfer_config both to look up the connector class and to stamp engine_id on the created instance. A VllmConfig with ec_transfer_config=None means EC transfer was never enabled, so there is nothing sensible to construct and the factory raises ValueError.","triggerScenarios":"Calling ECConnectorFactory.create_connector(vllm_config, role) when EC transfer options were not passed (ec_transfer_config stays None); invoking connector creation in a code path reached without the feature flag; building partial configs in scripts/tests.","commonSituations":"Feature-gated code that constructs connectors unconditionally instead of behind an `if vllm_config.ec_transfer_config is not None` check; scheduler/worker code paths exercised in unit tests with default configs.","solutions":["Only call create_connector when ec_transfer_config is set; gate the call site","Enable EC transfer via its documented config/CLI so ec_transfer_config is populated","In tests, attach a minimal ECTransferConfig before calling the factory"],"exampleFix":"# before\nconnector = ECConnectorFactory.create_connector(vllm_config, role)\n\n# after\nif vllm_config.ec_transfer_config is not None:\n    connector = ECConnectorFactory.create_connector(vllm_config, role)\nelse:\n    connector = None","handlingStrategy":"validation","validationCode":"if vllm_config.ec_transfer_config is None:\n    connector = None  # EC transfer disabled\nelse:\n    connector = ECConnectorFactory.create_connector(vllm_config, role)","typeGuard":"def can_create_ec_connector(config) -> bool:\n    return getattr(config, \"ec_transfer_config\", None) is not None","tryCatchPattern":null,"preventionTips":["Feature-gate every create_connector call site on ec_transfer_config","Enable EC transfer through the supported flags so config is populated","Test both branches (config present/absent) in connector-using code"],"tags":["configuration","ec-transfer","factory"],"backgroundTag":null,"analyzedSha":"c794754062d49a8fdb63ab3c5215b488b865030c","analyzedAt":"2026-08-14T21:17:39.825Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}