{"record":{"id":"17e1eca987274c6c","repo":"RocketChat/Rocket.Chat","slug":"marketplace-internal-error-17e1ec","errorCode":null,"errorMessage":"Marketplace_Internal_Error","messagePattern":"Marketplace_Internal_Error","errorType":"error_code","errorClass":"MarketplaceAppsError","httpStatus":null,"severity":"error","filePath":"apps/meteor/ee/server/apps/marketplace/fetchMarketplaceCategories.ts","lineNumber":72,"sourceCode":"\tif (request.status === 200) {\n\t\tconst response = await request.json();\n\t\tfetchMarketplaceCategoriesSchema.parse(response);\n\t\treturn response;\n\t}\n\n\tconst response = await request.json();\n\n\tApps.getRocketChatLogger().error({ msg: 'Error fetching marketplace categories', status: request.status, response });\n\n\t// TODO: Refactor cloud to return a proper error code on unsupported version\n\tif (request.status === 426 && 'errorMsg' in response && response.errorMsg === 'unsupported version') {\n\t\tthrow new MarketplaceUnsupportedVersionError();\n\t}\n\n\tconst INTERNAL_MARKETPLACE_ERROR_CODES = [189, 266];\n\n\tif (request.status === 500 && INTERNAL_MARKETPLACE_ERROR_CODES.includes(response.code)) {\n\t\tthrow new MarketplaceAppsError('Marketplace_Internal_Error');\n\t}\n\n\tthrow new MarketplaceAppsError('Marketplace_Failed_To_Fetch_Categories');\n}\n","sourceCodeStart":54,"sourceCodeEnd":77,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/f9d3ec372bb580fa8d036f94cf03925a478ef768/apps/meteor/ee/server/apps/marketplace/fetchMarketplaceCategories.ts#L54-L77","documentation":"Thrown when the Rocket.Chat Cloud marketplace endpoint returns HTTP 500 with a body whose `code` field is one of the internal marketplace error codes (189 or 266). It signals an unrecoverable server-side failure inside the marketplace service itself, distinct from connectivity or version problems. The error is a typed `MarketplaceAppsError` carrying the message key `Marketplace_Internal_Error`, surfaced from `fetchMarketplaceCategories()` after the response body is parsed and logged.","triggerScenarios":"Calling `fetchMarketplaceCategories()` (which hits `GET v1/categories` on the marketplace client) when the cloud responds with status 500 AND `response.code` equals 189 or 266. Any other 500 body falls through to the generic categories-fetch error.","commonSituations":"A transient outage or bug on the Rocket.Chat Cloud marketplace backend; a workspace whose cached access token triggers a server-side fault; during a cloud-side deployment window where the categories service is degraded.","solutions":["Retry the marketplace/categories request after a short delay — 500 with these codes is typically a transient cloud-side fault.","Check Rocket.Chat Cloud status pages / announcements for an active marketplace incident.","Inspect the server log entry `Error fetching marketplace categories` (it records status and full response body) to confirm `response.code` is 189/266 and capture the cloud-side trace if reporting a bug.","Upgrade the workspace to a supported version if the cloud has deprecated the request shape for your build."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":"import { MarketplaceAppsError } from './marketplaceErrors';\n\nfunction isMarketplaceInternalError(e: unknown): boolean {\n\treturn e instanceof MarketplaceAppsError && e.message === 'Marketplace_Internal_Error';\n}","tryCatchPattern":"try {\n\tconst categories = await fetchMarketplaceCategories();\n} catch (e) {\n\tif (e instanceof MarketplaceAppsError && e.message === 'Marketplace_Internal_Error') {\n\t\t// transient cloud-side 500 (codes 189/266) — retry with backoff\n\t}\n\tthrow e;\n}","preventionTips":["Treat 500 internal marketplace errors as transient and retry with exponential backoff.","Log the full cloud response (status + body) for root-cause reporting.","Keep the workspace on a marketplace-supported version to avoid edge-case 500s."],"tags":["marketplace","network","cloud","ee"],"backgroundTag":null,"analyzedSha":"f9d3ec372bb580fa8d036f94cf03925a478ef768","analyzedAt":"2026-08-12T19:07:17.372Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}