1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.2 Fatal Database error :-(

Discussion in 'Troubleshooting and Problems' started by Core Freedom, Aug 22, 2013.

  1. Core Freedom

    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
     
  2. borbole

    borbole Well-Known Member

    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?
     
    Core Freedom likes this.
  3. Chris D

    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 likes this.
  4. Core Freedom

    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. :)
     
  5. Core Freedom

    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.
     
  6. borbole

    borbole Well-Known Member

    I see the same error posted by Chris above. This is a hosting issue. Let us know what your host will say.
     
    Core Freedom likes this.
  7. Core Freedom

    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.
     
    Amaury likes this.
  8. borbole

    borbole Well-Known Member

    Does your forum admin panel get brute force attacks as well or only the wp admin?
     
    Core Freedom likes this.
  9. Core Freedom

    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: Aug 23, 2013
  10. borbole

    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?
     
    Core Freedom likes this.
  11. Tracy Perry

    Tracy Perry Well-Known Member

    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: Aug 23, 2013
    Core Freedom and borbole like this.
  12. Core Freedom

    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!
     
  13. Tracy Perry

    Tracy Perry Well-Known Member

    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.
     
  14. WSWD

    WSWD Well-Known Member

    Just to note, they absolutely do that. There are tons of WordPress plugins out there that are HORRIBLE resource hogs.
     
  15. The Forum Heroes

    The Forum Heroes Well-Known Member

    I see you use cPanel. Install CSF and fail2ban

    To install CSF in ssh run these lines as root

    wget http://www.configserver.com/free/csf.tgz
    tar -xzf csf.tgz
    cd csf
    sh install.sh

    after the installer finishes refresh WHM and you'll see a CSF on the very bottom
     
    Dan likes this.

Share This Page