1 Answer
- Newest
- Most votes
- Most comments
0
Hello.
Can I check the web server or PHP error logs?
These logs may contain messages that can help identify the cause of a connection error.
Also, please check the error log on the Aurora side.
https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_LogAccess.MySQL.LogFileSize.html
Relevant content
- asked 7 months ago
- asked 2 years ago
- asked 3 months ago
- asked 3 years ago
- AWS OFFICIALUpdated 9 months ago
Thank you for your reply and suggestion to check the web server and Aurora error logs.
Aurora Error Logs: I've reviewed the Aurora error logs for the past few days, focusing on the time periods when the connection errors occurred. Unfortunately, I haven't found any error messages within the Aurora logs during those specific times.
Web Server Error Logs: However, the web server error logs on the affected WordPress instances reveal several entries related to the issue. These entries fall into two main categories:
DNS Resolution Error: The most frequent error message points towards a DNS resolution problem:
[24-May-2024 01:15:05 UTC] PHP Warning mysqli_real_connect(): php_network_getaddrinfo for XXXX-instance-1.XXXXXX.us-east-1.rds.amazonaws.com failed: Name or service not known in /opt/bitnami/wordpress/wp-includes/class-wpdb.php on line 1987
This message indicates that the server was unable to resolve the hostname of the Aurora MySQL database
The other error message suggests a connection failure after the DNS lookup:
[24-May-2024 01:15:05 UTC] PHP Warning mysqli_real_connect(): (HY000/2002): php_network_getaddrinfo for XXXX-instance-1.XXXXXX.rds.amazonaws.com failed: Name or service not known in /opt/bitnami/wordpress/wp-includes/class-wpdb.php on line 1987
It seems the issue has something to do with DNS Resolution of the RDS endpoint.
It may be due to a large number of name resolutions. I think the setting method will differ depending on the Lightsail OS, but I think it may be improved by configuring DNS cache etc. However, please be aware that caching may prevent switching to work properly in the event of a failover on the Aurora side. https://repost.aws/knowledge-center/dns-resolution-failures-ec2-linux