langflow-ai/langflow · error · SystemExit

provider directory not found: {src}

Error message

provider directory not found: {src}

What it means

consolidate_bundles.py's move_provider() relocates one provider folder from the in-tree components directory into the lfx-bundles metapackage. The first guard verifies the source directory (COMPONENTS_DIR / provider) exists; if it does not, the script aborts with 'provider directory not found: <abs path>' via SystemExit. The message includes the absolute path so you can see exactly which directory the script looked for.

Source

Thrown at scripts/migrate/consolidate_bundles.py:280

    """Bundle directory / ext-slug name for a provider.

    Bundle names must satisfy ``BUNDLE_NAME_RE`` (lowercase), so the in-tree
    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)

View on GitHub (pinned to 976ec789d2)

Solutions

  1. List the actual providers: `ls <COMPONENTS_DIR as shown in the error path>` and pass the exact directory name.
  2. If the provider was already consolidated, check that the bundle exists under BUNDLES_PKG and skip it (or handle error 44's duplicate case).
  3. If PROVIDER_DEPS contains a stale name, remove/update the entry in consolidate_bundles.py.

Example fix

# before
python scripts/migrate/consolidate_bundles.py --apply open_ai
# error: provider directory not found: .../lfx/components/open_ai

# after
python scripts/migrate/consolidate_bundles.py --apply openai
Defensive patterns

Strategy: validation

Validate before calling

from pathlib import Path

COMPONENTS_DIR = Path("src/lfx/src/lfx/components")  # adjust to the value printed in the error

def provider_exists(provider: str) -> bool:
    return (COMPONENTS_DIR / provider).is_dir()

Try / catch

import subprocess, sys

try:
    subprocess.run([sys.executable, "scripts/migrate/consolidate_bundles.py", "--apply", provider], check=True)
except subprocess.CalledProcessError as exc:
    # SystemExit(msg) -> non-zero exit with the diagnosis on stdout
    if "provider directory not found" in (exc.stdout or ""):
        print(f"skip {provider}: not present in this tree")
    else:
        raise

Prevention

When it happens

Trigger: Running `python scripts/migrate/consolidate_bundles.py [--apply] <provider>` (or letting it iterate all PROVIDER_DEPS) where <provider> has no folder under the components dir — a typo in the provider name, a provider already moved in an earlier run, or running the script from a checkout where the tree layout changed.

Common situations: Typos or wrong casing ('OpenAI' vs 'openai' — the lookup is case-sensitive); re-running the consolidation after it partially completed; provider list in PROVIDER_DEPS drifting out of sync with the actual directories after a refactor.

Related errors


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