{"record":{"id":"4abd63e8fc58c18f","repo":"Lightning-AI/pytorch-lightning","slug":"you-added-multiple-progress-bar-callbacks-to-the-t","errorCode":null,"errorMessage":"You added multiple progress bar callbacks to the Trainer, but currently only one progress bar is supported.","messagePattern":"You added multiple progress bar callbacks to the Trainer, but currently only one progress bar is supported\\.","errorType":"validation","errorClass":"MisconfigurationException","httpStatus":null,"severity":"error","filePath":"src/lightning/pytorch/trainer/connectors/callback_connector.py","lineNumber":135,"sourceCode":"        if not enable_model_summary:\n            return\n\n        model_summary_cbs = [type(cb) for cb in self.trainer.callbacks if isinstance(cb, ModelSummary)]\n        if model_summary_cbs:\n            rank_zero_info(\n                f\"Trainer already configured with model summary callbacks: {model_summary_cbs}.\"\n                \" Skipping setting a default `ModelSummary` callback.\"\n            )\n            return\n\n        model_summary: ModelSummary\n        model_summary = RichModelSummary() if _RICH_AVAILABLE else ModelSummary()\n        self.trainer.callbacks.append(model_summary)\n\n    def _configure_progress_bar(self, enable_progress_bar: bool = True) -> None:\n        progress_bars = [c for c in self.trainer.callbacks if isinstance(c, ProgressBar)]\n        if len(progress_bars) > 1:\n            raise MisconfigurationException(\n                \"You added multiple progress bar callbacks to the Trainer, but currently only one\"\n                \" progress bar is supported.\"\n            )\n        if len(progress_bars) == 1:\n            # the user specified the progress bar in the callbacks list\n            # so the trainer doesn't need to provide a default one\n            if enable_progress_bar:\n                return\n\n            # otherwise the user specified a progress bar callback but also\n            # elected to disable the progress bar with the trainer flag\n            progress_bar_callback = progress_bars[0]\n            raise MisconfigurationException(\n                \"Trainer was configured with `enable_progress_bar=False`\"\n                f\" but found `{progress_bar_callback.__class__.__name__}` in callbacks list.\"\n            )\n\n        if enable_progress_bar:","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/Lightning-AI/pytorch-lightning/blob/9fed5c27d2a62ff0efd6c3573599921d6ff67c14/src/lightning/pytorch/trainer/connectors/callback_connector.py#L117-L153","documentation":"Raised during Trainer initialization when more than one ProgressBar callback is found in the callbacks list. Lightning's progress bar rendering only supports a single active progress bar, so multiple instances (e.g., a TQDMProgressBar and a RichProgressBar together) are rejected.","triggerScenarios":"Passing callbacks=[TQDMProgressBar(), RichProgressBar()] or any two subclasses of ProgressBar; commonly from combining callback lists: base_callbacks + [RichProgressBar()] where the base already contains one.","commonSituations":"Concatenating reusable callback bundles with an extra progress bar; switching from TQDM to Rich and forgetting to remove the old one; test fixtures that append a progress bar to a default list.","solutions":["Keep only one ProgressBar subclass in callbacks","Deduplicate before constructing: callbacks=[cb for cb in callbacks if not isinstance(cb, ProgressBar)] + [RichProgressBar()]","Omit progress bar callbacks entirely and customize via enable_progress_bar plus defaults"],"exampleFix":"# before\ntrainer = Trainer(callbacks=[TQDMProgressBar(), RichProgressBar()])\n# after\ntrainer = Trainer(callbacks=[RichProgressBar()])","handlingStrategy":"validation","validationCode":"from lightning.pytorch.callbacks.progress import ProgressBar\n\ncbs = [c for c in callbacks if not isinstance(c, ProgressBar)] + [my_progress_bar]\nassert sum(isinstance(c, ProgressBar) for c in cbs) <= 1\ntrainer = Trainer(callbacks=cbs)","typeGuard":"def has_single_progress_bar(callbacks) -> bool:\n    from lightning.pytorch.callbacks import ProgressBar\n    return sum(isinstance(c, ProgressBar) for c in callbacks) <= 1","tryCatchPattern":null,"preventionTips":["Deduplicate ProgressBar instances whenever merging callback bundles","Centralize progress bar choice (TQDM vs Rich) in one config point"],"tags":["lightning","progress-bar","callbacks","trainer-init","duplicate-callbacks"],"backgroundTag":"duplicate-callback-instances","analyzedSha":"9fed5c27d2a62ff0efd6c3573599921d6ff67c14","analyzedAt":"2026-08-28T11:52:41.083Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}