{"record":{"id":"e2ed5c898c57175a","repo":"Lightning-AI/pytorch-lightning","slug":"received-multiple-values-for-join-duplicated","errorCode":null,"errorMessage":"Received multiple values for {', '.join(duplicated_plugin_key)} flags in `plugins`. Expected one value for each type at most.","messagePattern":"Received multiple values for (.+?) flags in `plugins`\\. Expected one value for each type at most\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/lightning/fabric/connector.py","lineNumber":247,"sourceCode":"            for plugin in plugins:\n                if isinstance(plugin, Precision):\n                    self._precision_instance = plugin\n                    plugins_flags_types[Precision.__name__] += 1\n                elif isinstance(plugin, CheckpointIO):\n                    self.checkpoint_io = plugin\n                    plugins_flags_types[CheckpointIO.__name__] += 1\n                elif isinstance(plugin, ClusterEnvironment):\n                    self._cluster_environment_flag = plugin\n                    plugins_flags_types[ClusterEnvironment.__name__] += 1\n                else:\n                    raise TypeError(\n                        f\"Found invalid type for plugin {plugin}. Expected one of: Precision, \"\n                        \"CheckpointIO, ClusterEnvironment.\"\n                    )\n\n            duplicated_plugin_key = [k for k, v in plugins_flags_types.items() if v > 1]\n            if duplicated_plugin_key:\n                raise ValueError(\n                    f\"Received multiple values for {', '.join(duplicated_plugin_key)} flags in `plugins`.\"\n                    \" Expected one value for each type at most.\"\n                )\n\n            if plugins_flags_types.get(Precision.__name__) and precision_input is not None:\n                raise ValueError(\n                    f\"Received both `precision={precision_input}` and `plugins={self._precision_instance}`. Choose one.\"\n                )\n\n        self._precision_input = \"32-true\" if precision_input is None else precision_input\n\n        # handle the case when the user passes in a strategy instance which has an accelerator, precision,\n        # checkpoint io or cluster env set up\n        # TODO: improve the error messages below\n        if isinstance(self._strategy_flag, Strategy):\n            if self._strategy_flag._accelerator:\n                if self._accelerator_flag != \"auto\":\n                    raise ValueError(\"accelerator set through both strategy class and accelerator flag, choose one\")","sourceCodeStart":229,"sourceCodeEnd":265,"githubUrl":"https://github.com/Lightning-AI/pytorch-lightning/blob/9fed5c27d2a62ff0efd6c3573599921d6ff67c14/src/lightning/fabric/connector.py#L229-L265","documentation":"Raised by Lightning Fabric's connector when the `plugins` argument receives more than one plugin of the same category (e.g. two Precision plugins or two CheckpointIO plugins). Fabric allows at most one plugin per type: Precision, CheckpointIO, and ClusterEnvironment. The duplicate check counts plugin class names and fails when any count exceeds 1.","triggerScenarios":"Calling Fabric(plugins=[MixedPrecision(...), DeepSpeedPrecision(...)]) or Fabric(plugins=[CheckpointIO(), TorchCheckpointIO()]) — i.e. passing a list to `plugins` containing two instances whose classes map to the same plugin type key.","commonSituations":"Copying plugin lists from different examples/tutorials into one config; upgrading configs where a precision plugin was already included and another was added; mixing DeepSpeed + MixedPrecision plugins; enabling both a custom CheckpointIO and a built-in one.","solutions":["Inspect the `plugins` list and keep only one plugin per category (Precision, CheckpointIO, ClusterEnvironment)","If you need mixed precision, keep only the Precision plugin and remove redundant ones","Pass unrelated plugin types together (one Precision + one CheckpointIO is fine) — only same-type duplicates are rejected"],"exampleFix":"# before\nfabric = Fabric(plugins=[MixedPrecision(\"16-mixed\", device=\"cuda\"), DeepSpeedPrecision(...)])\n\n# after\nfabric = Fabric(plugins=[MixedPrecision(\"16-mixed\", device=\"cuda\")])","handlingStrategy":"validation","validationCode":"from lightning.fabric.plugins import Precision, CheckpointIO, ClusterEnvironment\n\ndef plugin_counts_ok(plugins):\n    counts = {}\n    for p in plugins:\n        for t in (Precision, CheckpointIO, ClusterEnvironment):\n            if isinstance(p, t):\n                counts[t.__name__] = counts.get(t.__name__, 0) + 1\n    return all(v <= 1 for v in counts.values())\n\nassert plugin_counts_ok(plugins), \"duplicate plugin type in plugins list\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep plugins in one place in your config and review the list before constructing Fabric","Never combine two precision-related plugins; use a single Precision plugin or the precision string"],"tags":["lightning","fabric","plugins","config-validation","duplicate-argument"],"backgroundTag":"duplicate-plugin-configuration","analyzedSha":"9fed5c27d2a62ff0efd6c3573599921d6ff67c14","analyzedAt":"2026-08-28T11:52:41.083Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}