{"record":{"id":"db50f53bb6395fb3","repo":"RocketChat/Rocket.Chat","slug":"marketplace-internal-error","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/fetchMarketplaceApps.ts","lineNumber":192,"sourceCode":"\t}\n\n\tconst response = await request.json();\n\n\tApps.getRocketChatLogger().error({ msg: 'Error fetching marketplace apps', 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\tif (request.status === 400 && response.code === 200) {\n\t\tthrow new MarketplaceAppsError('Marketplace_Invalid_Apps_Engine_Version');\n\t}\n\n\tconst INTERNAL_MARKETPLACE_ERROR_CODES = [266, 256, 166, 221, 257, 320];\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_Apps');\n}\n","sourceCodeStart":174,"sourceCodeEnd":197,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/f9d3ec372bb580fa8d036f94cf03925a478ef768/apps/meteor/ee/server/apps/marketplace/fetchMarketplaceApps.ts#L174-L197","documentation":"Thrown by fetchMarketplaceApps when the marketplace responds with HTTP 500 AND response.code is one of the internal marketplace error codes [266, 256, 166, 221, 257, 320]. Maps to MarketplaceAppsError('Marketplace_Internal_Error'). These codes represent known internal failures on the marketplace side; the response is logged at error level before throwing.","triggerScenarios":"Calling fetchMarketplaceApps() during a marketplace-side incident where the marketplace returns 500 with one of the tracked internal codes. The set of codes is hardcoded and may not cover all marketplace 500s (those fall through to error 197).","commonSituations":"Marketplace backend outage or partial failure; transient database error on the marketplace; deployment incident on the cloud side; the specific code indicates which marketplace subsystem failed.","solutions":["Retry after a short delay - marketplace internal errors are often transient.","Check Rocket.Chat status / cloud status page for ongoing incidents.","Inspect server logs for the exact response.code to understand which marketplace subsystem failed.","If persistent, report the code to Rocket.Chat support."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"const KNOWN_INTERNAL_CODES = new Set([266, 256, 166, 221, 257, 320]);\n\nfunction classifyMarketplaceResponse(status: number, code: number) {\n  if (status === 500 && KNOWN_INTERNAL_CODES.has(code)) return 'internal-error-retryable';\n  return 'unknown';\n}","typeGuard":"import { MarketplaceAppsError } from './marketplaceErrors';\n\nconst isInternalMarketplaceError = (e: unknown): e is MarketplaceAppsError =>\n  e instanceof MarketplaceAppsError && e.message === 'Marketplace_Internal_Error';","tryCatchPattern":"try {\n  return await fetchMarketplaceApps();\n} catch (e) {\n  if (e instanceof MarketplaceAppsError && e.message === 'Marketplace_Internal_Error') {\n    return await retryWithBackoff(() => fetchMarketplaceApps(), { retries: 3 });\n  }\n  throw e;\n}","preventionTips":["Retry marketplace internal errors with exponential backoff (they are often transient).","Check the cloud status page during sustained failures.","Log the response.code to identify the failing marketplace subsystem.","Degrade the UI gracefully (empty listing) while the marketplace recovers."],"tags":["marketplace","internal-error","upstream","retryable"],"backgroundTag":null,"analyzedSha":"f9d3ec372bb580fa8d036f94cf03925a478ef768","analyzedAt":"2026-08-12T19:07:17.372Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}