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

XF 1.4 Mysqli prepare error - Entire site broken

Discussion in 'Troubleshooting and Problems' started by zLemonProz, Apr 30, 2015.

  1. zLemonProz

    zLemonProz Member

    Hello,

    I woke up today to notice my entire site was not accessible and the following errors displayed on every page/forum:

    Server Error
    Mysqli prepare error: Can't find file: './xenforo/xf_session.frm' (errno: 13)

    1. Zend_Db_Statement_Mysqli->_prepare() in Zend/Db/Statement.php at line 115
    2. Zend_Db_Statement->__construct() in Zend/Db/Adapter/Mysqli.php at line 381
    3. Zend_Db_Adapter_Mysqli->prepare() in Zend/Db/Adapter/Abstract.php at line 478
    4. Zend_Db_Adapter_Abstract->query() in Zend/Db/Adapter/Abstract.php at line 574
    5. Zend_Db_Adapter_Abstract->insert() in XenForo/Session.php at line 814
    6. XenForo_Session->saveSessionToSource() in XenForo/Session.php at line 532
    7. XenForo_Session->save() in XenForo/Controller.php at line 414
    8. XenForo_Controller->updateSession() in XenForo/Controller.php at line 358
    9. XenForo_Controller->postDispatch() in XenForo/FrontController.php at line 354
    10. XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
    11. XenForo_FrontController->run() in /var/www/html/index.php at line 13

    How can I fix this?

    Thank you!
     
  2. zLemonProz

    zLemonProz Member

    [​IMG]
    Server Error

    Mysqli prepare error: Can't find file: './xenforo/xf_session_admin.frm' (errno: 13)

    1. Zend_Db_Statement_Mysqli->_prepare() in Zend/Db/Statement.php at line 115
    2. Zend_Db_Statement->__construct() in Zend/Db/Adapter/Mysqli.php at line 381
    3. Zend_Db_Adapter_Mysqli->prepare() in Zend/Db/Adapter/Abstract.php at line 478
    4. Zend_Db_Adapter_Abstract->query() in Zend/Db/Adapter/Abstract.php at line 574
    5. Zend_Db_Adapter_Abstract->insert() in XenForo/Session.php at line 814
    6. XenForo_Session->saveSessionToSource() in XenForo/Session.php at line 532
    7. XenForo_Session->save() in XenForo/Controller.php at line 414
    8. XenForo_Controller->updateSession() in XenForo/Controller.php at line 358
    9. XenForo_Controller->postDispatch() in XenForo/FrontController.php at line 354
    10. XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
    11. XenForo_FrontController->run() in /var/www/html/admin.php at line 13
     
  3. Brogan

    Brogan XenForo Moderator Staff Member

    You should contact your host as that would suggest a restore was carried out incorrectly.
     
  4. zLemonProz

    zLemonProz Member

    It's running on an unmanaged OVH VPS.
     
  5. Rob

    Rob Well-Known Member

    Would a repair of the tables work in this case?
     
  6. Brogan

    Brogan XenForo Moderator Staff Member

    I'm not sure if a repair will work - I've never tried it for that particular error.
    I suppose it can't hurt to try.

    As it's a session table, which only contains temporary data, running CREATE TABLE may also work.

    There's no reason why an .frm file should suddenly disappear from the file system though so you may want to investigate that further.
     
    Rob likes this.
  7. Martok

    Martok Well-Known Member

    A quick Google suggests that it's either the SQL user doesn't have permission to read that frm file (or the correct permissions on the directory it is in) or the file is missing altogether (and possibly other MySQL files?)

    File permissions don't just change by themselves nor do files just disappear. You must have done something (as you manage the VPS yourself) or maybe there's some sort of corruption. Firstly you need to determine if it's a permissions issue or missing file(s).
     
    Rob likes this.
  8. zLemonProz

    zLemonProz Member

    I'm not too experienced with this. Could someone explain how I would go about performing a repair?

    Also I cannot seem to access the mysql user. How would I go about making a new new and giving it access to all the current data?
     
  9. Brogan

    Brogan XenForo Moderator Staff Member

    You can use phpMyadmin to repair/create but if I was you I'd speaking to the host to try and understand what caused the problem in the first place.
     
  10. zLemonProz

    zLemonProz Member

    Never mind I managed to fix this. Thank you to those who replied!
     
    Rob likes this.

Share This Page