XF 1.1 Unknown column 'user.user_id' in 'on clause'

Since day one of my XenForo installation , I have been facing this error.

I have tried everything :
Changing Servers
Fresh install
and what not.

Every few hrs the user_id column goes missing automatically.

I have to restore backups all the time :(

I would appreciate some suggestions and help!

Thanks guys



XenForo moderator
Staff member
Do you have any add-ons installed?

If it's happening periodically then that would suggest a cron task is removing the field.
Can you post the full error? It should contain a stack trace:

Admin CP -> Tools -> Server Error Log
Error Info
Zend_Db_Statement_Mysqli_Exception: Mysqli prepare error: Unknown column 'user.user_id' in 'on clause' - library/Zend/Db/Statement/Mysqli.php:77
Generated By: Unknown Account, 37 minutes ago
Stack Trace

#0 /home/admin/domains/myurl/public_html/forum/library/Zend/Db/Statement.php(115): Zend_Db_Statement_Mysqli->_prepare('????SELECT thre...')
#1 /home/admin/domains/myurl/public_html/forum/library/Zend/Db/Adapter/Mysqli.php(381): Zend_Db_Statement->__construct(Object(Zend_Db_Adapter_Mysqli), '????SELECT thre...')
#2 /home/admin/domains/myurl/public_html/forum/library/Zend/Db/Adapter/Abstract.php(478): Zend_Db_Adapter_Mysqli->prepare('????SELECT thre...')
#3 /home/admin/domains/myurl/public_html/forum/library/Zend/Db/Adapter/Abstract.php(753): Zend_Db_Adapter_Abstract->query('????SELECT thre...', 5196)
#4 /home/admin/domains/myurl/public_html/forum/library/XenForo/Model/Thread.php(44): Zend_Db_Adapter_Abstract->fetchRow('????SELECT thre...', 5196)
#5 /home/admin/domains/myurl/public_html/forum/library/XenForo/ControllerHelper/ForumThreadPost.php(152): XenForo_Model_Thread->getThreadById(5196, Array)
#6 /home/admin/domains/myurl/public_html/forum/library/XenForo/ControllerHelper/ForumThreadPost.php(74): XenForo_ControllerHelper_ForumThreadPost->getThreadOrError(5196, Array)
#7 /home/admin/domains/myurl/public_html/forum/library/XenForo/ControllerPublic/Thread.php(33): XenForo_ControllerHelper_ForumThreadPost->assertThreadValidAndViewable(5196, Array, Array)
#8 /home/admin/domains/myurl/public_html/forum/library/Dark/TaigaChat/ControllerPublic/Index.php(8): XenForo_ControllerPublic_Thread->actionIndex()
#9 /home/admin/domains/myurl/public_html/forum/library/XenForo/FrontController.php(310): Dark_TaigaChat_ControllerPublic_Index->actionIndex()
#10 /home/admin/domains/myurl/public_html/forum/library/XenForo/FrontController.php(132): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#11 /home/admin/domains/myurl/public_html/forum/index.php(13): XenForo_FrontController->run()
#12 {main}

Request State

array(3) {
["url"] => string(72) "http://myurl/forum/threads/"
["_GET"] => array(0) {
["_POST"] => array(0) {

I had to shorten it a little as it was too much text on there.


Jake Bunce

XenForo moderator
Staff member
I see the TaigaChat addon named in the error. This might be related.

Entire columns don't just go missing in the database. I agree with Brogan that there may be a cron or other program that is removing the column. Perhaps an addon. Although that would be a strange thing for any addon to do (removing the user_id column).


XenForo moderator
Staff member
That seems to indicate it could be related to the TaigaChat add-on.

Are you archiving chat messages?
Try disabling that option for the chat add-on for a start.

Luke F

Well-known member
It's highly unlikely to be related to TaigaChat, though you are using an out of date version (not that the old versions would do something like this)

It would be worth checking if there is any code that is actually capable of dropping the column - run this from your forum root:

find . -iname "*.php" | xargs grep "drop column" -sl

Luke F

Well-known member
Is there an alternative to "find"?
yum install findutils

Also have you tried verifying files in the ACP?

And at what level are you 'changing server' - that is to say, is this between shared hosts, copying stuff such as configs between proper servers, or a fresh start on a proper server?


XenForo developer
Staff member
I had dealt with this in a ticket and there were clear indications that (at least at first), the fields were being dropped via a phpMyAdmin installation. At other times, there were no web server logs that were weird, but I did see SSH access that was suspect. So I still think that the server or host has been compromised or that there's a keylogger somewhere.


XenForo moderator
Staff member
Mike has already explained above what the problem is and as he is one of the developers and has investigated the issue by responding to a ticket, he is far better placed than anyone else to determine that.

This is an issue external to the software.

Jake Bunce

XenForo moderator
Staff member
I will take a look if you are comfortable giving me FTP and admin access. At the very least I can look for back doors and malicious code. Trying to "clean" a forum that has been hacked can be difficult, but I have dealt with hacked forums before and I know some of the tricks they use.
I logged in the apache processes when this drop happens and found a common thing in both the logs I got.

[COLOR=#000000]8-0  24041 0/1680/1680 _ 52.13 0  69721 0.0  4.21  4.21    GET /malloc.php HTTP/1.0
Can anyone give me some information about malloc.php associated with XenForo?[/COLOR]