RocketChat/Rocket.Chat · error

result.error

Error message

result.error

What it means

Thrown by the EE REST proxy for marketplace app requests (list endpoint) when the upstream cloud request completes but the response is non-ok. The server parses the JSON body and rethrows the marketplace's own error string: throw new Error(result.error). The message shown is literally whatever the cloud put in its error field, so 'result.error' in telemetry means the proxyed body had an error value (or undefined) with a non-2xx status. The catch converts it to API.v1.failure for the caller.

Solutions

  1. Check the server log ('Error getting the app requests from marketplace') — the entry before it shows the cloud status; a 401 points at workspace registration.
  2. Re-register/resync the workspace with the cloud (Administration -> Connectivity Services -> Sync) to refresh the token used in headers.
  3. Validate the query params (appId exists, q/sort/limit/offset well-formed) before calling.
  4. Retry after cloud-side incidents; if persistent across all requests, open a cloud support ticket with the status code.
Defensive patterns

Strategy: try-catch

Try / catch

try {
  const res = await GET('/api/v1/apps/1fa9dc27-d0b2-4b34-b6d7-35564e569d3d?status=broken&appIds=...');
  if (!res.success) handleMarketplaceUpstreamFailure(res.error);
} catch (e) {
  // the route already converts to API.v1.failure; branch on err.message from the cloud body
}

Prevention

When it happens

Trigger: GET appsFromMarketplace / app-requests listing route where the fetch to cloud v1/app-request?appId=...&q=... returns 4xx/5xx; typical causes are an expired/absent workspace token in the Authorization headers (401), bad query params, or cloud-side errors. Any non-ok status with a JSON error field produces this exact throw.

Common situations: Workspace cloud token expired or revoked (Connectivity Services not synced); passing an appId the cloud does not recognize; cloud incidents returning 502 with error bodies; rate limiting on the cloud side.

Related errors


AI-assisted analysis of RocketChat/Rocket.Chat@b2c16d5842 (2026-08-18). Data as JSON: /api/errors/b97235c12513879c. Report an issue: GitHub.

Appendix: source

Thrown at apps/meteor/ee/server/apps/communication/rest.ts:647

					const headers = getDefaultHeaders();

					const token = await getWorkspaceAccessToken();
					if (token) {
						headers.Authorization = `Bearer ${token}`;
					}

					try {
						const request = await orchestrator
							.getMarketplaceClient()
							.fetch(`v1/app-request?appId=${appId}&q=${q}&sort=${sort}&limit=${limit}&offset=${offset}`, {
								headers,
								// SECURITY: user needs specific privileges to send this. Bypassing the SSRF check is okay for now.
								ignoreSsrfValidation: true,
							});
						const result = await request.json();

						if (!request.ok) {
							throw new Error(result.error);
						}
						return API.v1.success(result);
					} catch (err: any) {
						orchestrator.getRocketChatLogger().error({ msg: 'Error getting the app requests from marketplace', err });

						return API.v1.failure(err.message);
					}
				},
			},
		);

		this.api.addRoute(
			'app-request/stats',
			{ authRequired: true },
			{
				async get() {
					const headers = getDefaultHeaders();

View on GitHub (pinned to b2c16d5842)