RocketChat/Rocket.Chat · error · Error

Failed to save registration data

Error message

Failed to save registration data

What it means

saveRegistrationDataBase writes the eight registration settings (Register_Server plus seven Cloud_Workspace_* values) and then re-reads them in a retry loop — up to 10 attempts, one second apart — until settings.get() matches what was written. The loop exists because settings go through a DB/cache roundtrip; if the values still mismatch on the final attempt (retry === 9) it throws 'Failed to save registration data'.

Source

Thrown at apps/meteor/server/lib/cloud/saveRegistrationData.ts:97

	// we need to make sure that the cache is updated before we continue the procedures
	// we don't actually need to wait a whole second for this, but look this is just a retry mechanism it doesn't mean that actually takes all this time
	for (const retry of Array.from({ length: 10 })) {
		const isSettingsUpdated =
			settings.get('Register_Server') === true &&
			settings.get('Cloud_Workspace_Id') === workspaceId &&
			settings.get('Cloud_Workspace_Name') === client_name &&
			settings.get('Cloud_Workspace_Client_Id') === client_id &&
			settings.get('Cloud_Workspace_Client_Secret') === client_secret &&
			settings.get('Cloud_Workspace_Client_Secret_Expires_At') === client_secret_expires_at &&
			settings.get('Cloud_Workspace_PublicKey') === publicKey &&
			settings.get('Cloud_Workspace_Registration_Client_Uri') === registration_client_uri;

		if (isSettingsUpdated) {
			return;
		}

		if (retry === 9) {
			throw new Error('Failed to save registration data');
		}

		await new Promise((resolve) => setTimeout(resolve, 1000));
	}
}

export async function saveRegistrationDataManual({
	workspaceId,
	client_name,
	client_id,
	client_secret,
	client_secret_expires_at,
	publicKey,
	registration_client_uri,
	licenseData,
}: ManualSaveRegistrationDataDTO) {
	await saveRegistrationDataBase({
		workspaceId,

View on GitHub (pinned to b2c16d5842)

Solutions

  1. Ensure only one registration flow runs at a time — close other tabs/flows and retry the registration.
  2. Check MongoDB health and inspect the rocketchat_settings documents for the Cloud_Workspace_* keys.
  3. Restart the app to clear a stale settings cache, then re-register.
  4. Inspect logs around the registration for failed settings writes or concurrent modification.
Defensive patterns

Strategy: retry

Try / catch

try {
  await saveRegistrationData(dto);
} catch (e) {
  if (e instanceof Error && e.message === 'Failed to save registration data') {
    // settings writes not observable after 10s: check for concurrent flows / settings cache, then re-register once
  }
  throw e;
}

Prevention

When it happens

Trigger: Settings.updateValueById writes silently failing, the settings cache serving stale values for 10+ seconds, or another process overwriting the Cloud_Workspace_* settings between write and verification (e.g. two concurrent registrations flipping values).

Common situations: Two admins or tabs registering the workspace at the same time; MongoDB write problems or heavy load slowing cache invalidation; long-running processes with a stale in-memory settings cache.

Related errors


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