Netlify cli error: getaddrinfo EAI_AGAIN api.netlify.com

Hi I am trying to deploy my site via the netlify-cli on Ubuntu 20.04 (wsl-2), netlify-cli/6.14.10 wsl-x64 node-v17.0.1.

I did a draft deployment yesterday which worked fine but now this morning nothing is working. Everytime I try to deploy I get the following:

> netlify deploy --dir=docs
 ›   Error: request to https://api.netlify.com/api/v1/sites/319b0f2f-7f67-4cdf-baf1-3c385facf16d failed, reason:
 ›   getaddrinfo EAI_AGAIN api.netlify.com

I saw in another thread that it was recommend to logout and back in however when I try to log back in I get:

> netlify logout
Logging you out of Netlify. Come back soon!

> netlify login
Logging into your Netlify account...
    FetchError: request to https://api.netlify.com/api/v1/oauth/tickets?client_id=d6f37de6614df7ae58664cfca524744d7380
    7a377f5ee71f1a254f78412e3750 failed, reason: getaddrinfo EAI_AGAIN api.netlify.com
    Code: EAI_AGAIN

I then tried to deploy using a PAT but got the same error message as before.

This is for site: loving-lamarr-749faa

Any help would be appreciated !

Hi @gowerc,

Could you use Node 16 or 14 and retry? Maybe that would make a difference?

Nope even after downgrading and reinstalling I am still seeing the error :frowning:

> netlify --version
netlify-cli/6.14.12 wsl-x64 node-v16.13.0

> netlify deploy
Logging into your Netlify account...
    FetchError: request to https://api.netlify.com/api/v1/oauth/tickets?client_id=d6f37de6614df7ae58664cfca524744d7380
    7a377f5ee71f1a254f78412e3750 failed, reason: getaddrinfo EAI_AGAIN api.netlify.com
    Code: EAI_AGAIN

Hey @gowerc,

Are you able to visit https://api.netlify.com/? That should show a page like this:

image

If not, could you try using a VPN/proxy?

Apologies for the delay in replying, I am able to ping and curl the api site without any issues :frowning:

Do you see any content? Probably try using curl?

Just to say that I ended up reinstalling my OS (for unrelated reasons) and I now no longer have the isue.

In my case it was an issue caused by Google DNS. It was rate-limiting netlify CLI (it doesn’t cache DNS?). Switched to Cloudflare (1.1.1.1) and the problem was solved.

thanks for chiming in and sharing your solution with the community!