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

Undefined index user ID ...

Discussion in 'Troubleshooting and Problems' started by Temery, Sep 5, 2014.

  1. Temery

    Temery Active Member

    I am getting a lot of errors, and reported weird behavior from visitors. Here is a screen capture of my error log.

    Any thoughts?
     

    Attached Files:

  2. Chris D

    Chris D XenForo Developer Staff Member

    I've seen this before recently.

    Can you go into one of the errors listed there, and paste here the full error and stack trace?

    Also, can you upload a screenshot of your add-ons? It's add-on related, and I think I may know which one.
     
  3. Temery

    Temery Active Member

    image.jpg image.jpg
    I have no idea what the full error and stack trace means.

    Here is a screen capture of my add ons:
     
  4. Chris D

    Chris D XenForo Developer Staff Member

    You posted a screenshot of the list of errors. Clicking one of them will bring up the full error details. It will become evident what the stack trace is when you do that ;)
     
  5. Temery

    Temery Active Member


    Oh ... :)

    Server Error Log
    Error Info
    ErrorException: Undefined index: is_admin - library/XenForo/Visitor.php:662
    Generated By: Unknown Account, Today at 7:26 AM
    Stack Trace
    #0 /home/boneyard/public_html/library/XenForo/Visitor.php(662): XenForo_Application::handlePhpError(8, 'Undefined index...', '/home/boneyard/...', 662, Array)
    #1 /home/boneyard/public_html/library/XenForo/ControllerPublic/Abstract.php(450): XenForo_Visitor->offsetGet('is_admin')
    #2 /home/boneyard/public_html/library/XenForo/ControllerPublic/Abstract.php(31): XenForo_ControllerPublic_Abstract->_updateAdminSessionCaches()
    #3 /home/boneyard/public_html/library/XenForo/Controller.php(308): XenForo_ControllerPublic_Abstract->_preDispatchType('Nopermission')
    #4 /home/boneyard/public_html/library/XenForo/FrontController.php(346): XenForo_Controller->preDispatch('Nopermission', 'XenForo_Control...')
    #5 /home/boneyard/public_html/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
    #6 /home/boneyard/public_html/index.php(13): XenForo_FrontController->run()
    #7 {main}
    Request State
    array(3) {
    ["url"] => string(41) "http://the-boneyard.com/forums/soccer.35/"
    ["_GET"] => array(0) {
    }
    ["_POST"] => array(0) {
    }
    }
     
  6. Chris D

    Chris D XenForo Developer Staff Member

    I believe this is a bug in Nodes As Tabs. You should post in the thread for that add on.

    I saw something similar recently at The Admin Zone @The Sandman initially thought it looked like a bug in one of my add ons.

    I think @Jake Bunce may be aware already but posting in the Nodes As Tabs thread won't hurt.
     
    The Sandman likes this.
  7. Temery

    Temery Active Member


    Other than a note in the error log, what real problems to the user would it create?

    Worth noting: I have two sites of comparable size, both have nodes as tabs installed. Only one site has the problem.
     
  8. Chris D

    Chris D XenForo Developer Staff Member

    When I last saw it I couldn't even reproduce the issue at all.

    I don't think it affects anything.

    It's best it gets fixed, though and I think Jake said he had an update planned soon.
     
    The Sandman likes this.
  9. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    This is similar to the error I get with NodesAsTabs (which accesses $visitor['user_id'] to trigger the error). But the above error doesn't show my addon in the trace. That trace is pure XenForo and it's giving a similar error.

    Since there are no addons in play I am moving this to bugs so the devs can review it.
     
    Chris D likes this.
  10. pegasus

    pegasus Well-Known Member

    A hint for add-ons that may encounter this (I've had similar issues with my own add-ons).

    The $visitor info generally is not set (so every index is undefined) on pages where the session isn't needed. Examples include proxy.php, deferred.php, css.php, and some other situations. So the user_id undefined error can potentially occur a lot in those situations. But it's hard to reproduce on demand, because in general those scripts either cache results or only run occasionally.
     
  11. Mike

    Mike XenForo Developer Staff Member

    While the backtrace doesn't show an error, it's certainly possible -- and indeed likely -- that an add-on is interfering. For example, any add-on that manipulates the visitor object or any query used to create the visitor object could cause this.

    If it's still happening, you'd definitely need to disable add-ons to try to narrow down the potential cause. I would guess that there's potentially some sort of query modification happening that is interfering.
     
  12. The Sandman

    The Sandman Well-Known Member

    I had 4337 pages of these errors over 6 hours last night. Troubleshooting is extremely difficult because the errors come in waves - I hadn't had any for at least a week prior to this. So I'm not sure how to tell where the problem lies by disabling add-ons due to the episodic nature of the issue.
     

Share This Page