RocketChat/Rocket.Chat · warning · Error
result.error
Error message
result.error
What it means
Thrown by GET /app-request when the marketplace responds with a non-ok HTTP status. The handler reads result = await request.json() and throws new Error(result.error), so the error message is whatever the marketplace put in its error field (could be undefined). The surrounding catch returns API.v1.failure(err.message). This endpoint proxies the marketplace's app-request (feature requests) listing.
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 f9d3ec372b)
Solutions
- Register/re-register the workspace with Rocket.Chat Cloud so the Bearer token is valid.
- Retry after a short delay if the marketplace returned a transient 5xx.
- Reduce polling frequency to avoid rate limits.
- Inspect the marketplace response body: if result.error is undefined the surfaced message will be 'undefined' - check server logs for the logged err object.
Defensive patterns
Strategy: try-catch
Validate before calling
async function canProxyMarketplace(): Promise<boolean> {
try {
const res = await fetch('/api/v1/app-request?appId=test&limit=1');
return res.ok;
} catch { return false; }
} Type guard
const hasErrorField = (result: unknown): result is { error: string } =>
typeof result === 'object' && result !== null &&
typeof (result as any).error === 'string'; Try / catch
try {
const data = await fetch('/api/v1/app-request?' + params).then(r => r.json());
} catch (e) {
// result.error from marketplace propagates as err.message
if (e instanceof Error && /unauthorized|token/i.test(e.message)) {
reRegisterWorkspace();
} else {
backoffAndRetry();
}
} Prevention
- Keep workspace registration current.
- Poll app-request at low frequency to avoid rate limits.
- Treat app-request failures as non-critical in the UI.
- Inspect server logs because result.error may be undefined (surface 'undefined').
When it happens
Trigger: GET /api/v1/app-request?appId=...&q=...&sort=...&limit=...&offset=... where the upstream marketplace returns 4xx/5xx. Common when the workspace token is invalid, the marketplace is rate-limiting, or the appId query has no matching requests.
Common situations: Unregistered workspace (no valid token); marketplace outage or 5xx; rate limiting from too many app-request polls; client passed an appId the marketplace does not recognize.
Related errors
- Failed to build App Request external url
- App package download failed
- App metadata download failed
- Invalid response from API
- App not found
AI-assisted analysis of RocketChat/Rocket.Chat@f9d3ec372b (2026-08-12).
Data as JSON: /api/errors/b97235c12513879c.
Report an issue: GitHub.