Score:1

php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution

ng flag

I keep getting this error very frequent:

Severity: Warning --> mysqli::real_connect(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution

This issue gets resolved only after Server restart. Considering this happens over a live server having millions of requests daily, restarting isn't a best option.

[EDITED]

I'm using Ubuntu 18.04 and connecting to an Aurora Cluster on AWS and the backend code resides on EC2

@matigo on Askubuntu seem to think that I might be hitting the limit:

https://askubuntu.com/a/1363447/135086

So I did some debugging to understand if I'm actually hitting that 1024 PPS limit. Luckily there was an AWS article which seems to help me understand that,

https://aws.amazon.com/premiumsupport/knowledge-center/vpc-find-cause-of-failed-dns-queries/

I tried the commands to understand the PPS I'm hitting at the moment and monitored until I find the error.

ERROR - 2021-09-20 12:14:31.547863 --> Severity: Warning --> mysqli::real_connect(): (HY000/2002): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution

To my surprise, the following is the output of the command mentioned in the AWS article

tcpdump  -r <file_name.pcap> -nn dst port 53 | awk -F " " '{ print $1 }' | cut -d"." -f1 | uniq -c


  2 06:44:22
  6 06:44:24
  4 06:44:26
  2 06:44:28
  4 06:44:30
  7 06:44:34
  2 06:44:38
  7 06:44:39
  9 06:44:44
  6 06:44:46
  4 06:44:49
  6 06:44:50

Considering the timezone as +05:30, an error at 12:14:31 IST should have an entry for dns at 06:44:31 UTC.

If we consider the avg packet size to 4 packets per call, referring to @matigo's answer, I'm not hitting 22 dns calls per second. So further looking into the logs,

  4 06:39:06
 26 06:39:09
  4 06:39:10
  2 06:39:13
  6 06:39:16
 16 06:39:17

Some entries have crossed 22 dns calls per second limit and we didnt encounter the php_network_getaddresses error.

So I'm not sure what the issue is here.

Someone also said this might come due to a rogue DHCP server in the LAN, not sure how to identify that, or would it be possible on an EC2 when the only DNS's configured is the AWS Route53 Resolver.

At this point I'm confused as to if this is even the PPS limit issue or something else.

Score:0
cn flag

I had the same error with an instance that was not hitting the limit. After some time I stumbled on an AWS support thread indicating that it could be a hardware problem.

The physical underlying host of your instance (i-3d124c6d) looks to have intermittently been having a issues, some of which would have definitely caused service interruption.

Could you try stopping and starting this instance? Doing so will cause it to be brought up on new underlying hardware and then we could utilize your pingdom service to verify if further issues arise.

from: https://forums.aws.amazon.com/thread.jspa?threadID=171805.

Stopping and restarting the instance resolved the issue for me.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.