{"record":{"id":"35ddfd52fedc6412","repo":"RocketChat/Rocket.Chat","slug":"warning-push-apn-unknown-gateway","errorCode":null,"errorMessage":"WARNING: Push APN unknown gateway","messagePattern":"WARNING: Push APN unknown gateway","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"apps/meteor/server/lib/notifications/push/apn.ts","lineNumber":140,"sourceCode":"\t\t// server into production while using the production configuration.\n\t\t// On the other hand we could be in development but using the production\n\t\t// configuration. And finally we could have configured an unknown apn\n\t\t// gateway (this could change in the future - but a warning about typos\n\t\t// can save hours of debugging)\n\t\t//\n\t\t// Warn about gateway configurations - it's more a guide\n\n\t\tif (options.apn.gateway === 'gateway.sandbox.push.apple.com') {\n\t\t\t// Using the development sandbox\n\t\t\tlogger.warn('WARNING: Push APN is in development mode');\n\t\t} else if (options.apn.gateway === 'gateway.push.apple.com') {\n\t\t\t// In production - but warn if we are running on localhost\n\t\t\tif (/http:\\/\\/localhost/.test(absoluteUrl)) {\n\t\t\t\tlogger.warn('WARNING: Push APN is configured to production mode - but server is running from localhost');\n\t\t\t}\n\t\t} else {\n\t\t\t// Warn about gateways we dont know about\n\t\t\tlogger.warn({\n\t\t\t\tmsg: 'WARNING: Push APN unknown gateway',\n\t\t\t\tgateway: options.apn.gateway,\n\t\t\t});\n\t\t}\n\t} else if (options.production) {\n\t\tif (/http:\\/\\/localhost/.test(absoluteUrl)) {\n\t\t\tlogger.warn('WARNING: Push APN is configured to production mode - but server is running from localhost');\n\t\t}\n\t} else {\n\t\tlogger.warn('WARNING: Push APN is in development mode');\n\t}\n\n\t// Check certificate data\n\tif (!options.apn.cert?.length) {\n\t\tlogger.error('ERROR: Push server could not find cert');\n\t}\n\n\t// Check key data","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/server/lib/notifications/push/apn.ts#L122-L158","documentation":"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.","triggerScenarios":"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.","commonSituations":"Typos in hand-written push configs; old tutorials referencing retired gateway hostnames; copy-paste from another app's config with a different push provider.","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"],"exampleFix":"// before\npush: { apn: { gateway: 'gateway.push.aple.com' } }\n\n// after\npush: { apn: { gateway: 'gateway.push.apple.com' } }","handlingStrategy":"validation","validationCode":"const KNOWN_APN_GATEWAYS = new Set(['gateway.sandbox.push.apple.com', 'gateway.push.apple.com']);\n\nif (options.apn.gateway && !KNOWN_APN_GATEWAYS.has(options.apn.gateway)) {\n  throw new Error(`Unknown APN gateway \"${options.apn.gateway}\" — likely a typo; use a known gateway or omit it`);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"tags":["push","apn","ios","typo","configuration"],"backgroundTag":"apn-gateway-misconfiguration","analyzedSha":"b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0","analyzedAt":"2026-08-18T15:26:39.429Z","contentChangedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}