langchain-ai/deepagents · error

Failed to add marketplace {source}: {redact_urls_in_text(str

Error message

Failed to add marketplace {source}: {redact_urls_in_text(str(exc))}

What it means

When `plugin marketplace add <source>` fails, execute_plugin_command builds this message by redacting the source argument and the exception text through redact_urls_in_text, then exits with status 1. The redaction prevents credentials embedded in URLs (tokens in the marketplace source or in the error) from being printed to the terminal. The cause is any MarketplaceError/OSError/ValueError raised while fetching or persisting the marketplace definition.

Source

Thrown at libs/code/deepagents_code/plugins/commands_cli.py:207

                return None
            text = (
                "No plugin marketplaces configured."
                if not rows
                else "\n".join(f"{row['name']} {row['source']}" for row in rows)
            )
            print(text)  # noqa: T201
            return text
        if marketplace_command == "add":
            try:
                marketplace = add_marketplace_source(args.source)
            except (MarketplaceError, FileNotFoundError, OSError, ValueError) as exc:
                source = redact_marketplace_source(args.source)
                text = (
                    f"Failed to add marketplace {source}: "
                    f"{redact_urls_in_text(str(exc))}"
                )
                print(text)  # noqa: T201
                raise SystemExit(1) from exc
            text = (
                f"Added marketplace {marketplace.name} "
                f"({len(marketplace.plugins)} plugin(s))."
            )
            print(text)  # noqa: T201
            return text
        if marketplace_command == "remove":
            removed = remove_marketplace(args.name)
            text = (
                f"Removed marketplace {args.name} and its installed plugins."
                if removed
                else f"Marketplace {args.name} is not configured."
            )
            print(text)  # noqa: T201
            return text
    text = "Usage: plugin {list,install,uninstall,enable,disable,marketplace}"
    print(text)  # noqa: T201
    return text

View on GitHub (pinned to a1af029e6e)

Solutions

  1. Check network reachability of the source URL (curl it) — note the CLI output redacts URLs, so test the raw source yourself.
  2. Validate the marketplace definition file (names, plugin entries) parses and matches the expected schema.
  3. Ensure the destination install_location is writable and the parent directory exists.
  4. If auth was required, supply credentials via the supported mechanism before adding.
  5. Fix any typos in the local path and retry the add command.

Example fix

// before
$ dcode plugin marketplace add https://git.example.com/team/mkt.git
Failed to add marketplace https://git.example.com/team/mkt.git: could not fetch source
// after (verify source first)
$ git ls-remote https://git.example.com/team/mkt.git
$ dcode plugin marketplace add https://git.example.com/team/mkt.git
Added marketplace team-mkt (12 plugin(s)).
Defensive patterns

Strategy: try-catch

Validate before calling

import urllib.request

def source_reachable(source: str) -> bool:
    if source.startswith(("http://", "https://")):
        try:
            urllib.request.urlopen(source, timeout=10)
            return True
        except OSError:
            return False
    import os
    return os.path.exists(source)

assert source_reachable("https://git.example.com/team/mkt.git"), "source unreachable"

Type guard

def is_valid_marketplace_source(source: str) -> bool:
    import os
    return bool(source) and (os.path.exists(source) or source.startswith(("http://", "https://", "git@")))

Try / catch

proc = subprocess.run(["dcode", "plugin", "marketplace", "add", SRC], capture_output=True, text=True)
if proc.returncode == 1 and proc.stdout.startswith("Failed to add marketplace"):
    # output is URL-redacted; debug with the raw source yourself
    print("add failed; verify source reachability and marketplace schema")

Prevention

When it happens

Trigger: Running `plugin marketplace add <source>` where the source cannot be fetched/parsed (MarketplaceError), the target location cannot be written (OSError), or the source/definition is invalid (ValueError).

Common situations: A URL with an unreachable host or bad TLS config; a marketplace manifest that fails schema validation; a git/HTTP source requiring auth; a typo'd local path; the URL containing a token the redactor then strips from output.

Related errors


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