• 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

#1
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

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
 

Brogan

XenForo moderator
Staff member
#6
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.
 

Martok

Well-known member
#7
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).
 
#8
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?
 

Brogan

XenForo moderator
Staff member
#9
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.