{"record":{"id":"9a198c959f685563","repo":"vllm-project/vllm","slug":"ec-transfer-config-must-be-set-for-ecconnectorbase","errorCode":null,"errorMessage":"ec_transfer_config must be set for ECConnectorBase","messagePattern":"ec_transfer_config must be set for ECConnectorBase","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"vllm/distributed/ec_transfer/ec_connector/base.py","lineNumber":68,"sourceCode":"class ECConnectorMetadata(ABC):  # noqa: B024\n    \"\"\"\n    Abstract Metadata used to communicate between the\n    Scheduler ECConnector and Worker ECConnector.\n    \"\"\"\n\n    pass\n\n\nclass ECConnectorBase(ABC):\n    def __init__(self, vllm_config: \"VllmConfig\", role: ECConnectorRole):\n        self._connector_metadata: ECConnectorMetadata | None = None\n        self._vllm_config = vllm_config\n        self._role = role\n        if vllm_config.ec_transfer_config is not None:\n            self._is_producer = vllm_config.ec_transfer_config.is_ec_producer\n            self._is_consumer = vllm_config.ec_transfer_config.is_ec_consumer\n        else:\n            raise ValueError(\"ec_transfer_config must be set for ECConnectorBase\")\n\n    @property\n    def role(self) -> ECConnectorRole:\n        return self._role\n\n    @property\n    def is_producer(self) -> bool:\n        return self._is_producer\n\n    @property\n    def is_consumer(self) -> bool:\n        return self._is_consumer\n\n    def shutdown(self) -> None:\n        \"\"\"\n        Shutdown the connector. This is called when the process\n        is shutting down to ensure that all the async operations are\n        completed and the connector is cleaned up properly.","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/vllm-project/vllm/blob/c794754062d49a8fdb63ab3c5215b488b865030c/vllm/distributed/ec_transfer/ec_connector/base.py#L50-L86","documentation":"ECConnectorBase (base class for encoder-cache transfer connectors) requires vllm_config.ec_transfer_config to be set, because it derives its is_producer/is_consumer role flags from it. Constructing any EC connector without an ECTransferConfig means the connector cannot know which side of the producer/consumer split it is on, so __init__ raises ValueError.","triggerScenarios":"Instantiating a CPU/example EC connector from a VllmConfig that has ec_transfer_config=None; programmatic construction of a connector in tests or tooling that builds a partial VllmConfig; enabling the EC transfer feature without wiring the config object.","commonSituations":"Writing unit tests that build VllmConfig() defaults and then construct ECConnector classes; integrating EC transfer into a custom entrypoint that forgets to set ec_transfer_config; version upgrades where the config became mandatory for this path.","solutions":["Set ec_transfer_config on the VllmConfig before constructing the connector (enable the EC transfer feature via its documented CLI/env option so the config is populated)","In tests, construct a minimal ECTransferConfig with is_ec_producer/is_ec_consumer set and assign it to the config","Guard construction: only build connectors when vllm_config.ec_transfer_config is not None"],"exampleFix":"# before\nconnector = ECCPUConnector(vllm_config)  # ec_transfer_config is None\n\n# after\nfrom vllm.config import ECTransferConfig\nvllm_config.ec_transfer_config = ECTransferConfig(is_ec_producer=True)\nconnector = ECCPUConnector(vllm_config)","handlingStrategy":"validation","validationCode":"if vllm_config.ec_transfer_config is None:\n    raise RuntimeError(\"enable EC transfer before constructing EC connectors\")","typeGuard":"def has_ec_config(vllm_config) -> bool:\n    return getattr(vllm_config, \"ec_transfer_config\", None) is not None","tryCatchPattern":null,"preventionTips":["Gate all EC connector construction behind an ec_transfer_config None-check","In tests, build a minimal ECTransferConfig fixture and attach it first","Enable the feature through documented flags so config plumbing is done for you"],"tags":["configuration","ec-transfer","api-misuse"],"backgroundTag":null,"analyzedSha":"c794754062d49a8fdb63ab3c5215b488b865030c","analyzedAt":"2026-08-14T21:17:39.825Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}