Magento 502 Bad Gateway - Pdo/Abstract

2020-04-01 php nginx magento-1.9 magento-1.8

I have a problem with mi magento installation. Magento is version 1.9 and today show me 502 Bad Gateway error. Yestarday all work great, i have recover the backup that i have and the result it's the same.

i think that it's not a nginx problem, cause if i add a index.html the website show me this page.

i dont'have nginx error.log, but when i flush the cache with this commend php -r 'require "app/Mage.php"; Mage::app()->getCacheInstance()->flush();'

the system show me this error PHP Fatal error: Uncaught PDOException: PDO::__construct(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /nxr/websitename/www/lib/Zend/Db/Adapter/Pdo/Abstract.php:128.

I have checked db data and all it's work. Anyone have any idea?

Answers

You are right. NGINX is just telling you there is Bad Gateway or better to say: Your backend isn't answering correctly.

This error php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution is because of some DNS resolver issues.

In case you are using an DNS Name to connect to your database, try to use the IP Address of the Host for now.

Can you resolve the Hostname of the DB-Instance. Try to resolve it using dig or nslookup. dig A @ YOURDNSERVERSIP DBHOSTNAME.FQDN

Related