XF 2.2 Error code when trying to delete a post

tommydamic68

Well-known member
Hello,
hopefully someone can help. A member was posting and she did a duplicate post on accident. When I try to deleted either post I am getting this error. Not sure if its coincidence but my site is running really slow suddenly.

Code:
XF\Db\Exception: MySQL statement prepare error [144]: Table './admin_dbxcom/xf_search_index' is marked as crashed and last (automatic?) repair failed in src/XF/Db/AbstractStatement.php at line 228
XF\Db\AbstractStatement->getException() in src/XF/Db/Mysqli/Statement.php at line 196
XF\Db\Mysqli\Statement->getException() in src/XF/Db/Mysqli/Statement.php at line 39
XF\Db\Mysqli\Statement->prepare() in src/XF/Db/Mysqli/Statement.php at line 54
XF\Db\Mysqli\Statement->execute() in src/XF/Db/AbstractAdapter.php at line 94
XF\Db\AbstractAdapter->query() in src/XF/Db/AbstractAdapter.php at line 289
XF\Db\AbstractAdapter->delete() in src/XF/Search/Source/MySqlFt.php at line 126
XF\Search\Source\MySqlFt->delete() in src/XF/Search/Search.php at line 122
XF\Search\Search->delete() in src/XF/Behavior/Indexable.php at line 81
XF\Behavior\Indexable->XF\Behavior\{closure}() in src/XF.php at line 341
XF::triggerRunOnce() in src/XF/Mvc/Dispatcher.php at line 156
XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 55
XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2337
XF\App->run() in src/XF.php at line 488
XF::runApp() in index.php at line 20

Just checked my control panel, I have about 7000+ ages of this error as well.

Screen Shot 2021-05-29 at 2.16.27 PM.png
 
Last edited:
The error above indicates you left out the word TABLE.
The second error indicates that he tried to run TRUNCATE directly on the prompt instead within mysql.

Despite that, TABLE is optional so it should work with or without that keyword - but definitly not with quotes around the table name (backticks can be used)
 
Last edited:
Well ... that post is incorrect ;)

TRUNCATE xf_seach_index in phpMyAdmin should work.

In SSH you can try mysql -e 'TRUNCATE xf_search_index' but that does require the mysql command line client to be installed and configured properly.
 
For future reference, the option to delete the search index before rebuilding should run the truncate command internally (for the default search at least), so it'd effectively do this for you.

(On a side note, if you're running into this in any frequency, it may indicate either a server issue or a server config issue -- or MySQL being shutdown ungracefully. It probably requires server investigation.)
 
For future reference, the option to delete the search index before rebuilding should run the truncate command internally (for the default search at least), so it'd effectively do this for you.

(On a side note, if you're running into this in any frequency, it may indicate either a server issue or a server config issue -- or MySQL being shutdown ungracefully. It probably requires server investigation.)
Thanks Mike, this is the first time this has happened on on site.
 
Top Bottom