node-yahoo-finance2 icon indicating copy to clipboard operation
node-yahoo-finance2 copied to clipboard

Error: getaddrinfo EAI_AGAIN finance.yahoo.com

Open aturkkan94 opened this issue 2 years ago • 6 comments

I'm getting the error in the picture below. The app was working perfectly. But today i got this error. On localhost app is working. But in real project im getting this error. So i suspected whether i blocked by yahoo or not?

1

aturkkan94 avatar Sep 12 '22 11:09 aturkkan94

EAI_AGAIN is a DNS timeout error. While it is in theory possible that Yahoo could be blocking server farms at this level, it's very, very unlikely. More likely one of their or your / your ISPs DNS servers / network has (or had) an issue (and it's stuck in the cache). Easiest fix if you, if you have access to your DNS settings, is to simply switch to a public DNS server like Google's (8.8.8.8, 8.8.4.4) or Cloudflares (1.1.1.1) and it should fix your problem.

You can experiment a big with dig, e.g.

$ dig a finance.yahoo.com @your-dns-server # from /etc/resolve.conf
$ dig a finance.yahoo.com @8.8.8.8

Note that the public DNS servers (and presumably Yahoo's) are anycast IPs, so doing the above from system could give differing results depending on geolocation and cache issues.

Let us know :)

gadicc avatar Sep 12 '22 11:09 gadicc

dns

I think i managed to change the dns by using netplan. I'm not good at ubuntu server... I reboot the server but im getting the same error unfortunately...

Thanks for your help. You are very helpful...

error again

aturkkan94 avatar Sep 12 '22 13:09 aturkkan94

Looks like you got it but I'm not familiar with netplan either.

Can you paste the results of dig a query2.finance.yahoo.com ? (Amongst other things, it will tell you which DNS server is used, near the bottom... but also the results of the query).

What's in your /etc/resolv.conf ?

gadicc avatar Sep 12 '22 13:09 gadicc

I think in new versions of ubuntu netplan is being used for dns changing. I changed from there and there is no resolv.conf.

After i try with dig i saw that server was using previous dns. It wanst google dns. I think we should wait for a while for dns changing. Now it is working.

Thanks a lot for your help. Your are great...

aturkkan94 avatar Sep 12 '22 14:09 aturkkan94

Ok great thanks for reporting back! Glad you're up and running again.

gadicc avatar Sep 12 '22 16:09 gadicc

Actually leaving this open, this does happen occasionally and perhaps we should document it somewhere.

gadicc avatar Sep 12 '22 16:09 gadicc