What's the Cause of the Error 'Getaddrinfo Eai_Again'

What's the cause of the error 'getaddrinfo EAI_AGAIN'?

EAI_AGAIN is a DNS lookup timed out error, means it is a network connectivity error or proxy related error.

My main question is what does dns.js do?

  • The dns.js is there for node to get ip address of the domain(in brief).

Some more info:
http://www.codingdefined.com/2015/06/nodejs-error-errno-eaiagain.html

can't resolve getaddrinfo EAI_AGAIN error

For future readers, the problem is caused because the Binance's web socket server requires to respond to a ping frame within 10 minutes or the connection will be disconnected, so I get the 1006 error, I fixed this issue with a pong frame like this: ws.pong(); otherwise you will get a 1008 error code.

Example:

const ws = new WebSocket('wss://stream.binance.com:9443/ws/!bookTicker');
ws.onopen = function(message) {
console.log("Connected: ");
ws.pong();
}
ws.on("ping", function(message) {
ws.pong();
});

Error: getaddrinfo EAI_AGAIN database at GetAddrInfoReqWrap.onlookup [as oncomplete]

It looks like you have a service named database_ignite in your docker-compose.yml file. Docker by default creates a host using the name of your service. Try changing your host from database inside your index.ts file to database_ignite:

import { Connection, createConnection, getConnectionOptions } from "typeorm";

export default async (host = "database_ignite"): Promise<Connection> => {
// Changed database to ^^ database_ignite ^^

const defaultOptions = await getConnectionOptions();

return createConnection(
Object.assign(defaultOptions, {
host,
})
);
};

npm ERR! code EAI_AGAIN error when trying to install express

I found the fix myself and what I basically did was use a different internet connection and I was able to install express! Hopefully someone else finds this useful!



Related Topics



Leave a reply



Submit