RocketChat/Rocket.Chat · warning · Meteor.Error

error-push-disabled

error-push-disabled

Error message

Push is disabled

What it means

Thrown by POST push.test when the server setting Push_enable is not exactly true. This is a Meteor.Error('error-push-disabled', ...) with method context 'push_test', so it returns a structured error body. The endpoint also requires auth, the 'test-push-notifications' permission, and is rate-limited to 1 request/second.

Source

Thrown at apps/meteor/server/api/v1/push.ts:381

					tokensCount: { type: 'integer' },
					// The admin "send a test push" setting renders the outcome straight from this
					// response, so it carries the i18n key and its interpolation values.
					message: { type: 'string' },
					params: { type: 'array', items: { type: 'integer' } },
					success: {
						type: 'boolean',
						enum: [true],
					},
				},
				required: ['tokensCount', 'message', 'params', 'success'],
				additionalProperties: false,
			}),
		},
	},

	async function action() {
		if (settings.get('Push_enable') !== true) {
			throw new Meteor.Error('error-push-disabled', 'Push is disabled', {
				method: 'push_test',
			});
		}

		const tokensCount = await executePushTest(this.userId, this.user.username);
		return API.v1.success({ tokensCount, message: 'Your_push_was_sent_to_s_devices', params: [tokensCount] });
	},
);

type PushTestEndpoints = ExtractRoutesFromAPI<typeof pushTestEndpoints>;

type PushTokenEndpoints = ExtractRoutesFromAPI<typeof pushTokenEndpoints>;

type PushGetInfoEndpoints = ExtractRoutesFromAPI<typeof pushGetInfoEndpoints>;

type PushEndpoints = PushTestEndpoints & PushTokenEndpoints & PushGetInfoEndpoints;

declare module '@rocket.chat/rest-typings' {

View on GitHub (pinned to f9d3ec372b)

Solutions

  1. Enable push in Administration > Push (set Push_enable = true) and save before calling push.test.
  2. Use GET /api/v1/push.info to check pushGatewayEnabled before attempting the test.
  3. Configure a push gateway (Push_gateway / credentials) so the test actually reaches a device.
  4. If intentionally disabled, remove the UI/automation that triggers push.test.

Example fix

// before - push disabled on server
await fetch('/api/v1/push.test', { method: 'POST' });

// after - gate on push.info first
const info = await fetch('/api/v1/push.info').then(r => r.json());
if (!info.pushGatewayEnabled) {
  throw new Error('Push is disabled; enable Push_enable in admin settings');
}
await fetch('/api/v1/push.test', { method: 'POST' });
Defensive patterns

Strategy: validation

Validate before calling

// Check push status before triggering the test
const info = await fetch('/api/v1/push.info').then(r => r.json());
if (!info.pushGatewayEnabled) {
  throw new Error('Push is disabled; enable Push_enable in Administration > Push');
}
await fetch('/api/v1/push.test', { method: 'POST' });

Try / catch

try {
  await fetch('/api/v1/push.test', { method: 'POST' }).then(r => r.json());
} catch (e) {
  if (e.error === 'error-push-disabled') { /* prompt admin to enable push */ }
}

Prevention

When it happens

Trigger: POST /api/v1/push.test while Push_enable is false/unset in Administration > Push, or after disabling push during troubleshooting.

Common situations: Admin clicks 'Send a test push' in settings UI before configuring/ enabling the push gateway; push was disabled to debug delivery; fresh install where Push_enable defaults off.

Related errors


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