XF 1.5 Server Error log.

andybond

Well-known member
I am getting the following error when visiting the server error log :

Mysqli prepare error: Table 'XY and Z.xf_error_log' doesn't exist

  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 XenForo/Model.php at line 219
  5. XenForo_Model->fetchAllKeyed() in XenForo/Model/Log.php at line 25
  6. XenForo_Model_Log->getServerErrorLogs() in XenForo/ControllerAdmin/Log.php at line 37
  7. XenForo_ControllerAdmin_Log->actionServerError() in XenForo/FrontController.php at line 351
  8. XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
  9. XenForo_FrontController->run() in /home/turbipwd/public_html/admin.php at line 13
My understanding is the table doesnt exist ;)

How can I recreate ?
 
Recreating the table is easy enough but do you have any idea how it was deleted?
Code:
CREATE TABLE `xf_error_log` (
`error_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`exception_date` int(10) unsigned NOT NULL,
`user_id` int(10) unsigned DEFAULT NULL,
`exception_type` varchar(75) NOT NULL,
`message` text NOT NULL,
`filename` varchar(255) NOT NULL,
`line` int(10) unsigned NOT NULL,
`trace_string` mediumtext NOT NULL,
`request_state` mediumblob NOT NULL,
`ip_address` varbinary(16) NOT NULL DEFAULT '',
PRIMARY KEY (`error_id`),
KEY `exception_date` (`exception_date`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8

I would be more concerned with determining that.
 
When trying to create the table?

That points to server-level database corruption, possibly relating to a disk filling up. You may need to talk to your host for them to look into recovery options.
 
When trying to create the table?

That points to server-level database corruption, possibly relating to a disk filling up. You may need to talk to your host for them to look into recovery options.

Yeah, goto phpmyadmin , find the DB ( I have a few ) select it , then goto the query and create ..

Looks like it executes , but delivers that error .
 
I have downloaded a backup of the mysql , deleted it and then restored.

An unexpected error occurred. Please try again later. is what I recieve now .

If I goto the /install folder

Mysqli prepare error: Table 'x y and z .xf_session_admin' doesn't exist

Can I do a clean install , install the DB again and import the DB that is missing the tables onto it ?
 
If the issue is just those few tables then you may be able to get away with that.

However, there could be other corruption so you may need to revert to an older backup which has no corruption.
 
It really depends on the tables.
If they are just session tables you can recreate them.
If they are log tables, you can either recreate them or import them.

Any other tables would be problematic though, depending on the content.
 
@Brogan could you advise on the sql to create the table that I mentioned ?
The xf_session_admin table?
If so:
Code:
CREATE TABLE `xf_session_admin` (
 `session_id` varbinary(32) NOT NULL,
 `session_data` mediumblob NOT NULL,
 `expiry_date` int(10) unsigned NOT NULL,
 PRIMARY KEY (`session_id`),
 KEY `expiry_date` (`expiry_date`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8
 
It really depends on the tables.
If they are just session tables you can recreate them.
If they are log tables, you can either recreate them or import them.

Any other tables would be problematic though, depending on the content.

Aw crumbs. Thanks for the pointers so far.

I am curious what has caused the corruption. I suspect its at host level though
 
It does a bit.

Ill have to dig out an older version of the mySQL

Would it be risky after doing a sucessful restore , doing an import ontop of the restored DB?

I appreciate stuff like the users registered between the older backup and now are lost ..
 
Top Bottom