langflow-ai/langflow · error · SystemExit

A deactivated duplicate exists at {deactivated_dup}. Resolv

Error message

A deactivated duplicate exists at {deactivated_dup}.  Resolve the duplicate manually before porting -- see src/bundles/PORTING.md § 0.

What it means

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.

Source

Thrown at scripts/migrate/port_bundle.py:694

    in_tree = LFX_COMPONENTS / bundle
    if not in_tree.is_dir():
        msg = f"In-tree provider directory not found: {in_tree}"
        raise SystemExit(msg)

    bundle_dir = BUNDLES_DIR / bundle
    if bundle_dir.exists():
        msg = f"Bundle directory already exists: {bundle_dir}.  Refusing to overwrite."
        raise SystemExit(msg)

    deactivated_dup = LFX_COMPONENTS / "deactivated" / bundle
    if deactivated_dup.is_dir():
        msg = (
            f"A deactivated duplicate exists at {deactivated_dup}.  Resolve "
            "the duplicate manually before porting -- see "
            "src/bundles/PORTING.md § 0."
        )
        raise SystemExit(msg)

    component_files: list[ComponentFile] = []
    nested_subdirs: list[Path] = []
    for src in sorted(in_tree.iterdir()):
        if src.is_dir():
            if src.name == "__pycache__":
                continue
            # Nested subpackage (e.g. ``agentics/helpers``); validate
            # its files for ``from langflow`` imports too, then plan
            # to move the whole subdir wholesale.
            for nested in src.rglob("*.py"):
                if "__pycache__" in nested.parts:
                    continue
                text = nested.read_text(encoding="utf-8")
                if "from langflow" in text:
                    msg = (
                        f"{nested} imports from ``langflow`` -- the bundle is "
                        "installed against the public BUNDLE_API surface (lfx), "

View on GitHub (pinned to 976ec789d2)

Solutions

  1. Compare the two directories (git log, diff) to decide which version is canonical.
  2. Delete or rename the stale duplicate under deactivated/ per src/bundles/PORTING.md § 0.
  3. Re-run the port once only the in-tree copy remains.

Example fix

# before
ls src/lfx/src/lfx/components/deactivated/agentics  # exists
python scripts/migrate/port_bundle.py --bundle agentics
# error: A deactivated duplicate exists at ...

# after
git rm -r src/lfx/src/lfx/components/deactivated/agentics  # after verifying it is stale
python scripts/migrate/port_bundle.py --bundle agentics --apply
Defensive patterns

Strategy: validation

Validate before calling

from pathlib import Path

LFX_COMPONENTS = Path("src/lfx/src/lfx/components")

def no_deactivated_duplicate(bundle: str) -> bool:
    return not (LFX_COMPONENTS / "deactivated" / bundle).is_dir()

Prevention

When it happens

Trigger: Running port_bundle.py --bundle <name> when both src/lfx/src/lfx/components/<name>/ and src/lfx/src/lfx/components/deactivated/<name>/ exist.

Common situations: 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.

Related errors


AI-assisted analysis of langflow-ai/langflow@976ec789d2 (2026-08-14). Data as JSON: /api/errors/8b66cdf0fc9f5afb. Report an issue: GitHub.