{"record":{"id":"ac4ca60478739595","repo":"langchain-ai/deepagents","slug":"installed-plugin-id-but-failed-to-load-from-cach","errorCode":null,"errorMessage":"Installed {plugin_id} but failed to load from cache: {detail}","messagePattern":"Installed (.+?) but failed to load from cache: (.+?)","errorType":"exception","errorClass":"MarketplaceError","httpStatus":null,"severity":"error","filePath":"libs/code/deepagents_code/plugins/discovery.py","lineNumber":264,"sourceCode":"            plugin_id=plugin_id,\n            fallback_name=entry.name,\n        ),\n    )\n\n    set_plugin_enabled(plugin_id, True)\n    ensure_plugin_data_dir(plugin_id)\n\n    instance, warnings = _plugin_from_install_path(\n        plugin_id=plugin_id,\n        root=cache_path,\n        marketplace_name=marketplace.name,\n        fallback_name=entry.name,\n    )\n    if instance is None:\n        detail = \"; \".join(warnings)\n        uninstall_plugin_record(plugin_id)\n        msg = f\"Installed {plugin_id} but failed to load from cache: {detail}\"\n        raise MarketplaceError(msg)\n    return instance\n\n\ndef _validate_plugin_copy(\n    root: Path,\n    *,\n    plugin_id: str,\n    fallback_name: str,\n) -> None:\n    try:\n        manifest, _manifest_path, warnings = load_manifest(\n            root, fallback_name=fallback_name\n        )\n    except PluginManifestError as exc:\n        msg = f\"Cannot install {plugin_id}: {exc}\"\n        raise MarketplaceError(msg) from exc\n    build_inventory(root, manifest, warnings)\n","sourceCodeStart":246,"sourceCodeEnd":282,"githubUrl":"https://github.com/langchain-ai/deepagents/blob/a1af029e6e73cb17c36bff823d227747b28e91e1/libs/code/deepagents_code/plugins/discovery.py#L246-L282","documentation":"`install_plugin` copies a marketplace plugin into the versioned cache, enables it, and then re-loads it from the cache path via `_plugin_from_install_path`. If the cached copy fails to produce a `PluginInstance` (manifest missing/invalid, inventory build problems, or `PluginInstance` raising `ValueError`), the install record is rolled back with `uninstall_plugin_record` and this `MarketplaceError` is raised with the collected load warnings as the detail.","triggerScenarios":"Calling `install_plugin(plugin_id)` when the plugin's cached copy fails to load: the manifest cannot be parsed from the cache path, component inventory build warns/fails, or `PluginInstance` construction raises `ValueError` (the warning strings joined into `detail` tell which).","commonSituations":"Upstream plugin repo ships a valid manifest at the source but the copy step drops files (e.g. symlinked components outside the plugin root); cache corruption; a manifest that validates loosely but produces warnings making the cached instance unusable; platform-specific path issues after install.","solutions":["Read the `detail` suffix of the message; it lists the exact load warnings.","Check the plugin's source repo manifest and component paths (`./agents`, `./commands`, etc.) are valid and real files (not dangling or out-of-root symlinks).","Clear the plugin cache directory for that plugin and reinstall.","Update the plugin in its marketplace source, then reinstall.","If you hit this from a test, verify the test fixture copies real files rather than symlinks outside the plugin root."],"exampleFix":"// before: plugin has a dangling symlink component\ncommands -> /outside/commands  (not copied into cache)\n// after\ncommands/\n  review.md  (real file inside the plugin root)","handlingStrategy":"try-catch","validationCode":"from pathlib import Path\nfor rel in (\"plugin.json\", \".deepagents/plugin.json\"):\n    if (root / rel).is_file():\n        import json; json.loads((root / rel).read_text())  # raises if malformed","typeGuard":"def is_loadable_plugin(root: Path) -> bool:\n    try:\n        manifest, _, _ = load_manifest(root)\n        return manifest is not None\n    except PluginManifestError:\n        return False","tryCatchPattern":"try:\n    install_plugin(plugin_id)\nexcept MarketplaceError as exc:\n    logger.warning(\"install failed: %s\", exc)  # detail lists load warnings\n    # optionally: clear cache dir for plugin_id and retry once","preventionTips":["Keep all component files real files inside the plugin root — no symlinks pointing outside.","Validate the manifest locally before publishing the plugin.","Avoid editing files under plugins/cache directly; reinstall instead.","Read the `detail` in the message — it enumerates the exact load warnings."],"tags":["plugins","marketplace","install","cache"],"backgroundTag":"plugin-cache-load-failed","analyzedSha":"a1af029e6e73cb17c36bff823d227747b28e91e1","analyzedAt":"2026-08-29T11:43:24.718Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}