RocketChat/Rocket.Chat · error · MarketplaceAppsError

Marketplace_Failed_To_Fetch_Categories

Error message

Marketplace_Failed_To_Fetch_Categories

What it means

The catch-all marketplace failure: thrown by `fetchMarketplaceCategories()` for any non-200 response that is not the specific 426 'unsupported version' case nor the 500 internal-error-code case. It indicates the categories endpoint could be reached and parsed but returned an unexpected status (e.g. 401, 403, 404, 502, 503). The response status and body are logged before throwing.

Source

Thrown at apps/meteor/ee/server/apps/marketplace/fetchMarketplaceCategories.ts:75

		return response;
	}

	const response = await request.json();

	Apps.getRocketChatLogger().error({ msg: 'Error fetching marketplace categories', 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();
	}

	const INTERNAL_MARKETPLACE_ERROR_CODES = [189, 266];

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

	throw new MarketplaceAppsError('Marketplace_Failed_To_Fetch_Categories');
}

View on GitHub (pinned to f9d3ec372b)

Solutions

  1. Verify workspace registration and that a valid cloud token exists (re-register the workspace in Administration > Connectivity Services).
  2. Check the logged `status` value: 401/403 points to token/auth, 5xx points to cloud-side or network proxy issues.
  3. Confirm `SSRF_Allowlist` setting is not blocking the marketplace host and that the server can reach the cloud endpoint.
  4. Retry after re-registering; if status is 5xx, treat as transient and retry with backoff.
Defensive patterns

Strategy: try-catch

Validate before calling

import { getWorkspaceAccessToken } from '../../../../server/lib/cloud';

async function canReachMarketplace(): Promise<boolean> {
	const token = await getWorkspaceAccessToken();
	if (!token) return false; // no auth token → likely 401/403
	return true;
}

Type guard

import { MarketplaceAppsError } from './marketplaceErrors';

function isMarketplaceFetchCategoriesError(e: unknown): boolean {
	return e instanceof MarketplaceAppsError && e.message === 'Marketplace_Failed_To_Fetch_Categories';
}

Try / catch

try {
	const categories = await fetchMarketplaceCategories();
} catch (e) {
	if (e instanceof MarketplaceAppsError) {
		// inspect logged status; 401/403 → re-register workspace, 5xx → retry
	}
	throw e;
}

Prevention

When it happens

Trigger: The marketplace client's `fetch('v1/categories')` returns a status other than 200, other than 426-with-`errorMsg==='unsupported version'`, and other than 500-with-code 189/266. Common triggers: expired/revoked workspace access token (401/403), missing token, cloud routing error (502/503/504), or a malformed request.

Common situations: Workspace registration/token expired or never obtained (`getWorkspaceAccessToken()` returned falsy so no Authorization header was sent); cloud load balancer returning 502/503 during maintenance; SSRF allowlist misconfiguration causing a proxy rejection that surfaces as a non-200.

Related errors


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