{"record":{"id":"0221205a1c57df3b","repo":"langchain-ai/deepagents","slug":"cannot-install-plugin-id-exc","errorCode":null,"errorMessage":"Cannot install {plugin_id}: {exc}","messagePattern":"Cannot install (.+?): (.+?)","errorType":"exception","errorClass":"MarketplaceError","httpStatus":null,"severity":"error","filePath":"libs/code/deepagents_code/plugins/discovery.py","lineNumber":232,"sourceCode":"        Discovered plugin instance loaded from the cache path.\n\n    Raises:\n        MarketplaceError: If the marketplace/plugin cannot be resolved, the\n            source is unsupported, or the cached plugin fails to load.\n    \"\"\"\n    load_installed_plugins(strict=True)\n    load_enabled_plugin_ids(strict=True)\n    marketplace, entry = _resolve_marketplace_and_entry(plugin_id)\n    rejections: list[str] = []\n    source_root = materialize_plugin_source(marketplace, entry, rejections=rejections)\n    if source_root is None:\n        raise MarketplaceError(unresolved_source_message(plugin_id, entry, rejections))\n\n    try:\n        manifest, _manifest_path, manifest_warnings = load_manifest(\n            source_root, fallback_name=entry.name\n        )\n    except PluginManifestError as exc:\n        msg = f\"Cannot install {plugin_id}: {exc}\"\n        raise MarketplaceError(msg) from exc\n\n    for warning in manifest_warnings:\n        logger.debug(\"Plugin install warning for %s: %s\", plugin_id, warning)\n\n    version = manifest.version if manifest is not None else None\n    cache_path = cache_and_register_plugin(\n        plugin_id,\n        source_root,\n        version=version,\n        validate=partial(\n            _validate_plugin_copy,\n            plugin_id=plugin_id,\n            fallback_name=entry.name,\n        ),\n    )\n","sourceCodeStart":214,"sourceCodeEnd":250,"githubUrl":"https://github.com/langchain-ai/deepagents/blob/a1af029e6e73cb17c36bff823d227747b28e91e1/libs/code/deepagents_code/plugins/discovery.py#L214-L250","documentation":"After source materialization, install_plugin calls load_manifest; a PluginManifestError (missing or invalid manifest) is wrapped into MarketplaceError with 'Cannot install <id>: ...'. The plugin's source exists but its manifest does not parse or fails required validation, so installation is refused.","triggerScenarios":"load_manifest(source_root, fallback_name=entry.name) raises PluginManifestError — malformed manifest file, missing required fields, invalid name/version values, or an unreadable manifest file in the materialized source root.","commonSituations":"A plugin author shipped a broken manifest (bad JSON/TOML, missing name/version); a manifest schema change in a newer code version rejecting older manifests; the materialized copy lost the manifest file; a release process stripping non-package files.","solutions":["Open the plugin's manifest in the source root and fix the reported field/syntax error.","Validate the manifest against the current schema expected by load_manifest.","Re-materialize the plugin source (refresh the marketplace) in case the copy is incomplete or stale.","If a schema change broke an older manifest, update the plugin or pin a compatible version.","As a user, report the broken manifest to the plugin maintainer with the embedded error text."],"exampleFix":"// before (manifest missing version)\n{\"name\": \"widget\"}\n// after\n{\"name\": \"widget\", \"version\": \"1.2.0\"}","handlingStrategy":"validation","validationCode":"import json\nfrom pathlib import Path\n\ndef manifest_ok(root: Path) -> bool:\n    mf = next(root.glob(\"manifest.*\"), None)\n    if mf is None:\n        return False\n    try:\n        data = json.loads(mf.read_text())\n    except (ValueError, OSError):\n        return False\n    return bool(data.get(\"name\")) and bool(data.get(\"version\"))\n\nassert manifest_ok(Path(\"plugins/widget\")), \"manifest missing or invalid\"","typeGuard":"def has_valid_manifest(data: dict) -> bool:\n    return isinstance(data.get(\"name\"), str) and isinstance(data.get(\"version\"), str)","tryCatchPattern":"from deepagents_code.plugins.discovery import MarketplaceError, install_plugin\n\ntry:\n    install_plugin(\"widget@internal\")\nexcept MarketplaceError as exc:\n    if str(exc).startswith(\"Cannot install\"):\n        print(\"fix the plugin manifest:\", exc)  # embedded PluginManifestError detail\n    else:\n        raise","preventionTips":["Validate manifests against the current schema before publishing plugins.","Keep name/version present and correctly typed in every manifest.","Re-materialize the source if the manifest file is missing from the local copy.","Pin plugin versions when schema changes ship in the loader.","CI-check manifests of every plugin release."],"tags":["manifest","plugin-install","validation"],"backgroundTag":"plugin-manifest-invalid","analyzedSha":"a1af029e6e73cb17c36bff823d227747b28e91e1","analyzedAt":"2026-08-29T11:43:24.718Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}