langchain-ai/deepagents · warning · MarketplaceError

Please enter a marketplace source

Error message

Please enter a marketplace source

What it means

`parse_marketplace_source` accepts GitHub shorthand, git URLs (including SSH scp-like syntax), marketplace JSON URLs, and local file/directory paths. An entirely empty (after stripping whitespace) input is rejected immediately with this `MarketplaceError` — it is the friendly prompt shown when the user submits nothing in the add-marketplace flow.

Source

Thrown at libs/code/deepagents_code/plugins/marketplace.py:157

    )


def parse_marketplace_source(raw: str) -> MarketplaceSource:
    """Parse a user-provided marketplace source.

    Args:
        raw: GitHub shorthand, Git URL, marketplace JSON URL, file, or directory.

    Returns:
        Parsed marketplace source.

    Raises:
        MarketplaceError: If the source string is empty or unsupported.
    """
    value = raw.strip()
    if not value:
        msg = "Please enter a marketplace source"
        raise MarketplaceError(msg)

    ssh_match = _SSH_GIT_RE.match(value)
    if ssh_match:
        return RepositoryMarketplaceSource(
            source_type="git", value=ssh_match.group(1), ref=ssh_match.group(2)
        )

    if value.startswith("http://"):
        msg = "Remote marketplace sources must use https"
        raise MarketplaceError(msg)
    if value.startswith("https://"):
        url, _, ref = value.partition("#")
        try:
            parsed = urlparse(url)
        except ValueError as exc:
            msg = "Invalid marketplace URL"
            raise MarketplaceError(msg) from exc
        path = parsed.path

View on GitHub (pinned to a1af029e6e)

Solutions

  1. Enter a nonempty marketplace source (e.g. `owner/repo`, a git URL, or a path to a marketplace JSON/file/directory).
  2. If driven by a variable, ensure it is set before invoking: check `echo "$MARKETPLACE_SOURCE"`.
  3. In scripts, guard with an early check so you never call with an empty string.

Example fix

# before
parse_marketplace_source(os.environ["MKT"])  # MKT unset -> ''
# after
src = os.environ.get("MKT", "").strip()
if not src:
    raise SystemExit("MKT must be set to a marketplace source")
parse_marketplace_source(src)
Defensive patterns

Strategy: validation

Validate before calling

raw = (user_input or "").strip()
if not raw:
    raise SystemExit("Please enter a marketplace source")

Try / catch

try:
    source = parse_marketplace_source(user_input)
except MarketplaceError as exc:
    show_dialog_error(str(exc))  # empty or unsupported source

Prevention

When it happens

Trigger: Calling `parse_marketplace_source("")` or with a whitespace-only string; in the UI, submitting the add-marketplace modal with an empty source field.

Common situations: User pressed Enter in the add-marketplace dialog without typing anything; an environment variable or config value intended to hold the source was unset/blank; a script interpolated an empty variable into the source argument.

Related errors


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