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 dataView on GitHub (pinned to b2c16d5842)
Solutions
- Fix the gateway value: 'gateway.sandbox.push.apple.com' (dev) or 'gateway.push.apple.com' (prod) — or remove the option entirely
- Prefer omitting the gateway so the APN library infers sandbox/production from the credentials
- Search the config/template for the logged gateway string to find where the typo lives
- 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
- Prefer omitting the gateway option entirely
- If set, copy gateway hostnames from Apple's current docs, character by character
- Fail fast on unknown gateway values instead of letting pushes silently fail
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
- WARNING: Push APN is in development mode
- WARNING: Push APN is configured to production mode - but ser
- error-push-disabled
- Livechat secret token is not configured
- Invalid MONGO_OPTIONS environment variable: must be valid JS
AI-assisted analysis of RocketChat/Rocket.Chat@b2c16d5842 (2026-08-18).
Data as JSON: /api/errors/35ddfd52fedc6412.
Report an issue: GitHub.