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
- 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.
- Re-register/resync the workspace with the cloud (Administration -> Connectivity Services -> Sync) to refresh the token used in headers.
- Validate the query params (appId exists, q/sort/limit/offset well-formed) before calling.
- 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
- Keep the workspace cloud registration synced; expired tokens are the top cause of non-ok upstream responses.
- Cache app-request lists briefly instead of refetching on every UI action.
- Treat cloud error strings as unstable: log them, but key your logic on the failure envelope, not the message.
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
- App metadata download failed
- App package download failed
- Invalid response from the Marketplace
- Invalid url. It doesn't exist or is not "application/zip".
- Marketplace_Failed_To_Fetch_Apps
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)