langchain-ai/deepagents · error · MarketplaceError

Cannot install

Error message

Cannot install {plugin_id}: {exc}

What it means

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.

Solutions

  1. Open the plugin's manifest in the source root and fix the reported field/syntax error.
  2. Validate the manifest against the current schema expected by load_manifest.
  3. Re-materialize the plugin source (refresh the marketplace) in case the copy is incomplete or stale.
  4. If a schema change broke an older manifest, update the plugin or pin a compatible version.
  5. As a user, report the broken manifest to the plugin maintainer with the embedded error text.

Example fix

// before (manifest missing version)
{"name": "widget"}
// after
{"name": "widget", "version": "1.2.0"}
Defensive patterns

Strategy: validation

Validate before calling

import json
from pathlib import Path

def manifest_ok(root: Path) -> bool:
    mf = next(root.glob("manifest.*"), None)
    if mf is None:
        return False
    try:
        data = json.loads(mf.read_text())
    except (ValueError, OSError):
        return False
    return bool(data.get("name")) and bool(data.get("version"))

assert manifest_ok(Path("plugins/widget")), "manifest missing or invalid"

Type guard

def has_valid_manifest(data: dict) -> bool:
    return isinstance(data.get("name"), str) and isinstance(data.get("version"), str)

Try / catch

from deepagents_code.plugins.discovery import MarketplaceError, install_plugin

try:
    install_plugin("widget@internal")
except MarketplaceError as exc:
    if str(exc).startswith("Cannot install"):
        print("fix the plugin manifest:", exc)  # embedded PluginManifestError detail
    else:
        raise

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of langchain-ai/deepagents@a1af029e6e (2026-08-29). Data as JSON: /api/errors/0221205a1c57df3b. Report an issue: GitHub.

Appendix: source

Thrown at libs/code/deepagents_code/plugins/discovery.py:232

        Discovered plugin instance loaded from the cache path.

    Raises:
        MarketplaceError: If the marketplace/plugin cannot be resolved, the
            source is unsupported, or the cached plugin fails to load.
    """
    load_installed_plugins(strict=True)
    load_enabled_plugin_ids(strict=True)
    marketplace, entry = _resolve_marketplace_and_entry(plugin_id)
    rejections: list[str] = []
    source_root = materialize_plugin_source(marketplace, entry, rejections=rejections)
    if source_root is None:
        raise MarketplaceError(unresolved_source_message(plugin_id, entry, rejections))

    try:
        manifest, _manifest_path, manifest_warnings = load_manifest(
            source_root, fallback_name=entry.name
        )
    except PluginManifestError as exc:
        msg = f"Cannot install {plugin_id}: {exc}"
        raise MarketplaceError(msg) from exc

    for warning in manifest_warnings:
        logger.debug("Plugin install warning for %s: %s", plugin_id, warning)

    version = manifest.version if manifest is not None else None
    cache_path = cache_and_register_plugin(
        plugin_id,
        source_root,
        version=version,
        validate=partial(
            _validate_plugin_copy,
            plugin_id=plugin_id,
            fallback_name=entry.name,
        ),
    )

View on GitHub (pinned to a1af029e6e)