XF 1.2 Fatal Database error :-(

Core Freedom

Well-known member
Does anyone know what this means?

Fatal error: Method XenForo_Template_Public::__toString() must not throw an exception in /home/corefree/public_html/community/library/Dark/AzuCloud/EventListener/TemplateHook.php on line 0

This just showed up on a white screen when I try going to my forum here. After 5 minutes I refreshed the page and now it simply says "An unexpected database error occurred. Please try again later."

?? anyone
 

borbole

Well-known member
Does anyone know what this means?

Fatal error: Method XenForo_Template_Public::__toString() must not throw an exception in /home/corefree/public_html/community/library/Dark/AzuCloud/EventListener/TemplateHook.php on line 0

This just showed up on a white screen when I try going to my forum here. After 5 minutes I refreshed the page and now it simply says "An unexpected database error occurred. Please try again later."

?? anyone
The first message error points to a mod, AzuCloud. If you have such a mod then try to disable it and see if the error goes away.

Regarding the second error, can you view the page source and copy/paste here the full error?
 

Chris D

XenForo developer
Staff member
When you get that generic message, there is actually a more detailed error hidden in the source of the page...

The specific error you're receiving is this:

<!-- Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) -->

You should contact your host. They will be able to help you with that.
 

Core Freedom

Well-known member
Thank you both! Can't login even to my admin panel. Just contacted the host. Can also not login to my wordpress admin panel. Thank you. :)
 

Core Freedom

Well-known member
Borbole, now it only says "An unexpected error occurred. Please try again later" and when I right click on "view page source" that's all it says: "An unexpected error occurred. Please try again later" - nothing more.
 

borbole

Well-known member
Borbole, now it only says "An unexpected error occurred. Please try again later" and when I right click on "view page source" that's all it says: "An unexpected error occurred. Please try again later" - nothing more.
I see the same error posted by Chris above. This is a hosting issue. Let us know what your host will say.
 

Core Freedom

Well-known member
here is what they said yesterday:

Your VPS container is having issue with processes reserving memory and other processes cannot be started because the memory is not available. When this memory starvation occurs, the container will kill off the most memory intensive process in order to prevent a hard crash. Your container has also abused CPU cycles on the node and was placed into a cooldown state so that your container would not affect the other containers on the node.

I complained saying that plugins should not do that. They responded this morning with this:

I had a look at your server and could see that during the times it was down, there had been a brute force attack on your WordPress login. The reason why this particular type of brute force attack causes such load on your server is because the login script is running and querying your database each time a password is tried. This happens as fast as they can possibly scan, so it causes your server to become quite loaded and unavailable for normal tasks.

Someone is having a hay day trying to get in, once again. Ah, if only those really smart people would use their technological talents to do good instead of find ways to mess with people's work.
 

Core Freedom

Well-known member
It doesn't look like it. I know I get emails from the server on a daily basis that brute force attacks are being made on the vps server. I usually black list those IPs. But it doesn't look like there are any on the xf admin panel. I'm actually not even sure if I could tell if any brute force attacks were made on xf. o_O
 
Last edited:

borbole

Well-known member
I did some searching and it looks like this is a common problem with wp installations. Have you tried to post over there about this?
 

Tracy Perry

Well-known member
It doesn't look like it. I know I get emails from the server on a daily basis that brute force attacks are being made on the vps server. I usually black list those IPs. But it doesn't look like there are any on the xf admin panel. I'm actually not even sure if I could tell if any brute force attacks were made on xf. o_O
You run fail2ban by chance? If so, check out http://wordpress.org/plugins/wp-fail2ban/

EDIT:

Even easier, if you use fail2ban, in your jail.local place
Code:
[apache-wp-login]
enabled = true
port    = http,https
action  = iptables[name=WP, port=http, protocol=tcp]
filter  = apache-wp-login
logpath = /path/to/your/wpress/access_log
maxretry = 3
and in your /etc/fail2ban/filter.d create a file called apache-wp-login and place
Code:
# Fail2Ban configuration file
[Definition]
failregex = <HOST>.*] "POST /wp-login.php
ignoreregex =
in it. Restart fail2ban and you should start getting those IP's blocked (dropped) after 3 failed attempts. I just set this up on my VPS that I run my blogs on.
 
Last edited:

Core Freedom

Well-known member
Thank you Tracy. Not sure if I run fail2ban, doesn't sound familiar. Will check into it and set it up. Thank you all!
 

Tracy Perry

Well-known member
Thank you Tracy. Not sure if I run fail2ban, doesn't sound familiar. Will check into it and set it up. Thank you all!
If you are on centOS, there is some firewall that is used with it typically - but I'm on Debian and this works really good for SSH and a few other things.
 
Top