question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Socket hang up, have tested all certificates and device tokens for APN

See original GitHub issue

Ok, I feel like we are so close here, but end up with socket hang up. I have tested the certificates using openssl on the command line, and manually sent a notification to my phone using the device token obtained looking at the output of Push.debug = true. On the logs, it is claiming Push: APN configured. It seems like everything should be in the clear, but when I call a test push from the server with the code:

Push.send({ 
      from: 'push', 
      title: 'Hello', 
      text: 'World',
      query: {},
  }); 

Debug output seems promising

Push: Sent message "Hello" to 1 ios apps 0 android apps

Then there is a socket hang up,

Error: socket hang up
    at TLSSocket.onHangUp (_tls_wrap.js:1054:19)
    at TLSSocket.g (events.js:260:16)
    at emitNone (events.js:72:20)
    at TLSSocket.emit (events.js:166:7)
    at endReadableNT (_stream_readable.js:923:12)
    at nextTickCallbackWith2Args (node.js:458:9)
    at process._tickCallback (node.js:372:17) 

It would seem there is an issue calling the APN server, I’ve double checked to ensure the production/development mismatch is not an issue as well. The app is deployed on a Digital Ocean droplet using mup. This has been royally frustrating, and I greatly appreciate any insight.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:29 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
philipthomasmecommented, Feb 17, 2017

Same problem here. Certificates still valid and was working without any problems. From one day to another, it broke. Using DigitalOcean too.

2reactions
adamginscommented, Nov 27, 2016

@raix anyway not to take the whole server down if a certificate expires? Maybe use try/catch I have not looked at the code or if this was even possible yet… sorry was frantically trying to get my server back in business.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot get node-apn to connect - Stack Overflow
It appears that I mixed up my certificates. I'm sure I tried swapping them earlier but obviously didn't. cert: Your app cert.
Read more >
APNs socket hang up error. | Apple Developer Forums
Push notification service is implemented by Node. js. From 2018/02/09, socket hang up occasionally happens when connecting to APNs. It is still occasionally ......
Read more >
502 Bad Gateway - Socket hang up | Apigee Edge
The error code [socket hang up][ECONNRESET] indicates that the target server has closed the connection with Edge Microgateway.
Read more >
Untitled
The problem Execute Appium tests causing 'socket hang up' issue and then timeout for every device I've tried Environment Appium version (or git...
Read more >
How to renew an Apple Push Notification Service (APNS ...
If not, you will have to re-enroll all of your managed mobile devices. NOTE: If you generated more than one APNS certificate using...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found