{"record":{"id":"db50f53bb6395fb3","repo":"RocketChat/Rocket.Chat","slug":"marketplace-internal-error","errorCode":null,"errorMessage":"Marketplace_Internal_Error","messagePattern":"Marketplace_Internal_Error","errorType":"exception","errorClass":"MarketplaceAppsError","httpStatus":400,"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/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/ee/server/apps/marketplace/fetchMarketplaceApps.ts#L174-L197","documentation":"MarketplaceAppsError 'Marketplace_Internal_Error' thrown when the marketplace apps-list request returns HTTP 500 whose body code is one of the internal cloud codes [266, 256, 166, 221, 257, 320]. These codes represent known cloud-side processing failures; the server maps them to a single stable error so the UI can show 'marketplace had an internal problem' rather than raw cloud noise. The full response is logged as 'Error fetching marketplace apps'.","triggerScenarios":"Listing marketplace apps while the cloud's apps service errors internally (DB issues, dependency failures upstream). Nothing the client sends can cause these codes except the request itself; it is a transient/upstream-state condition by definition.","commonSituations":"During cloud incidents or deployments; specific apps triggering a cloud bug (then every listing that includes them fails); regional cloud degradation.","solutions":["Retry after a short wait — most internal cloud errors are transient.","Check Rocket.Chat cloud status/announcements for ongoing incidents.","Capture the logged status+response and report to support if it persists for hours, including which filters/pages trigger it.","Meanwhile install needed apps from direct zip upload."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"let lastErr;\nfor (let i = 0; i < 3; i++) {\n  try {\n    return await fetchMarketplaceApps();\n  } catch (e) {\n    if (e instanceof MarketplaceAppsError && e.message === 'Marketplace_Internal_Error') {\n      lastErr = e;\n      await sleep((i + 1) * 2000);\n      continue;\n    }\n    throw e;\n  }\n}\nthrow lastErr;","preventionTips":["Retry internal marketplace errors with exponential backoff and a small retry cap.","Cache the last good apps list and serve it (clearly marked stale) during cloud incidents.","Alert on error-rate spikes to distinguish incidents from persistent cloud defects."],"tags":["marketplace","cloud","internal-error","upstream","enterprise"],"backgroundTag":"upstream-server-error","analyzedSha":"b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0","analyzedAt":"2026-08-18T15:26:39.429Z","contentChangedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}