XF 2.0 XF\Db\DuplicateKeyException: MySQL query error [1062]

hovik

Member
This pops up every time trying to make a post. Just started doing it today. Anyone know how to fix? It happens when posting in a thread or starting a new thread.

XF\Db\DuplicateKeyException: MySQL query error [1062]: Duplicate entry '' for key 'title_message_metadata' in src/XF/Db/AbstractStatement.php at line 212
  1. XF\Db\AbstractStatement->getException() in src/XF/Db/Mysqli/Statement.php at line 196
  2. XF\Db\Mysqli\Statement->getException() in src/XF/Db/Mysqli/Statement.php at line 78
  3. XF\Db\Mysqli\Statement->execute() in src/XF/Db/AbstractAdapter.php at line 79
  4. XF\Db\AbstractAdapter->query() in src/XF/Db/AbstractAdapter.php at line 161
  5. XF\Db\AbstractAdapter->insert() in src/XF/Search/Source/MySqlFt.php at line 97
  6. XF\Search\Source\MySqlFt->index() in src/XF/Search/Search.php at line 40
  7. XF\Search\Search->index() in src/XF/Behavior/Indexable.php at line 46
  8. XF\Behavior\Indexable->XF\Behavior\{closure}() in src/XF.php at line 244
  9. XF::triggerRunOnce() in src/XF/Mvc/Dispatcher.php at line 137
  10. XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 41
  11. XF\Mvc\Dispatcher->run() in src/XF/App.php at line 1931
  12. XF\App->run() in src/XF.php at line 328
  13. XF::runApp() in index.php at line 13
 
That column (title_message_metadata) doesn't appear in the core, so it's likely due to an add-on.
Disabled all add-ons and error still there.
To be clear there were no new add-ons or any other changes made around the time when the issue started. The only thing that was done was the server and mysql restart.
 
If there is a unique key on that column and the default value is set to an empty string (or anything really), that error would crop up regardless of whether or not the relevant add-on is enabled or disabled.

Actually, scratch that. Just clicked for me that this error is occuring on a key, not a column, and the key does appear in the core.
 
If there is a unique key on that column and the default value is set to an empty string (or anything really), that error would crop up regardless of whether or not the relevant add-on is enabled or disabled.

Actually, scratch that. Just clicked for me that this error is occuring on a key, not a column, and the key does appear in the core.
Thanks for trying.
 
Another thing I noticed, not sure if it helps to figure it out ...

When I type a reply and hit post I get that error pop up, the page doesn't refresh to show the reply posted but it's there if you click out and go back into the thread. It also keeps whatever was typed in the reply box as if it was never submitted.
 
Another thing I noticed, not sure if it helps to figure it out ...

When I type a reply and hit post I get that error pop up, the page doesn't refresh to show the reply posted but it's there if you click out and go back into the thread. It also keeps whatever was typed in the reply box as if it was never submitted.
Same problem, how did you solve it??
 
I am also experiencing this same error. I discovered my MySQL server had died a few weeks ago, and started it back up without much thought. I now have many users complaining about sporadic error messages, notably like this:
Code:
Zend_Db_Statement_Mysqli_Exception: Mysqli statement execute error : Duplicate entry '' for key 'title_message_metadata' - library/Zend/Db/Statement/Mysqli.php:214
I have just run some MySQL Check and Repair processes to see if that can clean up any discrepancies. I found that the xf_search_index table was marked as "crashed".
 
Back
Top Bottom