XF 1.2 Server error occurred & xf_session is marked as crashed


Well-known member
Went to my site today, and I saw this error on the front page,

A server error occurred. Please try again later.

I tried to login, and I could login, but I got this error on the forum,

Security error occurred. Please press back, refresh the page, and try again.

I can access the AdminCP, and the first thing I did was check the Server Error Log, and I saw this,

Zend_Db_Statement_Mysqli_Exception: Mysqli prepare error: Table './gamevent_forum/xf_session' is marked as crashed and should be repaired - library/Zend/Db/Statement/Mysqli.php:77
Generated By: Unknown Account, 2 minutes ago

Stack Trace

#0 /home/gamevent/public_html/library/Zend/Db/Statement.php(115): Zend_Db_Statement_Mysqli->_prepare('INSERT INTO `xf...')
#1 /home/gamevent/public_html/library/Zend/Db/Adapter/Mysqli.php(381): Zend_Db_Statement->__construct(Object(Zend_Db_Adapter_Mysqli), 'INSERT INTO `xf...')
#2 /home/gamevent/public_html/library/Zend/Db/Adapter/Abstract.php(478): Zend_Db_Adapter_Mysqli->prepare('INSERT INTO `xf...')
#3 /home/gamevent/public_html/library/Zend/Db/Adapter/Abstract.php(574): Zend_Db_Adapter_Abstract->query('INSERT INTO `xf...', Array)
#4 /home/gamevent/public_html/library/XenForo/Session.php(760): Zend_Db_Adapter_Abstract->insert('xf_session', Array)
#5 /home/gamevent/public_html/library/XenForo/Session.php(501): XenForo_Session->saveSessionToSource('ff9db527b86c420...', false)
#6 /home/gamevent/public_html/library/XenForo/Controller.php(412): XenForo_Session->save()
#7 /home/gamevent/public_html/library/XenForo/Controller.php(356): XenForo_Controller->updateSession(Object(XenForo_ControllerResponse_View), 'XenForo_Control...', 'Index')
#8 /home/gamevent/public_html/library/XenForo/FrontController.php(344): XenForo_Controller->postDispatch(Object(XenForo_ControllerResponse_View), 'XenForo_Control...', 'Index')
#9 /home/gamevent/public_html/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#10 /home/gamevent/public_html/index.php(13): XenForo_FrontController->run()
#11 {main}

Request State

array(3) {
  ["url"] => string(54) "*insert website url here*"
  ["_GET"] => array(0) {
  ["_POST"] => array(0) {
The error happens about every minute, and I can only guess they're connected in some way.

Any help would be wonderful as no one can access the site right now.


Well-known member
Thankfully the xf_session table can be truncated and no important data will be lost.

Ask your web hosting company to truncate the xf_session table.


Well-known member
While you are at it, ask your web hosting company to not have servers that crash/hard reboot and you won't have corrupt tables to begin with. :)
Could you recommend some good web hosts that understand Xenforo with good pricing?

Also, the problem has been fixed thank god (y)