Comments (8)
Is it happening on your production server or your local machine? Any chance your internet connection is hanging?
from node-apn.
Happen on production servers on AWS. So, I think that internet is good there
from node-apn.
const provider = new apn.Provider(config.apns);
Can you provide more details about what that config is? As much detail, e.g. are proxies being used, what keys and what values (where not credentials), etc.
What node.js version are you using in AWS?
How many notifications per second? What is the typical cpu usage for node in that application (e.g. if it's close to 100% or there's a high cpu time per tick requests might time out)
How often does this happen per hour in a single process?
Are there also error messages about reconnecting?
Is this a long-lived application or a short-lived script (not sure if it'd matter, but lambda seems to have had issues in other web servers for reasons I'm not familiar with)? aws/aws-sdk-js#3591 mentions a similar error message in a completely different context
from node-apn.
Ok, I'll provide you that information below.
Can you provide more details about what that config is? As much detail, e.g. are proxies being used, what keys and what values (where not credentials), etc.
My config.apns
content. I'm not using proxy.
// p8 certificate
const key = `
-----BEGIN PRIVATE KEY-----
xxxxxxxx
-----END PRIVATE KEY-----
`;
export default {
token: {
key,
keyId: 'xxxxxx',
teamId: 'xxxxxx',
},
production: true,
requestTimeout: 15000,
};
What node.js version are you using in AWS?
nodejs: v14.17.3
How many notifications per second? What is the typical cpu usage for node in that application (e.g. if it's close to 100% or there's a high cpu time per tick requests might time out)
About ~40/second notifications.
CPU usage: I don't know since I'm running the script on Lambda and I haven't that information.
How often does this happen per hour in a single process?
Sometimes could pass a couple of days without any issue. And sometimes, like today (Aug 9th, 2021), about 5 times along the day.
Are there also error messages about reconnecting?
Mmmm no, I didn't see any error related to reconnecting. But sometimes, the error is a timeout error instead the mentioned in the issue (apn write timeout
)
Is this a long-lived application or a short-lived script (not sure if it'd matter, but lambda seems to have had issues in other web servers for reasons I'm not familiar with)? aws/aws-sdk-js#3591 mentions a similar error message in a completely different context
short-time and I running the script on Lambda, I'll check that issue
from node-apn.
Are any function to reconnect the client/provider when I detect that error? Or this happen be automatically?
from node-apn.
I can reproduce this issue using latest version 5.1.0 in this environment:
- Local macos: always working for node v14 and v16
- AWS node v16: working
- AWS node v14: Stream ended unexpectedly with status null and empty body
The AWS I was deploying in a docker container behind LB.
from node-apn.
I'm using node v14 since node v16 is not supported by lambda yet
from node-apn.
I'm closing this as it seems to be resolved. Feel free to comment if you have any questions and we can re-open this issue.
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
- Getting InvalidProviderToken with all valid Key, KeyId and TeamID HOT 2
- Ay caramba, clarifying the FORMAT of the deviceToken !! 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.