immobiliare / ApnsPHP

ApnsPHP: Apple Push Notification & Feedback Provider
BSD 3-Clause "New" or "Revised" License
1.43k stars 452 forks source link

ERROR: Unable to send message ID 117: Internal error (0 bytes written instead of 65 bytes) (999) #97

Open gpdawson opened 9 years ago

gpdawson commented 9 years ago

I'm getting regular message send errors - roughly every 100 to 150 messages (roughly once per second) sent there appears to be a disconnection. Could this be due to an ApnsPHP configuration issue, or perhaps some php or server issue? Or is there a bug causing this?

Sample from stream of debug output: ... Thu, 11 Jun 2015 23:43:23 -0400 ApnsPHP[15794]: STATUS: Sending message ID 115 custom identifier: unset: 65 bytes. Thu, 11 Jun 2015 23:43:23 -0400 ApnsPHP[15794]: STATUS: Sending message ID 116 custom identifier: unset: 65 bytes. Thu, 11 Jun 2015 23:43:23 -0400 ApnsPHP[15794]: STATUS: Sending message ID 117 custom identifier: unset: 65 bytes. Thu, 11 Jun 2015 23:43:23 -0400 ApnsPHP[15794]: ERROR: Unable to send message ID 117: Internal error (0 bytes written instead of 65 bytes) (999). Thu, 11 Jun 2015 23:43:23 -0400 ApnsPHP[15794]: INFO: Disconnected. Thu, 11 Jun 2015 23:43:23 -0400 ApnsPHP[15794]: INFO: Trying ssl://gateway.push.apple.com:2195... Thu, 11 Jun 2015 23:43:24 -0400 ApnsPHP[15794]: INFO: Connected to ssl://gateway.push.apple.com:2195. Thu, 11 Jun 2015 23:43:24 -0400 ApnsPHP[15794]: INFO: Sending messages queue, run #2: 421 message(s) left in queue. Thu, 11 Jun 2015 23:43:24 -0400 ApnsPHP[15794]: STATUS: Sending message ID 117 custom identifier: unset: 65 bytes. Thu, 11 Jun 2015 23:43:24 -0400 ApnsPHP[15794]: STATUS: Sending message ID 118 custom identifier: unset: 65 bytes. ...

gpdawson commented 9 years ago

This has similar symptoms to issue #28 - which was closed but not necessarily resolved. The similarity is a disconnection at very similar intervals.

tominou commented 9 years ago

I have exactly he same issue and no clue what is causing it. Can it be due to expired or wrong tokens?

gpdawson commented 9 years ago

No - it's not due to expired tokens. In the above output you can see that it fails with message 117, but then when it resumes 117 gets sent successfully.

I did also have a separate issue with occasional bad tokens, but managed to fix that by writing code to examine the error messages after each run, and exorcising from my database any tokens that had produced a type 8 error message.

tominou commented 9 years ago

Ok I see, thanks. Then is there any way to get more verbose logs?

xc0n42 commented 8 years ago

I had the same problem. Reason was that I used a valid sandbox certificate with production tokens. Setting a valid production certificate solved it.

gpdawson commented 8 years ago

I'm using production certificate and production tokens, and now using tls protocol. A recent check shows that this issue still exists:

Sat, 13 Feb 2016 22:38:31 -0500 ApnsPHP[27664]: STATUS: Sending message ID 110 custom identifier: unset: 65 bytes. Sat, 13 Feb 2016 22:38:31 -0500 ApnsPHP[27664]: STATUS: Sending message ID 111 custom identifier: unset: 65 bytes. Sat, 13 Feb 2016 22:38:31 -0500 ApnsPHP[27664]: ERROR: Unable to send message ID 111: Internal error (0 bytes written instead of 65 bytes) (999). Sat, 13 Feb 2016 22:38:31 -0500 ApnsPHP[27664]: INFO: Disconnected. Sat, 13 Feb 2016 22:38:31 -0500 ApnsPHP[27664]: INFO: Trying tls://gateway.push.apple.com:2195... Sat, 13 Feb 2016 22:38:32 -0500 ApnsPHP[27664]: INFO: Connected to tls://gateway.push.apple.com:2195. Sat, 13 Feb 2016 22:38:32 -0500 ApnsPHP[27664]: INFO: Sending messages queue, run #2: 72 message(s) left in queue. Sat, 13 Feb 2016 22:38:32 -0500 ApnsPHP[27664]: STATUS: Sending message ID 111 custom identifier: unset: 65 bytes. Sat, 13 Feb 2016 22:38:32 -0500 ApnsPHP[27664]: STATUS: Sending message ID 112 custom identifier: unset: 65 bytes.

hiepu commented 4 years ago

Facing same issue :(