evolution / wordpress

Rapidly create, develop, & deploy WordPress across multiple environments.
MIT License
200 stars 18 forks source link

Cannot establish database connection #178

Closed jalevin closed 5 years ago

jalevin commented 6 years ago

I have a legacy wordpress site I inherited running core 4.7.5. It worked fine in MAMP on local machine and local stage after some tweaking, but when I deploy I'm getting really long load times on the home page and after enough refreshes, everything seems to die and need a full reboot to fix it. I can't find any php error logs other than an initial issue

PHP Fatal error: Maximum execution time of 30 seconds exceeded in /var/www/mysite.com/production/master/releases/20180127211252/web/wp/wp-includes/class-wp-image-editor-gd.php on line 190

Increasing the timeout and fixing permissions on the directory allowed most pages to load.

However, the homepage still has a really long load time IF it even loads before something on the server eats it.

Mysql logs had a complaint about wp_options table, so I ran a repair on that and now I'm getting no errors.

I don't have any varnish log files.

I've also tried re-provisioning.

Any thoughts? Thanks!

jalevin commented 6 years ago

Just to follow up- I've tracked it down to a plugin that was causing the issue. Is it possible that any firewall rules are causing outgoing connections to time out instead of returning a 404?

EvanK commented 6 years ago

The firewall accepts inbound traffic for ssh, http/s, and icmp (pings), and I believe it should allow any outgoing traffic, especially for established connections. Any rejected packets ought to show up in the syslog with a prefix of iptables:.

If the plugin in question was generating an unusual amount or type of traffic, it's possible that fail2ban kicked in and blocked it...which you can check (assuming you're not banned already) from ssh:

deploy@production:~$ sudo fail2ban-client status 
Status
|- Number of jail:  4
`- Jail list:       apache, apache-overflows, ssh, ssh-ddos
deploy@production:~$ sudo fail2ban-client status ssh
Status for the jail: ssh
|- filter
|  |- File list:    /var/log/auth.log 
|  |- Currently failed: 3
|  `- Total failed: 346811
`- action
   |- Currently banned: 1
   |  `- IP list:   103.59.40.178 
   `- Total banned: 36691
deploy@production:~$