Code Monkey home page Code Monkey logo

Comments (8)

davimacedo avatar davimacedo commented on September 16, 2024

Is it happening on your production server or your local machine? Any chance your internet connection is hanging?

from node-apn.

RodolfoGS avatar RodolfoGS commented on September 16, 2024

Happen on production servers on AWS. So, I think that internet is good there

from node-apn.

TysonAndre avatar TysonAndre commented on September 16, 2024

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.

RodolfoGS avatar RodolfoGS commented on September 16, 2024

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.

RodolfoGS avatar RodolfoGS commented on September 16, 2024

Are any function to reconnect the client/provider when I detect that error? Or this happen be automatically?

from node-apn.

CallMeLaNN avatar CallMeLaNN commented on September 16, 2024

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.

RodolfoGS avatar RodolfoGS commented on September 16, 2024

I'm using node v14 since node v16 is not supported by lambda yet

from node-apn.

mtrezza avatar mtrezza commented on September 16, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.