For a while now I’m having issues with push notifications for iOS (APNS).
(Using parse server v.7.4.0)
Push messages with valid device tokens fail with one of the following messages:
ERR! parse-server-push-adapter APNS VError: stream ended unexpectedly with status null and empty body
ERR! parse-server-push-adapter APNS at ClientHttp2Stream.<anonymous> (/app/node_modules/@parse/node-apn/lib/client.js:241:27)
ERR! parse-server-push-adapter APNS at ClientHttp2Stream.emit (node:events:518:28)
ERR! parse-server-push-adapter APNS at endReadableNT (node:internal/streams/readable:1698:12)
ERR! parse-server-push-adapter APNS at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
ERR! parse-server-push-adapter APNS APNS error transmitting to device %s with error %s <VALID_DEVICE_TOKEN_OMITTED> VError: stream ended unexpectedly with status null and empty body
ERR! parse-server-push-adapter APNS at ClientHttp2Stream.<anonymous> (/app/node_modules/@parse/node-apn/lib/client.js:241:27)
ERR! parse-server-push-adapter APNS at ClientHttp2Stream.emit (node:events:518:28)
ERR! parse-server-push-adapter APNS at endReadableNT (node:internal/streams/readable:1698:12)
ERR! parse-server-push-adapter APNS at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
ERR! parse-server-push-adapter APNS jse_shortmsg: 'stream ended unexpectedly with status null and empty body',
ERR! parse-server-push-adapter APNS jse_info: {},
ERR! parse-server-push-adapter APNS cause: [Function: ve_cause]
ERR! parse-server-push-adapter APNS }
or
ERR! parse-server-push-adapter APNS VError: apn write failed: Stream closed with error code NGHTTP2_INTERNAL_ERROR
ERR! parse-server-push-adapter APNS at ClientHttp2Stream.<anonymous> (/app/node_modules/@parse/node-apn/lib/client.js:287:19)
ERR! parse-server-push-adapter APNS at ClientHttp2Stream.emit (node:events:518:28)
ERR! parse-server-push-adapter APNS at emitErrorNT (node:internal/streams/destroy:169:8)
ERR! parse-server-push-adapter APNS at emitErrorCloseNT (node:internal/streams/destroy:128:3)
ERR! parse-server-push-adapter APNS at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
ERR! parse-server-push-adapter APNS APNS error transmitting to device %s with error %s <VALID_DEVICE_TOKEN_OMITTED> VError: apn write failed: Stream closed with error code NGHTTP2_INTERNAL_ERROR
ERR! parse-server-push-adapter APNS at ClientHttp2Stream.<anonymous> (/app/node_modules/@parse/node-apn/lib/client.js:287:19)
ERR! parse-server-push-adapter APNS at ClientHttp2Stream.emit (node:events:518:28)
ERR! parse-server-push-adapter APNS at emitErrorNT (node:internal/streams/destroy:169:8)
ERR! parse-server-push-adapter APNS at emitErrorCloseNT (node:internal/streams/destroy:128:3)
ERR! parse-server-push-adapter APNS at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
ERR! parse-server-push-adapter APNS jse_shortmsg: 'apn write failed',
ERR! parse-server-push-adapter APNS jse_cause: Error [ERR_HTTP2_STREAM_ERROR]: Stream closed with error code NGHTTP2_INTERNAL_ERROR
ERR! parse-server-push-adapter APNS at ClientHttp2Stream._destroy (node:internal/http2/core:2356:13)
ERR! parse-server-push-adapter APNS at _destroy (node:internal/streams/destroy:121:10)
ERR! parse-server-push-adapter APNS at ClientHttp2Stream.destroy (node:internal/streams/destroy:83:5)
ERR! parse-server-push-adapter APNS at Writable.destroy (node:internal/streams/writable:1122:11)
ERR! parse-server-push-adapter APNS at Http2Stream.onStreamClose (node:internal/http2/core:552:12) {
ERR! parse-server-push-adapter APNS code: 'ERR_HTTP2_STREAM_ERROR'
ERR! parse-server-push-adapter APNS },
ERR! parse-server-push-adapter APNS jse_info: {},
ERR! parse-server-push-adapter APNS cause: [Function: ve_cause]
ERR! parse-server-push-adapter APNS }
Push messages with invalid device tokens fail as well (as expected) but with a proper status code:
ERR! parse-server-push-adapter APNS APNS error transmitting to device <faulty device token> with status 400 and reason BadDeviceToken
I have parse-server push configured like this:
push: {
android: {
firebaseServiceAccount: "/pushauth/android_pushauth.json"
},
ios: [{
token: {
key: "/pushauth/ios_pushauth.p8",
keyId: "KeyID omitted",
teamId: "TeamId omitted"
},
topic: "bundleid omitted",
production: true
},
{
token: {
key: "/pushauth/ios_pushauth.p8",
keyId: "KeyID omitted",
teamId: "TeamId omitted"
},
topic: "bundleid omitted",
production: true
}]
}
The server runs as part of a express node application in a Docker image (based on the node:20-alpine
image).
Is there any known cause of these issues? I have seen suggestions to “reinstall node”, but since this is a docker image with node preinstalled at the base that’s not really an option.