{"record":{"id":"3c40f0633ec69439","repo":"langchain-ai/deepagents","slug":"failed-to-install-args-plugin-id-exc","errorCode":null,"errorMessage":"Failed to install {args.plugin_id}: {exc}","messagePattern":"Failed to install (.+?): (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"libs/code/deepagents_code/plugins/commands_cli.py","lineNumber":143,"sourceCode":"            write_json(\"plugin list\", rows)\n            return None\n        if not rows:\n            text = \"No plugin marketplaces configured.\"\n        else:\n            lines = []\n            for row in rows:\n                status = \"enabled\" if row[\"enabled\"] else \"disabled\"\n                lines.append(f\"{status} {row['id']} {row['description']}\".rstrip())\n            text = \"\\n\".join(lines)\n        print(text)  # noqa: T201\n        return text\n    if command == \"install\":\n        try:\n            instance = install_plugin(args.plugin_id)\n        except (MarketplaceError, FileNotFoundError, OSError, ValueError) as exc:\n            text = f\"Failed to install {args.plugin_id}: {exc}\"\n            print(text)  # noqa: T201\n            raise SystemExit(1) from exc\n        details = \"\"\n        if instance.version is not None:\n            details = f\" (version: {instance.version})\"\n        text = (\n            f\"Installed plugin {instance.plugin_id}{details}. Run /reload to activate.\"\n        )\n        print(text)  # noqa: T201\n        return text\n    if command == \"uninstall\":\n        uninstall_plugin(args.plugin_id)\n        text = f\"Uninstalled plugin {args.plugin_id}.\"\n        print(text)  # noqa: T201\n        return text\n    if command in {\"enable\", \"disable\"}:\n        enabled = command == \"enable\"\n        try:\n            set_installed_plugin_enabled(args.plugin_id, enabled=enabled)\n        except (MarketplaceError, OSError, ValueError) as exc:","sourceCodeStart":125,"sourceCodeEnd":161,"githubUrl":"https://github.com/langchain-ai/deepagents/blob/a1af029e6e73cb17c36bff823d227747b28e91e1/libs/code/deepagents_code/plugins/commands_cli.py#L125-L161","documentation":"execute_plugin_command catches MarketplaceError, FileNotFoundError, OSError, and ValueError raised by install_plugin and converts them into this human-readable CLI message, prints it, and exits with status 1. It is the top-level error surface for `deepagents-code plugin install`, so the embedded {exc} text carries the underlying cause (marketplace resolution failure, manifest error, copy error, etc.). It is an intentional controlled failure path, not a crash.","triggerScenarios":"Running the `plugin install <id>` CLI command when install_plugin raises MarketplaceError (plugin not in marketplace, marketplace not configured, manifest invalid, source unresolved), or when filesystem operations raise FileNotFoundError/OSError/ValueError (e.g. corrupt cache dir, permission denied).","commonSituations":"Typos in the plugin id or marketplace name; a marketplace added with a stale or deleted install_location; a plugin entry whose manifest fails validation; read-only or full disk during cache materialization.","solutions":["Read the embedded {exc} cause: if it names the marketplace, run `plugin marketplace list` and re-add it; if it names the manifest, fix the plugin's manifest.","Verify the plugin id is `name@marketplace` and that the plugin exists in the configured marketplace.","Check the cache/install directories exist and are writable by the current user.","Re-add the marketplace source (e.g. `plugin marketplace add <source>`) if its location is stale.","For invalid manifests, correct manifest fields (name/version) in the plugin source and retry."],"exampleFix":"// before\n$ dcode plugin install widget@internal\nFailed to install widget@internal: Marketplace 'internal' is not configured\n// after\n$ dcode plugin marketplace add ~/markets/internal\n$ dcode plugin install widget@internal\nInstalled plugin widget@internal (version: 1.2.0). Run /reload to activate.","handlingStrategy":"try-catch","validationCode":"import subprocess\n\ndef plugin_installed(id_: str) -> bool:\n    out = subprocess.run([\"dcode\", \"plugin\", \"list\"], capture_output=True, text=True)\n    return id_ in out.stdout\n\nif not plugin_installed(\"widget@internal\") is False:\n    raise SystemExit(\"plugin id not installed; install first\")  # or proceed","typeGuard":"def is_valid_plugin_id(id_: str) -> bool:\n    name, sep, market = id_.partition(\"@\")\n    return bool(sep) and bool(name) and bool(market)","tryCatchPattern":"import subprocess\n\nproc = subprocess.run([\"dcode\", \"plugin\", \"install\", \"widget@internal\"], capture_output=True, text=True)\nif proc.returncode == 1 and proc.stdout.startswith(\"Failed to install\"):\n    print(\"install failed:\", proc.stdout.strip())  # inspect embedded cause and remediate","preventionTips":["Run `plugin marketplace list` and confirm the marketplace is configured before installing.","Always use the full `name@marketplace` id form.","Keep marketplace sources refreshed so entries and manifests are current.","Ensure cache/config directories are writable and have free space.","Validate plugin manifests locally before publishing new versions."],"tags":["cli","plugin-install","marketplace"],"backgroundTag":"plugin-install-failed","analyzedSha":"a1af029e6e73cb17c36bff823d227747b28e91e1","analyzedAt":"2026-08-29T11:43:24.718Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}