7

I have an AWS Elastic Beanstalk configuration (PHP) with one EC2 instance and one RDS instance. It's a QA environment. It was working well but recently it started to fail consistently with the following error (there have been no code changes):

"PDO::__construct(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution Error: Error in Connection to pdo_mysql database :Connection attempt failed: SQLSTATEHY000 2002 php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution"

There is nothing temporary about it.

If I substitute the IP address of the RDS instance in place of the host name it works well in AWS.

If I access the AWS RDS instance from my local development machine (outside AWS) using the host name it executes the same code perfectly.

Nslookup for the RDS host name works well from the EC2 instance.

I have stopped and started the ec2 instance and rebooted the RDS instance to no avail.

I see there are sporadic posts about intermittent AWS DNS failures but nothing that seems to fit my problem.

Does anybody recognise the problem? Does anybody know what further tests I can do in an effort to diagnose it?

Thanks

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

1 Answer 1

4

It turns out that restarting apache fixed the problem at least until the next time I restarted the ec2 instance. There is obviously some problem with my version of the AMI (built in August 2013). A currently built (Dec 2013) version of Elastic Beanstalk does not have this problem.

1
  • 1
    You are a life saver. I know this is old, but it resolved the issue I had. Out of the blue issue too. Mar 21, 2017 at 14:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .