{"record":{"id":"88371c9f5833a7ed","repo":"RocketChat/Rocket.Chat","slug":"marketplace-failed-to-fetch-apps","errorCode":null,"errorMessage":"Marketplace_Failed_To_Fetch_Apps","messagePattern":"Marketplace_Failed_To_Fetch_Apps","errorType":"exception","errorClass":"MarketplaceAppsError","httpStatus":400,"severity":"error","filePath":"apps/meteor/ee/server/apps/marketplace/fetchMarketplaceApps.ts","lineNumber":195,"sourceCode":"\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":177,"sourceCodeEnd":197,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/ee/server/apps/marketplace/fetchMarketplaceApps.ts#L177-L197","documentation":"MarketplaceAppsError 'Marketplace_Failed_To_Fetch_Apps' is the terminal fallback in fetchMarketplaceApps: thrown when the apps-list response is non-200 and matches none of the specific cases (426 unsupported, 400+code200 engine version, 500+internal codes). It simply means the cloud answered with an unexpected failure status/shape for the apps listing.","triggerScenarios":"Cloud returns e.g. 401/403 (workspace not registered/token invalid), 404, 429, 502/503/504, or a 200-less response whose body does not parse into the known error patterns. Any status outside the handled set funnels here.","commonSituations":"Workspace never registered / de-registered from cloud (auth failures on every marketplace call); gateway 502/503 during cloud deploys; aggressive polling hitting cloud rate limits; proxy in front of the server stripping auth headers.","solutions":["Read the preceding log line 'Error fetching marketplace apps' for the exact status and body — that determines everything downstream.","401/403: resync or re-register the workspace via Connectivity Services.","429/5xx: wait and retry; reduce polling frequency if a custom client hammers the endpoint.","Other codes: escalate to support with the logged payload; consider manual zip install in the interim."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  const apps = await fetchMarketplaceApps();\n} catch (e) {\n  if (e instanceof MarketplaceAppsError && e.message === 'Marketplace_Failed_To_Fetch_Apps') {\n    // inspect server log for upstream status: 401/403 -> resync cloud; 429/5xx -> backoff retry\n  }\n}","preventionTips":["Keep cloud workspace registration synced and monitor for auth failures.","Rate-limit marketplace polling in custom clients to avoid 429s.","Branch recovery on the logged upstream status, since this error is a catch-all."],"tags":["marketplace","cloud","fetch","upstream","enterprise"],"backgroundTag":"upstream-request-failed","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"}