Comments (15)
What's the output of node_modules/.bin/mocha test/client.js
with this project?
What version of parse/node-apn is used (e.g. check package-lock.json) - 4.0.0 is the latest?
What node version are you using?
from node-apn.
What's the output of node_modules/.bin/mocha test/client.js with this project?
I've run npm run test
in the directory and I actually have a lot of errors.
What version of parse/node-apn is used (e.g. check package-lock.json) - 4.0.0 is the latest?
package-lock.json has it at 4.0.0
What node version are you using?
node": "12.13.1
from node-apn.
I also tried with 3.2.0
and I do receive the errors correctly, i.e. status=400, reason=MissingDeviceToken
, but the error is triggered after about 60 seconds, no matter the requestTimeout
I set. So under 3.2.0 I can reach https://github.com/parse-community/node-apn/blob/master/lib/client.js#L160 the request.on('end')
from node-apn.
https://github.com/parse-community/node-apn/runs/1629508878?check_suite_focus=true passes in node v12.20.0 - it also passes for me in v12.18.3 on linux. 12.13.1 also passes when I install and use that with nvm
on linux. But maybe it's specific to the https implementation instead of http for unit tests.
Does it work if you upgrade to the latest node 12.20.0+?
I meant if you clone https://github.com/parse-community/node-apn , run npm install, and run npm test - what is the console output
What OS are you using?
How does this affect the application you're using? It should still be calling resolve() in the error
from node-apn.
I tried to clone and run the tests from an empty project and they all passed successfully. There must be something in my application that is breaking. I have a large application, and also have node-apn v1.7.8 installed for fallback, which might be causing the issue.
I will investigate more and write back here in case someone also encounters this issue. Thank you for the narrowing the problem.
from node-apn.
In the end, I've opted to downgrade to version 3.2.0
since it seems to work stable, I could not narrow the problem down.
from node-apn.
I had successfully used 4.0.0 on node v10.3.0 for some time and all MissingDeviceToken error messages were received correctly. Now on the same environment (didn't change a bit) I just get VError: stream ended unexpectedly / VError: apn write timeout.
Has Apple APNs changed some timeout parameter or implemented a different policy on the http connection ?
from node-apn.
I had successfully used 4.0.0 on node v10.3.0 for some time and all MissingDeviceToken error messages were received correctly. Now on the same environment (didn't change a bit) I just get VError: stream ended unexpectedly / VError: apn write timeout.
Has Apple APNs changed some timeout parameter or implemented a different policy on the http connection ?
What fraction of requests have errors?
No idea what your issue is - I'm surprised at http/2 disconnecting. Are you properly reusing the established connection (i.e. not constantly establishing new connections to APNs, e.g. by starting a lot of node processes or by creating brand new node-apn clients?) - I think establishing too many network connections to APNs may cause them to reject new connections as a potential Denial of Service.
What's the expiry date of your certificate? Do you log the tokens and JSON payloads you're sending to apns - are both of them valid (e.g. no JSON encoding errors, tokens are all representations of token data of the correct length). Is this the right app (e.g. are you using a debug build that should receive pushes from a sandbox apns server with the production apns server?)
Can you establish connections to apns manually for pems (https://github.com/node-apn/node-apn/wiki/Preparing-Certificates) - I forget how to check p8 fils
EDIT: Also, how many requests are you trying to send at a time?
from node-apn.
Hi,
I'm using .p8 key files (never expires) and both tokens and json payloads are valid. I'm testing it in production.
Today with the same code I get no errors. I believe yesterday I raised some conditions for throttling during the tests that the code didn't seem to be able to deal with correctly.
from node-apn.
I am also having the same issue in my demo of node-apn. Can any one help me with it?
Node v:12.16.3
node-apn: 4.0
error: VError: stream ended unexpectedly
at ClientHttp2Stream.<anonymous> (/Users/hardik.ganjwala/Desktop/push_sample/node_modules/@parse/node-apn/lib/client.js:186:25)
at ClientHttp2Stream.emit (events.js:310:20)
at endReadableNT (_stream_readable.js:1187:12)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
jse_shortmsg: 'stream ended unexpectedly',
jse_info: {}
from node-apn.
Enable the logger for your app temporarily (or permanently, if it's low volume for your use case)
DEBUG=apn
can be used to set this - node-apn uses the npm debug
module https://www.npmjs.com/package/debug
const error = new VError(e, 'Unexpected error processing APNs response');
if (logger.enabled) {
logger(`Unexpected error processing APNs response: ${e.message}`);
}
from node-apn.
I'm having the same issue randomly in production. It works 99% of time, but sometimes (a couple of times per day) I'm getting this response. Anyone know what could be happening?
{
"failed": [
{
"device": "7f7400dbf5013a1__hidden__f48de965b94f4cdb41530",
"error": {
"jse_shortmsg": "apn write timeout",
"jse_info": {},
"message": "apn write timeout"
}
}
],
"message": {
"body": { hidden... },
"aps": {
"sound": "default",
"alert": {
"body": "hidden...",
"title": "hidden..."
}
}
}
}
from node-apn.
Have you tried to increase the timeout limit?
from node-apn.
@davimacedo I'm using the default, I'll update to 10000 ms
from node-apn.
I'm closing this as it does not seem to be a Parse node-apn issue.
- For help with Parse Platform we recommend our community forum
- For coding questions we recommend Stack Overflow using the parse-platform tag
- For network and server questions we recommend ServerFault using the parse-server tag
from node-apn.
Related Issues (20)
- Security vulnerability in node-forge HOT 1
- Location Push Service Notification Support HOT 2
- Notification successfully sent but not received HOT 6
- iOS Push Notification Error: {reason: 'TopicDisallowed'} HOT 3
- shutdown callback is not passed through from the Provider to the Client HOT 2
- Upgrade jsonwebtoken library HOT 3
- Resource leak when calling shutdown before finish writing HOT 1
- Is this project abandoned? HOT 4
- Add support for Node 18, 20 HOT 3
- Uncaught VError: Failed to generate token: secretOrPrivateKey must be an asymmetric key when using ES256 HOT 3
- Live Activity app not producing proper APS payload (events instead of event, missing dismissal-date) HOT 1
- I miss the localised subtitle properties `subtitle-loc-key` and `subtitle-loc-args` because you're using old Apple documentation HOT 1
- GOAWAY errors HOT 7
- topic missing in type ProviderOptions HOT 6
- issue with push 20k devices in one go HOT 2
- Images not working? HOT 2
- ENOENT: no such file or directory, open './voip.pem' HOT 1
- node-forge upgrade? HOT 1
- How can i use .pem file HOT 1
- aps property on Notification is being set to undefined HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-apn.