{"record":{"id":"8637e8ca45133811","repo":"langchain-ai/deepagents","slug":"plugin-source-directory-not-found-source","errorCode":null,"errorMessage":"Plugin source directory not found: {source}","messagePattern":"Plugin source directory not found: (.+?)","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"libs/code/deepagents_code/plugins/store.py","lineNumber":510,"sourceCode":"    \"\"\"Copy a plugin into the versioned cache and register the install.\n\n    Args:\n        plugin_id: Plugin id in `{name}@{marketplace}` form.\n        source_dir: Source plugin root to copy from.\n        version: Version declared by the plugin manifest, if any.\n        validate: Optional validation to run before registering the cache.\n\n    Returns:\n        Absolute path to the cached plugin root.\n\n    Raises:\n        FileNotFoundError: If `source_dir` is not an existing directory.\n        OSError: If the cache cannot be copied or atomically replaced.\n    \"\"\"\n    source = source_dir.resolve()\n    if not source.is_dir():\n        msg = f\"Plugin source directory not found: {source}\"\n        raise FileNotFoundError(msg)\n\n    cache_path = versioned_cache_path(plugin_id, version)\n    if cache_path.exists() and version is not None:\n        try:\n            if any(cache_path.iterdir()):\n                if validate is not None:\n                    validate(cache_path)\n                add_installed_plugin(\n                    plugin_id,\n                    install_path=str(cache_path),\n                    version=version,\n                )\n                return cache_path\n        except OSError:\n            pass\n\n    cache_path.parent.mkdir(parents=True, exist_ok=True)\n    temp_dir = cache_path.parent / f\".{cache_path.name}.tmp-{os.getpid()}\"","sourceCodeStart":492,"sourceCodeEnd":528,"githubUrl":"https://github.com/langchain-ai/deepagents/blob/a1af029e6e73cb17c36bff823d227747b28e91e1/libs/code/deepagents_code/plugins/store.py#L492-L528","documentation":"FileNotFoundError raised by cache_and_register_plugin when the directory given as `source_dir` does not resolve to an existing directory on disk. The plugin must be copied from this source into the versioned plugin cache before registration, so a missing source is fatal.","triggerScenarios":"Calling install_plugin or auto_update_plugins with a `source_dir` that has been deleted, moved, was never created, or is a file rather than a directory; `source_dir.resolve()` + `is_dir()` fails before any caching begins.","commonSituations":"Typo in the local plugin path; building the plugin in a temp dir that was cleaned up; pointing install at a git repo root whose checkout was removed; relative path resolved from an unexpected working directory.","solutions":["Verify the path exists and is a directory: ls <source_dir>","Rebuild or re-clone the plugin source before installing","Pass an absolute path to avoid resolution surprises from the current working directory","If the plugin ships via marketplace, install by id instead of a local source path"],"exampleFix":"// before\nawait install_plugin(plugin_id=\"my-plugin\", source_dir=\"./plugn\")  # typo\n\n// after\nawait install_plugin(plugin_id=\"my-plugin\", source_dir=\"/abs/path/to/my-plugin\")","handlingStrategy":"validation","validationCode":"from pathlib import Path\nsource = Path(source_dir).resolve()\nif not source.is_dir():\n    raise FileNotFoundError(f\"plugin source is not a directory: {source}\")","typeGuard":null,"tryCatchPattern":"try:\n    await install_plugin(plugin_id=p, source_dir=src)\nexcept FileNotFoundError:\n    console.print(f\"[red]Source {src} missing — rebuild the plugin first.[/red]\")","preventionTips":["Pass absolute, resolved paths to install_plugin","Build/clone the plugin source before installing and confirm with ls","Watch for temp build dirs being garbage-collected before install","Prefer marketplace-id installs over raw local paths when available"],"tags":["plugins","filesystem","path","install"],"backgroundTag":"directory-not-found","analyzedSha":"a1af029e6e73cb17c36bff823d227747b28e91e1","analyzedAt":"2026-08-29T11:43:24.718Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}