RocketChat/Rocket.Chat · error · Error

(await response.json()).error

Error message

(await response.json()).error

What it means

startRegisterWorkspaceSetupWizard POSTs the workspace registration intent to cloud /api/v2/register/workspace/intent. On a non-ok response it throws the 'error' field parsed from the cloud's JSON body — so the actual message you see is whatever validation the cloud performed (invalid email, invalid payload, rejected workspace data).

Source

Thrown at apps/meteor/server/lib/cloud/startRegisterWorkspaceSetupWizard.ts:27

export async function startRegisterWorkspaceSetupWizard(resend = false, email: string): Promise<CloudRegistrationIntentData> {
	assertNotOfflineLicense();

	const regInfo = await buildWorkspaceRegistrationData(email);

	let payload;
	try {
		const cloudUrl = settings.get<string>('Cloud_Url');
		const response = await fetch(`${cloudUrl}/api/v2/register/workspace/intent`, {
			body: regInfo,
			method: 'POST',
			params: {
				resent: resend,
			},
			// SECURITY: the URL is a default hardcoded value or an envvar/setting set by an admin. It's safe to disable this check.
			ignoreSsrfValidation: true,
		});
		if (!response.ok) {
			throw new Error((await response.json()).error);
		}

		payload = await response.json();
	} catch (err: any) {
		SystemLogger.error({
			msg: 'Failed to register workspace intent with Rocket.Chat Cloud',
			url: '/api/v2/register/workspace',
			err,
		});

		throw err;
	}

	if (!payload) {
		throw new Error('Failed to fetch registration intent endpoint');
	}

	return payload;

View on GitHub (pinned to b2c16d5842)

Solutions

  1. Read the thrown message — it is the cloud's own validation error text naming the offending field.
  2. Set a valid Organization_Email (and Site_Name) in the Setup Wizard / admin settings and retry.
  3. Verify Cloud_Url and update the server to a supported release.
  4. Check the SystemLogger entry 'Failed to register workspace intent with Rocket.Chat Cloud' for full context.
Defensive patterns

Strategy: try-catch

Validate before calling

const email = settings.get<string>('Organization_Email') ?? '';
if (!/^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(email)) {
  throw new Error('set a valid Organization_Email before registering with cloud');
}

Try / catch

try {
  const payload = await startRegisterWorkspaceSetupWizard(regInfo, resend);
} catch (e) {
  if (e instanceof Error) {
    // the thrown message is the cloud's own validation text — surface it next to the offending wizard field
  }
  throw e;
}

Prevention

When it happens

Trigger: The Setup Wizard registration step where the cloud rejects the intent payload: empty or malformed Organization_Email, invalid Site_Name/device registration info, or stricter cloud-side validation than this server version expects.

Common situations: Organization_Email never configured or with a bad format; older server talking to a newer cloud API; Cloud_Url pointing at the wrong environment; device registration info rejected by policy.

Related errors


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