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

Intermittent undefined index errors, e.g. Undefined index: user_id when XenForo_Visitor is used.

Discussion in 'Troubleshooting and Problems' started by The Sandman, Dec 22, 2014.

  1. The Sandman

    The Sandman Well-Known Member

    Here's another one - they come hundreds at a time:
    Code:
    Error Info
    ErrorException: Undefined index: user_id - library/XenForo/Visitor.php:670
    Generated By: Unknown Account, Today at 7:07 AM
    Stack Trace
    #0 /srv/www/theadminzone.com/public_html/library/XenForo/Visitor.php(670): XenForo_Application::handlePhpError(8, 'Undefined index...', '/srv/www/theadm...', 670, Array)
    #1 /srv/www/theadminzone.com/public_html/library/XenForo/Visitor.php(113): XenForo_Visitor->offsetGet('user_id')
    #2 /srv/www/theadminzone.com/public_html/library/Bookmarks/Listener/Hook.php(10): XenForo_Visitor::getUserId()
    #3 [internal function]: Bookmarks_Listener_Hook::templateCreate('PAGE_CONTAINER', Array, Object(XenForo_Template_Public))
    #4 /srv/www/theadminzone.com/public_html/library/XenForo/CodeEvent.php(58): call_user_func_array(Array, Array)
    #5 /srv/www/theadminzone.com/public_html/library/XenForo/Template/Abstract.php(82): XenForo_CodeEvent::fire('template_create', Array, 'PAGE_CONTAINER')
    #6 /srv/www/theadminzone.com/public_html/library/XenForo/Dependencies/Public.php(239): XenForo_Template_Abstract->__construct('PAGE_CONTAINER', Array)
    #7 /srv/www/theadminzone.com/public_html/library/XenForo/ViewRenderer/Abstract.php(263): XenForo_Dependencies_Public->createTemplateObject('PAGE_CONTAINER', Array)
    #8 /srv/www/theadminzone.com/public_html/library/XenForo/ViewRenderer/HtmlPublic.php(119): XenForo_ViewRenderer_Abstract->createTemplateObject('PAGE_CONTAINER', Array)
    #9 /srv/www/theadminzone.com/public_html/library/XenForo/FrontController.php(618): XenForo_ViewRenderer_HtmlPublic->renderContainer(Object(XenForo_Template_Public), Array)
    #10 /srv/www/theadminzone.com/public_html/library/XenForo/FrontController.php(158): XenForo_FrontController->renderView(Object(XenForo_ControllerResponse_View), Object(XenForo_ViewRenderer_HtmlPublic), Array)
    #11 /srv/www/theadminzone.com/public_html/index.php(13): XenForo_FrontController->run()
    #12 {main}
    Request State
    array(3) {
      ["url"] => string(67) "https://theadminzone.com/threads/list-of-free-forum-software.49185/"
      ["_GET"] => array(1) {
        ["/threads/list-of-free-forum-software_49185/"] => string(0) ""
      }
      ["_POST"] => array(0) {
      }
    }
    These errors come in bunches every few days to a week - been an ongoing issue. It's usually an unknown account, same two or three errors but different add-ons are mentioned in them - sometimes no add-ons are mentioned at all. It's been quite difficult to track down. If you want to take a look I'll give you access on TAZ. :)
     
  2. Chris D

    Chris D XenForo Developer Staff Member

    A bit of background to this:

    These errors are happening intermittently at TAZ. Occasionally it appears as though a specific add-on is causing it, but after checking with various add-on authors, @The Sandman hasn't been able to track down the specific add-on causing it.

    @The Sandman, could you provide a screenshot of your installed add-ons, please?
     
  3. The Sandman

    The Sandman Well-Known Member

  4. Tracy Perry

    Tracy Perry Well-Known Member

    @The Sandman, I ended up totally removing the TAC stuff that I had installed. There were one or two add-ons that had problems with them even though they were disabled. I don't remember which ones they were, but after removing all of them except StopHumanSpan I never got any more errors.

    I don't know if that might be effecting any that you have, but it would be worth removing them.
     
    The Sandman likes this.
  5. Syndol

    Syndol Guest

    Are these errors only related to viewing threads?
    Random threads or specific ones?
    Are they always around the same time of day or is this random?
     
    The Sandman likes this.
  6. The Sandman

    The Sandman Well-Known Member

    I'm not sure.
    Seems to be random threads, but sometimes in a specific forum (but not always the same one). Times are random as well, but all the errors in each batch happen quickly over a couple of minutes.
     
    Syndol likes this.
  7. The Sandman

    The Sandman Well-Known Member

    I'll try that!
     
  8. Mike

    Mike XenForo Developer Staff Member

    This may be related to an opcode cache. If you're running APC -- particularly with PHP 5.4 -- I'd recommend trying something else (ideally PHP 5.5+ with the built-in opcode cache). We have seen several cases where literally impossible errors have occurred and they've generally been tracked back to opcode cache corruption.
     
    SneakyDave, euantor and Chris D like this.
  9. The Sandman

    The Sandman Well-Known Member

    The errors started on PHP 5.5 and have continued on PHP 5.6. I'll have to ask @MattW to chime in here to give our exact server setup, though I don't believe we're running APC.
     
  10. Tracy Perry

    Tracy Perry Well-Known Member

    Pretty sure Matt typically goes with a memcached/Zend OpCode cache routine.. or he used to. I don't think he uses APCu that much.
     
  11. MattW

    MattW Well-Known Member

    Correct.
     
  12. MattW

    MattW Well-Known Member

  13. SneakyDave

    SneakyDave Well-Known Member

    Sounds like you're going to have to disable those addons one by one until the problem goes away. Sucks
     
  14. The Sandman

    The Sandman Well-Known Member

    Nah... as I suspected this had nothing at all to do with any add-ons. :D
     
  15. Chris D

    Chris D XenForo Developer Staff Member

    Have you gotten to the bottom of it now, then?
     
    SneakyDave likes this.
  16. The Sandman

    The Sandman Well-Known Member

    Yeah, I believe so. Seems it was corruption of the database from the conversion process. Thanks to @MattW and @digitalpoint for getting it sorted. :)
     
  17. Mauve Giraffe

    Mauve Giraffe New Member

    I apologise for raising this thread from the dead, but since you apparently resolved the issue: are you able to elaborate on what @MattW and @digitalpoint did in order to reach this conclusion?
     
  18. MattW

    MattW Well-Known Member

    I exported the database, and re-imported into a fresh database. Pointed the site to that one and it stopped erroring.
     
  19. Mauve Giraffe

    Mauve Giraffe New Member

    Thank you very much for a swift reply. Here's to hoping it solves the problem for us as well!
     

Share This Page