Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Got weird APN error on some push #461

Closed
sambegin opened this issue Oct 31, 2016 · 9 comments
Closed

Got weird APN error on some push #461

sambegin opened this issue Oct 31, 2016 · 9 comments

Comments

@sambegin
Copy link

sambegin commented Oct 31, 2016

Hi,

We've been using this project for a while now and everything was working perfectly since about one weak or two as more and more users came on our application.

First, we've created one provider as the doc says and sending one or more notification with the service :

 sendNotification(usersDeviceToken, notification) {
    let self = this;
    let apnNotification = _createBasicNoteProperty(this);
    _setCustomNoteProperty(apnNotification, notification);
    console.log('sending apn notification : ');
    console.log(apnNotification);
    self.apnProvider.send(apnNotification, usersDeviceToken)
        .then(self.meteor.bindEnvironment((result) => {
          self.apnResponseHandler.handleResponse(result);
        }));
  }

Second : we've created an "apnResponseHandler" to handle errors that can occur like "Not registered" or any other problems with tokens that should be handled as the apple documentation says :

handleResponse(result) {
    let self = this;
    result.failed.forEach((failure) => {
      if (failure.response && failure.response.reason) {
        console.warn(`Got APN failure on device ${failure.device} with status ${failure.status} and server response: ${failure.response.reason}`);
        _handleTokenAccordingToFailureDetails(failure, self);
      } else {
        console.error('Weird APN failure: ');
        console.error(failure);
      }
    });
  }

The interesting part here is in the "else" statement. For about about a weak or so, APN sends us two kind of error that are going into this "else" statement and we did not find any information about those errors on Apple documentation :

1-- >
{ device: 'some...Device...Token'',
error:
{ [VError: apn write failed: GOAWAY: REFUSED_STREAM Maximum active streams violated for this endpoint.]
jse_shortmsg: 'apn write failed: GOAWAY: REFUSED_STREAM Maximum active streams violated for this endpoint.',
jse_info: {},
message: 'apn write failed: GOAWAY: REFUSED_STREAM Maximum active streams violated for this endpoint.' } }

I would like to know :

  • What is this error and where can we find information about it ?
  • How can we correct it ?

2 --> { device: 'some...Device...Token', error:
{ [VError: apn write failed: connection error: Error: stream.push() after EOF]
jse_shortmsg: 'apn write failed: connection error: Error: stream.push() after EOF',
jse_info: {},
message: 'apn write failed: connection error: Error: stream.push() after EOF' } }

I would like to know :

  • What is this error and where can we find information about it ?
  • How can we correct it ?

Any help on that would be greatly appreciated ! If you need any more information please ask me.

@sambegin
Copy link
Author

sambegin commented Nov 1, 2016

Getting another error on notifications this morning :
{ device: '0861dde79df8dc ... 43b132a9f226fe07ff08',
error:
{ [VError: apn write failed: write EPIPE]
jse_shortmsg: 'apn write failed',
jse_cause: { [Error: write EPIPE] code: 'EPIPE', errno: 'EPIPE', syscall: 'write' },
jse_info: {},
message: 'apn write failed: write EPIPE' } }

Any idea on this one and the two I wrote yesterday ?

@sambegin
Copy link
Author

sambegin commented Nov 2, 2016

Guys, need your help on that too. Seems to be a problem with the connection with the provider. I need to know if it comes from node-apn or somewhere else.

We're getting other back to back errors now :

{ device: 'd92e300a272c8567406f1 .. .. . .. . . .7627149c9a361903f69a0',
error:
{ [VError: apn write failed: connection error: PROTOCOL_ERROR]
jse_shortmsg: 'apn write failed: connection error: PROTOCOL_ERROR',
jse_info: {},
message: 'apn write failed: connection error: PROTOCOL_ERROR' } }

{ device: '1626a3a0e6df7877ed0b.... .. ....c41eb476871660a55db4ae6660ecb38',
error:
{ [VError: stream ended unexpectedly]
jse_shortmsg: 'stream ended unexpectedly',
jse_info: {},
message: 'stream ended unexpectedly' } }

Any idea anyone ?

@sambegin
Copy link
Author

sambegin commented Nov 4, 2016

@florianreinhart any clues on that ?
Still trying to debug this package to see what's happening...

We are now receiving "Internal server error 500" 100% of the time.

How does this package handle this error ? Do we need to do anything more with this? Cleary our iOS users are not receiving notifications anymore.

@philberg
Copy link

philberg commented Nov 4, 2016

@sambegin I suspect you are seeing the same issues as we are in #449 #454

@sambegin
Copy link
Author

sambegin commented Nov 4, 2016

@philberg

I did look into those issue but never saw the ETIMEDOUT our write ECONNRESET error in our logs.
Didn't seem to go trough the same "failure steps" (

  • GOAWAY: REFUSED_STREAM Maximum active streams violated for this endpoint
  • apn write failed: connection error: Error: stream.push() after EOF
  • apn write failed: connection error: PROTOCOL_ERROR
  • stream ended unexpectedly
    )

before receiving a lot of "Internal server error".

Moreover, errors seem to change over time as it continues to fail over and over.

Now we are getting : "apn write failed: This socket is closed."

As I read on some issues here, this package should handle connections by itself but clearly we are in a wrong and infinite state here. I would be glad to help debug this but I need more information about all the errors I've got so far to understand clearly what's happening.

@philberg
Copy link

philberg commented Nov 4, 2016

@sambegin then maybe I'm seeing the same issues you are, and the others are different, because I'm seeing exactly that.

Are you using an auth token, or the older certificate-based auth? I noticed that when I switched back from token to PEM certificates, the connection issues seem to be much less, although they do still appear

@sambegin
Copy link
Author

sambegin commented Nov 4, 2016

@philberg I am using an auth token. We switched about a month ago from old certificate-based auth and everything was working perfectly since about 2 weeks...

We also did not change anything in the way we send notification (so it doesn't seems do be a payload error or something with the notification json object itself) except the fact that we have more and more users using our application... I'm wondering if it could be a problem.

Also, everything is working when I run our application locally... using development or production environment.

@oliversalzburg
Copy link

oliversalzburg commented Nov 6, 2016

Has anyone contacted Apple Developer Support about this?

@florianreinhart
Copy link
Member

@sambegin I think your issues are related to the ones discussed in #449.

I'd like to keep the discussion to a single thread. So I am closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants