RocketChat/Rocket.Chat · error · MarketplaceAppsError

Marketplace_Failed_To_Fetch_Apps

Error message

Marketplace_Failed_To_Fetch_Apps

What it means

Thrown by fetchMarketplaceApps as the final fallback for any non-200 marketplace response that did not match the specific 426/400-code-200/500-internal-code branches. Maps to MarketplaceAppsError('Marketplace_Failed_To_Fetch_Apps'). It is the catch-all for unmapped marketplace failures (e.g. 401, 403, 404, 429, or a 500 with an untracked code). The response is logged at error level before throwing.

Source

Thrown at apps/meteor/ee/server/apps/marketplace/fetchMarketplaceApps.ts:195

	Apps.getRocketChatLogger().error({ msg: 'Error fetching marketplace apps', status: request.status, response });

	// TODO: Refactor cloud to return a proper error code on unsupported version
	if (request.status === 426 && 'errorMsg' in response && response.errorMsg === 'unsupported version') {
		throw new MarketplaceUnsupportedVersionError();
	}

	if (request.status === 400 && response.code === 200) {
		throw new MarketplaceAppsError('Marketplace_Invalid_Apps_Engine_Version');
	}

	const INTERNAL_MARKETPLACE_ERROR_CODES = [266, 256, 166, 221, 257, 320];

	if (request.status === 500 && INTERNAL_MARKETPLACE_ERROR_CODES.includes(response.code)) {
		throw new MarketplaceAppsError('Marketplace_Internal_Error');
	}

	throw new MarketplaceAppsError('Marketplace_Failed_To_Fetch_Apps');
}

View on GitHub (pinned to f9d3ec372b)

Solutions

  1. Inspect server logs for the actual status and response.code - the generic message hides the detail.
  2. Re-register the workspace if the status is 401/403.
  3. Back off and retry if rate-limited (429).
  4. Update Rocket.Chat if the marketplace API contract changed (404).
  5. Report new internal 500 codes to Rocket.Chat so they can be added to the tracked list.
Defensive patterns

Strategy: try-catch

Validate before calling

function classifyUnknownMarketplaceError(status: number) {
  if (status === 401 || status === 403) return 're-register workspace';
  if (status === 429) return 'rate-limited';
  if (status === 404) return 'endpoint retired - upgrade';
  return 'unknown marketplace failure';
}

Type guard

import { MarketplaceAppsError } from './marketplaceErrors';

const isFailedToFetchApps = (e: unknown): e is MarketplaceAppsError =>
  e instanceof MarketplaceAppsError && e.message === 'Marketplace_Failed_To_Fetch_Apps';

Try / catch

try {
  return await fetchMarketplaceApps();
} catch (e) {
  if (e instanceof MarketplaceAppsError && e.message === 'Marketplace_Failed_To_Fetch_Apps') {
    // generic fallback - inspect server logs for the actual status/code
    return await retryWithBackoff(() => fetchMarketplaceApps(), { retries: 2 });
  }
  throw e;
}

Prevention

When it happens

Trigger: Calling fetchMarketplaceApps() when the marketplace returns a status not specifically handled: 401/403 (auth), 404 (endpoint moved), 429 (rate limit), 500 with a code outside [266,256,166,221,257,320], or any other non-200.

Common situations: Invalid/expired workspace token (401/403); marketplace rate limiting (429); endpoint retired after marketplace API change; unknown marketplace 500 with a new internal code not yet in the tracked list.

Related errors


AI-assisted analysis of RocketChat/Rocket.Chat@f9d3ec372b (2026-08-12). Data as JSON: /api/errors/88371c9f5833a7ed. Report an issue: GitHub.