langchain-ai/deepagents · error · MarketplaceError
Invalid marketplace source format. Try: owner/repo, https://
Error message
Invalid marketplace source format. Try: owner/repo, https://..., or ./path
What it means
This is the terminal fallback of `parse_marketplace_source` (marketplace.py:213-214): after SSH Git syntax, http/https URLs, path-like prefixes, existing relative paths, and the `owner/repo` GitHub shorthand have all been tried, any remaining unrecognized string raises this error. The message enumerates the three accepted shapes. It is a `MarketplaceError` (a `ValueError` subclass) raised whenever no grammar branch matches.
Source
Thrown at libs/code/deepagents_code/plugins/marketplace.py:214
# Bare relative paths such as `marketplace` (no ./ prefix) are accepted when
# they exist on disk, before GitHub-shorthand parsing.
candidate = Path(value).expanduser()
if candidate.exists():
return _marketplace_source_from_path(value)
repo, sep, ref = value.replace("#", "@", 1).partition("@")
if (
"/" in value
and ":" not in value
and not value.startswith("@")
and _GITHUB_REPO_RE.match(repo)
):
return RepositoryMarketplaceSource(
source_type="github", value=repo, ref=ref if sep else None
)
msg = "Invalid marketplace source format. Try: owner/repo, https://..., or ./path"
raise MarketplaceError(msg)
def _marketplace_source_from_path(value: str) -> MarketplaceSource:
path = Path(value).expanduser().resolve()
if not path.exists():
msg = f"Path does not exist: {path}"
raise MarketplaceError(msg)
if path.is_file():
if path.suffix != ".json":
msg = f"File path must point to a .json marketplace file: {path}"
raise MarketplaceError(msg)
return LocalMarketplaceSource(source_type="file", value=str(path))
if path.is_dir():
return LocalMarketplaceSource(source_type="directory", value=str(path))
msg = f"Path is neither a file nor a directory: {path}"
raise MarketplaceError(msg)
View on GitHub (pinned to a1af029e6e)
Solutions
- Use the GitHub shorthand form `owner/repo` for GitHub-hosted marketplaces.
- Use a full `https://...` URL for remote marketplaces (with `#ref` optionally appended).
- Prefix local paths with `./`, `../`, `/`, or `~` (or make sure the relative path actually exists on disk).
- Check for stray characters: spaces, colons, or a leading `@` all disqualify the GitHub shorthand branch.
Example fix
// before
add_marketplace_source("my marketplace")
// after
add_marketplace_source("owner/repo") Defensive patterns
Strategy: validation
Validate before calling
import re
_GITHUB_SHORT = re.compile(r"^[^/\s]+/[^/\s]+$")
def validate_source_shape(raw: str) -> str:
v = raw.strip()
if not (v.startswith(("https://", "./", "../", "/", "~"))
or (":" not in v and not v.startswith("@") and _GITHUB_SHORT.match(v.split("#", 1)[0].replace("@", "/", 0) or v))):
raise ValueError(f"Unsupported source format: {raw!r}")
return raw Type guard
import re
def looks_like_valid_source(value: str) -> bool:
v = value.strip()
if v.startswith(("https://", "./", "../", "/", "~")):
return True
return bool(re.fullmatch(r"[^/\s]+/[^/\s]+", v)) and ":" not in v and not v.startswith("@") Try / catch
try:
source = parse_marketplace_source(raw)
except MarketplaceError as exc:
if "Invalid marketplace source format" in str(exc):
raise ValueError(
f"{exc}. Accepted forms: 'owner/repo', 'https://.../marketplace.json', or './local/path'"
) from exc
raise Prevention
- Normalize user input: trim whitespace and strip a leading '@' before passing sources.
- Show the accepted formats in UI/config docs next to the field.
- Prefer the GitHub `owner/repo` shorthand; it avoids most formatting mistakes.
When it happens
Trigger: `parse_marketplace_source('my marketplace')` (space, no separator), `'owner:repo'` (colon in a non-URL string), `'@org/repo'` (leading `@`, explicitly excluded), `'owner/repo@'` styles that fail `_GITHUB_REPO_RE`, or `add_marketplace_source` with a typo'd bare name like `'my-marketplaec'` that does not exist on disk.
Common situations: Typos in GitHub `owner/repo` shorthand (extra slashes or spaces); Windows-style paths typed without a recognizable prefix; pasting a full SCP URL with extra characters; forgetting `./` before a relative directory that does not exist.
Related errors
- Unsupported marketplace source type: {source.source_type}
- Marketplace URL {_redact_url_credentials(url)} contains plug
- Marketplace manifest {manifest_path} must be a JSON object
- Invalid plugin name: {name!r}
- Marketplace {name} must contain a plugins array
AI-assisted analysis of langchain-ai/deepagents@a1af029e6e (2026-08-29).
Data as JSON: /api/errors/62fdd33ac9670662.
Report an issue: GitHub.