BerriAI/litellm · error · HTTPException
Failed to generate marketplace: {e}
Error message
Failed to generate marketplace: {e} What it means
Catch-all 500 from the GET /claude-code/marketplace.json handler in the Claude Code marketplace module. Any non-HTTPException raised while listing plugins or assembling the marketplace JSON (DB read failure, connection drop, malformed manifest_json row) is logged as 'Error generating marketplace' and re-raised with this generic message. The original traceback is only in the proxy logs, not the response.
Source
Thrown at litellm/proxy/anthropic_endpoints/claude_code_endpoints/claude_code_marketplace.py:153
entry["keywords"] = manifest["keywords"]
if "category" in manifest:
entry["category"] = manifest["category"]
plugin_list.append(entry)
marketplace: Final = {
"name": "litellm",
"owner": {"name": "LiteLLM", "email": "support@litellm.ai"},
"plugins": plugin_list,
}
return JSONResponse(content=marketplace)
except HTTPException:
raise
except Exception as e:
verbose_proxy_logger.exception("Error generating marketplace: %s", e)
raise HTTPException(
status_code=500,
detail={"error": f"Failed to generate marketplace: {e}"},
)
# Allowlist for git-subdir paths: one or more segments separated by '/'.
# Each segment must start with an alphanumeric character and contain only
# alphanumeric characters, dots, hyphens, and underscores.
# This implicitly blocks '..', leading '/', backslashes, and percent-encoded sequences.
_VALID_GIT_SUBDIR_PATH_RE: Final = re.compile(r"^[a-zA-Z0-9][a-zA-Z0-9._-]*(/[a-zA-Z0-9][a-zA-Z0-9._-]*)*$")
def _validate_plugin_source(source: Mapping[str, str]) -> None:
"""Validate plugin source format, raising HTTPException on invalid input."""
source_type: Final = source.get("source")
if source_type == "github":
if "repo" not in source:
raise HTTPException(View on GitHub (pinned to 77b7c6c40c)
Solutions
- Check the proxy logs for the 'Error generating marketplace' entry — verbose_proxy_logger.exception prints the full traceback of the real cause.
- If the traceback mentions a missing table or column, restart the proxy with DATABASE_URL set so Prisma migrations run, or apply migrations manually against the database.
- If the traceback is a JSONDecodeError, find and repair/delete the bad row: inspect manifest_json in the plugin table (litellm_claudecodeplugintable) and re-register the broken plugin via POST /claude-code/plugins.
- If it is a connection error, verify Postgres reachability and credentials, then retry the request once the DB is back.
Defensive patterns
Strategy: try-catch
Try / catch
try:
resp = client.get(f"{base}/claude-code/marketplace.json")
resp.raise_for_status()
except httpx.HTTPStatusError as e:
if e.response.status_code == 500 and "Failed to generate marketplace" in e.response.text:
# generic wrapper: the real cause is only in the proxy's
# 'Error generating marketplace' log line - check server logs
raise MarketplaceBackendError("check proxy logs") from e
raise Prevention
- Keep the proxy and its database on versions whose migrations have run (restart after upgrade).
- Never hand-edit manifest_json rows; re-register plugins through the API.
- Monitor proxy logs for 'Error generating marketplace' to catch corrupted rows early.
When it happens
Trigger: GET /claude-code/marketplace.json when the Postgres connection drops mid-query; when a row in litellm_claudecodeplugintable has a manifest_json value that is not valid JSON; or when the table does not exist because the database was never migrated (e.g. schema created by an older LiteLLM version).
Common situations: Upgrading LiteLLM to a version that introduced the plugin table without running migrations; a manually inserted/edited plugin row with broken manifest_json; transient network failure between proxy and RDS/Supabase/Neon; killing Postgres while the marketplace URL is being polled.
Related errors
- str(e)
- Registration failed: {e}
- DB not connected. This endpoint needs a database; set DATABA
- urn:litellm:error:internal-server-error
- DB not connected. This endpoint needs a database; set DATABA
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/26e5da4f29223614.
Report an issue: GitHub.