{"record":{"id":"15e25b53d05b8804","repo":"RocketChat/Rocket.Chat","slug":"marketplace-failed-to-fetch-categories","errorCode":null,"errorMessage":"Marketplace_Failed_To_Fetch_Categories","messagePattern":"Marketplace_Failed_To_Fetch_Categories","errorType":"exception","errorClass":"MarketplaceAppsError","httpStatus":400,"severity":"error","filePath":"apps/meteor/ee/server/apps/marketplace/fetchMarketplaceCategories.ts","lineNumber":75,"sourceCode":"\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":57,"sourceCodeEnd":77,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/ee/server/apps/marketplace/fetchMarketplaceCategories.ts#L57-L77","documentation":"MarketplaceAppsError 'Marketplace_Failed_To_Fetch_Categories' is the fallback throw in fetchMarketplaceCategories for any non-200 response that is neither the 426 unsupported-version case (174) nor the 500+internal-code case (175). It means the categories endpoint answered with an unexpected failure (auth, rate limit, gateway error, unparseable body).","triggerScenarios":"Categories fetch returning 401/403 (bad workspace token), 429, 502/503/504, or odd statuses whose body codes are not in [189, 266]; all funnel to this error after being logged.","commonSituations":"Cloud registration/token problems; gateway hiccups during deploys; rate-limited custom dashboards polling categories; proxies mangling responses.","solutions":["Inspect the 'Error fetching marketplace categories' log entry for the concrete status and body.","Auth failures: resync Connectivity Services workspace registration.","Transient 5xx/429: back off and retry with jittered timing.","Persistent odd statuses: report with logs; use app search without categories meanwhile."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  const cats = await fetchMarketplaceCategories();\n} catch (e) {\n  if (e instanceof MarketplaceAppsError && e.message === 'Marketplace_Failed_To_Fetch_Categories') {\n    // check the log for the concrete status: auth -> resync; 429/5xx -> backoff; else report\n  }\n}","preventionTips":["Monitor upstream status codes for categories calls to classify auth vs availability failures.","Keep cloud registration synced and healthy.","Degrade to a category-less marketplace UI instead of blocking app browsing."],"tags":["marketplace","categories","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"}