1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'Troubleshooting and Problems' started by Mr.Smith, Dec 18, 2011.

  1. Mr.Smith

    Mr.Smith Member

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

    I have tried everything :
    Changing Servers
    Upgrading
    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

    Mr.Smith
     
  2. Brogan

    Brogan 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.
     
  3. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Can you post the full error? It should contain a stack trace:

    Admin CP -> Tools -> Server Error Log
     
  4. Mr.Smith

    Mr.Smith Member

    When I restore a backup the logs go off mate.

    It does happen once or twice a day at different timings.

    I have addons installed, I have attached a screenshot of my addon list and cron tasks.

    thanks for the prompt response guys!

    God Bless
     

    Attached Files:

  5. Mr.Smith

    Mr.Smith Member

    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.

    Thanks!
     
  6. Jake Bunce

    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).
     
  7. Brogan

    Brogan 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.
     
  8. Luke F

    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:

    Code:
    find . -iname "*.php" | xargs grep "drop column" -sl  
     
  9. Mr.Smith

    Mr.Smith Member

    well, find doesn't seem to work on my CentOS Server.

    Thanks for the reply Dark , Jake and Brogan :)
     
  10. Mr.Smith

    Mr.Smith Member

    Is there an alternative to "find"?
     
  11. Mr.Smith

    Mr.Smith Member

    I disabled all my addons for a week and the problem continues :(

    even changed servers again.
     
  12. Brogan

    Brogan XenForo Moderator Staff Member

    Can you list all active cron tasks?
     
  13. Luke F

    Luke F Well-Known Member

    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?
     
  14. Mike

    Mike 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.
     
    Darkimmortal and Brogan like this.
  15. Mr.Smith

    Mr.Smith Member

  16. Mr.Smith

    Mr.Smith Member

    The problem still persists can I have some help please?

    I have even uninstalled most of the addons, and disabled the rest.
     
  17. Brogan

    Brogan 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.
     
  18. Mr.Smith

    Mr.Smith Member

    I have already formatted , changed servers , disabled plugins, reuploaded xenforo files :(
     
  19. Jake Bunce

    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.
     
  20. Mr.Smith

    Mr.Smith Member

    I logged in the apache processes when this drop happens and found a common thing in both the logs I got.

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

Share This Page