langflow-ai/langflow · warning · SystemExit
destination already exists (already consolidated?): {dst}
Error message
destination already exists (already consolidated?): {dst} What it means
The second guard in move_provider(): before touching anything it checks that the destination (BUNDLES_PKG / slug, where slug = provider.lower()) does not already exist. A pre-existing destination almost always means the provider was already consolidated, and proceeding would overwrite or interleave files. The script refuses with 'destination already exists (already consolidated?): <path>'.
Source
Thrown at scripts/migrate/consolidate_bundles.py:283
source dir name is lowercased -- e.g. ``FAISS`` -> ``faiss``, ``Notion`` ->
``notion``. Already-lowercase providers are unchanged. The historical
``lfx.components.<provider>`` import paths (migration table) keep the
original casing; only the bundle dir + ``ext:<slug>`` id are lowercased.
"""
return provider.lower()
def move_provider(provider: str, *, apply: bool) -> list[tuple[str, str]]:
"""Move one provider into the metapackage and leave a shim. Returns its classes."""
slug = bundle_slug(provider)
src = COMPONENTS_DIR / provider
dst = BUNDLES_PKG / slug
if not src.is_dir():
msg = f"provider directory not found: {src}"
raise SystemExit(msg)
if dst.exists():
msg = f"destination already exists (already consolidated?): {dst}"
raise SystemExit(msg)
# move_provider relocates only top-level ``*.py`` modules (see the glob
# below) but rmtree's the whole source tree. A provider with a subpackage
# would have its subdir silently destroyed -- never copied to the bundle and
# never migration-mapped. Refuse rather than half-move; port_bundle.py is
# the tool for nested layouts.
subdirs = sorted(p.name for p in src.iterdir() if p.is_dir() and p.name != "__pycache__")
if subdirs:
msg = (
f"{provider}: source has subdirectory/ies {subdirs} that move_provider does not "
"relocate (it copies only top-level *.py modules). Use port_bundle.py, which "
"handles nested subpackages, instead."
)
raise SystemExit(msg)
classes = discover_component_classes(src)
py_files = sorted(src.glob("*.py"))
print(f" {provider}: {len(py_files)} file(s), {len(classes)} component class(es) -> {dst.relative_to(REPO_ROOT)}")View on GitHub (pinned to 976ec789d2)
Solutions
- Confirm the provider is already consolidated: inspect the destination directory shown in the error — it should contain the moved modules plus the ext registration.
- If truly duplicated/leftover, delete the destination bundle directory (and its registration) and re-run, or better, restore from git: `git checkout -- <dst>` then re-run.
- For slug collisions between differently-cased providers, rename one bundle or port it manually via port_bundle.py with a distinct name.
Example fix
# before python scripts/migrate/consolidate_bundles.py --apply openai # second run # error: destination already exists (already consolidated?): src/bundles/lfx_bundles/openai # after git status src/bundles/lfx_bundles/openai # verify it is complete and committed, then skip the provider python scripts/migrate/consolidate_bundles.py --apply next_provider
Defensive patterns
Strategy: validation
Validate before calling
from pathlib import Path
BUNDLES_PKG = Path("src/bundles/lfx_bundles") # adjust to the path in the error
def already_consolidated(provider: str) -> bool:
return (BUNDLES_PKG / provider.lower()).exists() Prevention
- Make bulk consolidation scripts skip providers whose destination already exists instead of aborting the whole run.
- Commit after each successful provider move so a re-run is detectable via git status.
- The slug is provider.lower() — watch for casing collisions between providers.
When it happens
Trigger: Re-running `python scripts/migrate/consolidate_bundles.py --apply <provider>` after a successful earlier run; running it twice in the same session; a provider whose lowercased slug collides with an already-ported bundle's slug.
Common situations: Retry after an interrupted bulk run where this provider had already completed; case-collision between providers that differ only in casing (slug is lowercased); forgetting that a previous dry-run with --apply had already moved this one.
Related errors
- Bundle directory already exists: {bundle_dir}. Refusing to
- provider directory not found: {src}
- In-tree provider directory not found: {in_tree}
- No ``*.py`` files under {in_tree}; nothing to port.
- lfx-{bundle} already referenced in {ROOT_PYPROJECT.relative_
AI-assisted analysis of langflow-ai/langflow@976ec789d2 (2026-08-14).
Data as JSON: /api/errors/2b999032c95d72df.
Report an issue: GitHub.