{"record":{"id":"26e5da4f29223614","repo":"BerriAI/litellm","slug":"failed-to-generate-marketplace-e","errorCode":null,"errorMessage":"Failed to generate marketplace: {e}","messagePattern":"Failed to generate marketplace: (.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"litellm/proxy/anthropic_endpoints/claude_code_endpoints/claude_code_marketplace.py","lineNumber":153,"sourceCode":"                entry[\"keywords\"] = manifest[\"keywords\"]\n            if \"category\" in manifest:\n                entry[\"category\"] = manifest[\"category\"]\n\n            plugin_list.append(entry)\n\n        marketplace: Final = {\n            \"name\": \"litellm\",\n            \"owner\": {\"name\": \"LiteLLM\", \"email\": \"support@litellm.ai\"},\n            \"plugins\": plugin_list,\n        }\n\n        return JSONResponse(content=marketplace)\n\n    except HTTPException:\n        raise\n    except Exception as e:\n        verbose_proxy_logger.exception(\"Error generating marketplace: %s\", e)\n        raise HTTPException(\n            status_code=500,\n            detail={\"error\": f\"Failed to generate marketplace: {e}\"},\n        )\n\n\n# Allowlist for git-subdir paths: one or more segments separated by '/'.\n# Each segment must start with an alphanumeric character and contain only\n# alphanumeric characters, dots, hyphens, and underscores.\n# This implicitly blocks '..', leading '/', backslashes, and percent-encoded sequences.\n_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._-]*)*$\")\n\n\ndef _validate_plugin_source(source: Mapping[str, str]) -> None:\n    \"\"\"Validate plugin source format, raising HTTPException on invalid input.\"\"\"\n    source_type: Final = source.get(\"source\")\n    if source_type == \"github\":\n        if \"repo\" not in source:\n            raise HTTPException(","sourceCodeStart":135,"sourceCodeEnd":171,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/anthropic_endpoints/claude_code_endpoints/claude_code_marketplace.py#L135-L171","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","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."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    resp = client.get(f\"{base}/claude-code/marketplace.json\")\n    resp.raise_for_status()\nexcept httpx.HTTPStatusError as e:\n    if e.response.status_code == 500 and \"Failed to generate marketplace\" in e.response.text:\n        # generic wrapper: the real cause is only in the proxy's\n        # 'Error generating marketplace' log line - check server logs\n        raise MarketplaceBackendError(\"check proxy logs\") from e\n    raise","preventionTips":["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."],"tags":["litellm-proxy","claude-code-marketplace","internal-server-error","database","debugging"],"backgroundTag":"internal-server-error","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}