node-binance-api icon indicating copy to clipboard operation
node-binance-api copied to clipboard

getaddrinfo EAI_AGAIN fapi.binance.com

Open dajneem23 opened this issue 2 years ago • 7 comments

getaddrinfo EAI_AGAIN fapi.binance.com some time my server got this server when use futuresPositionRisk someone can help me ?

dajneem23 avatar Jun 16 '22 06:06 dajneem23

This is typically associated with DNS lookup failures. To avoid failure, try adding the host IP and FQDN in your hosts file. If it still continues to happen. then bring back more supporting evidence.

dmzoneill avatar Jun 16 '22 07:06 dmzoneill

This is typically associated with DNS lookup failures. To avoid failure, try adding the host IP and FQDN in your hosts file. If it still continues to happen. then bring back more supporting evidence.

sometimes it happens sometimes it doesn't it goes back to normal when i restart docker

dajneem23 avatar Jun 16 '22 09:06 dajneem23

The 8 fallacies of distributed computing

The network is reliable;
Latency is zero;
Bandwidth is infinite;
The network is secure;
Topology doesn't change;
There is one administrator;
Transport cost is zero;
The network is homogeneous.

I would look at your DNS providers, look at the ones with lowest latency. And structure my DNS lookup order off this. this config should also be used with docker (example below)

[daoneill@fedora automation-analytics-backend]$ cat /etc/docker/daemon.json 
{
    "exec-opts": ["native.cgroupdriver=systemd"],
    "log-driver": "json-file",
    "log-opts": {
      "max-size": "100m"
    },
    "storage-driver": "overlay2",
    "data-root": "/home/daoneill/docker",
    "debug": true,
    "dns": ["10.11.5.19", "1.1.1.1", "8.8.8.8"],
    "experimental": false
}

You can pass a host/ip pair to a docker container using

--add-host=""      : Add a line to /etc/hosts (host:IP)

trying providing

--add-host="fapi.binance.com/99.86.125.20"

dmzoneill avatar Jun 16 '22 17:06 dmzoneill

The 8 fallacies of distributed computing

The network is reliable;
Latency is zero;
Bandwidth is infinite;
The network is secure;
Topology doesn't change;
There is one administrator;
Transport cost is zero;
The network is homogeneous.

I would look at your DNS providers, look at the ones with lowest latency. And structure my DNS lookup order off this. this config should also be used with docker (example below)

[daoneill@fedora automation-analytics-backend]$ cat /etc/docker/daemon.json 
{
    "exec-opts": ["native.cgroupdriver=systemd"],
    "log-driver": "json-file",
    "log-opts": {
      "max-size": "100m"
    },
    "storage-driver": "overlay2",
    "data-root": "/home/daoneill/docker",
    "debug": true,
    "dns": ["10.11.5.19", "1.1.1.1", "8.8.8.8"],
    "experimental": false
}

You can pass a host/ip pair to a docker container using

--add-host=""      : Add a line to /etc/hosts (host:IP)

trying providing

--add-host="fapi.binance.com/99.86.125.20"

I tried to follow your guide.I changed it a bit to match docker compose.it works fine for the time being thanks for your guide

dajneem23 avatar Jun 21 '22 11:06 dajneem23

it not work till get error read ECONNRESET

dajneem23 avatar Jun 22 '22 03:06 dajneem23

catch the error with try {} catch(err){} then retry.. create a function for retry

mr-smit avatar Sep 07 '22 15:09 mr-smit

catch the error with try {} catch(err){} then retry.. create a function for retry

I tried but it not work my solution is find other stable server that almost fixed

dajneem23 avatar Jan 06 '23 10:01 dajneem23