{"record":{"id":"8b66cdf0fc9f5afb","repo":"langflow-ai/langflow","slug":"a-deactivated-duplicate-exists-at-deactivated-dup","errorCode":null,"errorMessage":"A deactivated duplicate exists at {deactivated_dup}.  Resolve the duplicate manually before porting -- see src/bundles/PORTING.md § 0.","messagePattern":"A deactivated duplicate exists at (.+?)\\.  Resolve the duplicate manually before porting -- see src/bundles/PORTING\\.md § 0\\.","errorType":"console","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"scripts/migrate/port_bundle.py","lineNumber":694,"sourceCode":"\n    in_tree = LFX_COMPONENTS / bundle\n    if not in_tree.is_dir():\n        msg = f\"In-tree provider directory not found: {in_tree}\"\n        raise SystemExit(msg)\n\n    bundle_dir = BUNDLES_DIR / bundle\n    if bundle_dir.exists():\n        msg = f\"Bundle directory already exists: {bundle_dir}.  Refusing to overwrite.\"\n        raise SystemExit(msg)\n\n    deactivated_dup = LFX_COMPONENTS / \"deactivated\" / bundle\n    if deactivated_dup.is_dir():\n        msg = (\n            f\"A deactivated duplicate exists at {deactivated_dup}.  Resolve \"\n            \"the duplicate manually before porting -- see \"\n            \"src/bundles/PORTING.md § 0.\"\n        )\n        raise SystemExit(msg)\n\n    component_files: list[ComponentFile] = []\n    nested_subdirs: list[Path] = []\n    for src in sorted(in_tree.iterdir()):\n        if src.is_dir():\n            if src.name == \"__pycache__\":\n                continue\n            # Nested subpackage (e.g. ``agentics/helpers``); validate\n            # its files for ``from langflow`` imports too, then plan\n            # to move the whole subdir wholesale.\n            for nested in src.rglob(\"*.py\"):\n                if \"__pycache__\" in nested.parts:\n                    continue\n                text = nested.read_text(encoding=\"utf-8\")\n                if \"from langflow\" in text:\n                    msg = (\n                        f\"{nested} imports from ``langflow`` -- the bundle is \"\n                        \"installed against the public BUNDLE_API surface (lfx), \"","sourceCodeStart":676,"sourceCodeEnd":712,"githubUrl":"https://github.com/langflow-ai/langflow/blob/976ec789d2886a86de109c044d089d68e96c9a35/scripts/migrate/port_bundle.py#L676-L712","documentation":"Fourth guard: port_bundle.py also checks LFX_COMPONENTS/deactivated/<bundle>. A provider parked under 'deactivated' with the same name means there are two versions of the provider (one active in-tree, one deactivated). Porting the active one while the deactivated twin exists would create ambiguity in the migration mapping, so the script refuses and points at the documented manual resolution procedure in src/bundles/PORTING.md section 0.","triggerScenarios":"Running port_bundle.py --bundle <name> when both src/lfx/src/lfx/components/<name>/ and src/lfx/src/lfx/components/deactivated/<name>/ exist.","commonSituations":"Providers that were temporarily disabled during an earlier migration cycle and later restored; merge of branches where one side deactivated the provider and the other revived it.","solutions":["Compare the two directories (git log, diff) to decide which version is canonical.","Delete or rename the stale duplicate under deactivated/ per src/bundles/PORTING.md § 0.","Re-run the port once only the in-tree copy remains."],"exampleFix":"# before\nls src/lfx/src/lfx/components/deactivated/agentics  # exists\npython scripts/migrate/port_bundle.py --bundle agentics\n# error: A deactivated duplicate exists at ...\n\n# after\ngit rm -r src/lfx/src/lfx/components/deactivated/agentics  # after verifying it is stale\npython scripts/migrate/port_bundle.py --bundle agentics --apply","handlingStrategy":"validation","validationCode":"from pathlib import Path\n\nLFX_COMPONENTS = Path(\"src/lfx/src/lfx/components\")\n\ndef no_deactivated_duplicate(bundle: str) -> bool:\n    return not (LFX_COMPONENTS / \"deactivated\" / bundle).is_dir()","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Before porting, diff components/<name> against components/deactivated/<name> and delete the stale twin.","Follow src/bundles/PORTING.md § 0 — it is the canonical duplicate-resolution runbook."],"tags":["migration","duplicate","validation","cli"],"backgroundTag":null,"analyzedSha":"976ec789d2886a86de109c044d089d68e96c9a35","analyzedAt":"2026-08-14T18:23:12.227Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}