RocketChat/Rocket.Chat · warning

WARNING: Push APN unknown gateway

Error message

WARNING: Push APN unknown gateway

What it means

The push APN init found an options.apn.gateway that matches neither Apple's sandbox nor production gateway host. Since an unknown gateway almost certainly means a typo or a stale/invalid endpoint, the configured value is logged so you can correct it before pushes silently fail to deliver.

Source

Thrown at apps/meteor/server/lib/notifications/push/apn.ts:140

		// server into production while using the production configuration.
		// On the other hand we could be in development but using the production
		// configuration. And finally we could have configured an unknown apn
		// gateway (this could change in the future - but a warning about typos
		// can save hours of debugging)
		//
		// Warn about gateway configurations - it's more a guide

		if (options.apn.gateway === 'gateway.sandbox.push.apple.com') {
			// Using the development sandbox
			logger.warn('WARNING: Push APN is in development mode');
		} else if (options.apn.gateway === 'gateway.push.apple.com') {
			// In production - but warn if we are running on localhost
			if (/http:\/\/localhost/.test(absoluteUrl)) {
				logger.warn('WARNING: Push APN is configured to production mode - but server is running from localhost');
			}
		} else {
			// Warn about gateways we dont know about
			logger.warn({
				msg: 'WARNING: Push APN unknown gateway',
				gateway: options.apn.gateway,
			});
		}
	} else if (options.production) {
		if (/http:\/\/localhost/.test(absoluteUrl)) {
			logger.warn('WARNING: Push APN is configured to production mode - but server is running from localhost');
		}
	} else {
		logger.warn('WARNING: Push APN is in development mode');
	}

	// Check certificate data
	if (!options.apn.cert?.length) {
		logger.error('ERROR: Push server could not find cert');
	}

	// Check key data

View on GitHub (pinned to b2c16d5842)

Solutions

  1. Fix the gateway value: 'gateway.sandbox.push.apple.com' (dev) or 'gateway.push.apple.com' (prod) — or remove the option entirely
  2. Prefer omitting the gateway so the APN library infers sandbox/production from the credentials
  3. Search the config/template for the logged gateway string to find where the typo lives
  4. Test an iOS push after the change to confirm delivery

Example fix

// before
push: { apn: { gateway: 'gateway.push.aple.com' } }

// after
push: { apn: { gateway: 'gateway.push.apple.com' } }
Defensive patterns

Strategy: validation

Validate before calling

const KNOWN_APN_GATEWAYS = new Set(['gateway.sandbox.push.apple.com', 'gateway.push.apple.com']);

if (options.apn.gateway && !KNOWN_APN_GATEWAYS.has(options.apn.gateway)) {
  throw new Error(`Unknown APN gateway "${options.apn.gateway}" — likely a typo; use a known gateway or omit it`);
}

Prevention

When it happens

Trigger: Setting options.apn.gateway to a misspelled host ('gateway.push.aple.com'), an outdated Apple endpoint, or a custom value the APN client does not support — the comment notes this warning exists to catch typos that cost hours of debugging.

Common situations: Typos in hand-written push configs; old tutorials referencing retired gateway hostnames; copy-paste from another app's config with a different push provider.

Related errors


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