ECONNREFUSED error when sending push notifications

I’m using Expo to send push notifications with my node.js server as described in https://docs.expo.io/versions/latest/guides/push-notifications/

I keep getting this kind of error :

FetchError: request to https://exp.host/--/api/v2/push/getReceipts failed, reason: connect ECONNREFUSED 104.197.216.164:443

and this as well :

FetchError: request to https://exp.host/--/api/v2/push/send failed, reason: connect ECONNREFUSED 104.197.216.164:443

Is it simply the expo infrastructure failing? Or is my request being rejected for some reason?

I also get this error very frequently:

Error: Expo responded with an error with status code 504: <html>
<head><title>504 Gateway Time-out</title></head>
<body>
<center><h1>504 Gateway Time-out</h1></center>
<hr><center>openresty/1.15.8.2</center>
</body>
</html>

This error normally means that the software on the remote server is not listening on the port you’re trying to connect to. e.g. it crashed and has not yet been restarted. If this is the case it would mean that it is not your specific request that is being rejected.

There’s also a possibility that there’s something in between you and the server that is interfering with the traffic. Either a transparent proxy server or a firewall. This seems less likely to me.

The “Gateway Time-out” error indicates a proxy of some kind, but it could be on Expo’s servers rather than between you and Expo’s servers.

I have not yet needed push notifications, so I haven’t experienced this myself, but I haven’t noticed others complaining about the same thing on the forums, so I’m not sure how common this is.
Is there any pattern to the errors? Certain times of day when they are more likely? What percentage of times do you get the errors? If it fails, how long is it until it starts working again?

Either way it seems best to queue up the notifications and retry them if they fail.

1 Like

Hello,

Randomly I have similar issue. The recent one is happening right now https://take.ms/pBXVh, with a response in body https://take.ms/eyjA3 :

<html>
<head><title>504 Gateway Time-out</title></head>
<body>
<center><h1>504 Gateway Time-out</h1></center>
<hr><center>openresty/1.15.8.2</center>
</body></html>
1 Like

We’re getting this too. Nothing mentioned on status.expo.io :confused:

Someone else got a 503 error rather than a 504 error, but they might both have the same cause. See this message from one of the Expo team members: