XF 2.2 MySQL query error [1264]: Out of range value for column 'thread_read_id'

Mr Shap

Member
Hi. I just started receiving this error

Any idea what might be causing it? It's not appearing for everyone but appears for most users.

Code:
XF\Db\Exception: MySQL query error [1264]: Out of range value for column 'thread_read_id' at row 1 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 77
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 221
XF\Db\AbstractAdapter->insert() in src/XF/Repository/Thread.php at line 235
XF\Repository\Thread->markThreadReadByUser() in src/XF/Repository/Thread.php at line 256
XF\Repository\Thread->markThreadReadByVisitor() in src/XF/Pub/Controller/Thread.php at line 134
XF\Pub\Controller\Thread->actionIndex() in src/addons/AddonsLab/GuestPosting/XF/Pub/Controller/Thread.php at line 46
AddonsLab\GuestPosting\XF\Pub\Controller\Thread->actionIndex() in src/addons/XenAddons/UBS/XF/Pub/Controller/Thread.php at line 11
XenAddons\UBS\XF\Pub\Controller\Thread->actionIndex() in src/addons/XFMG/XF/Pub/Controller/Thread.php at line 11
XFMG\XF\Pub\Controller\Thread->actionIndex() in src/XF/Mvc/Dispatcher.php at line 350
XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 261
XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 113
XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 55
XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2344
XF\App->run() in src/XF.php at line 512
XF::runApp() in index.php at line 20
 

This was what it ended up being.
 
Looks like it's related to a third party add-on by addonslab.
It's quite feasible to exceed 32-byte limit on IDs in that table even without an add-on.

If anyone else encounters this issue, and you continue to encounter it with vanilla XF, you may need switch to 64-byte IDs on several of your tables. I'll leave that as an exercise to the reader, as ensuring XF doesn't overwrite your changes during upgrades is non-trivial.
 
Top Bottom