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

Undefined index user ID ...

Temery

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

Any thoughts?
 

Attachments

Chris D

XenForo developer
Staff member
#2
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.
 

Temery

Active member
#3
image.jpg image.jpg
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.
I have no idea what the full error and stack trace means.

Here is a screen capture of my add ons:
 

Chris D

XenForo developer
Staff member
#4
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 ;)
 

Temery

Active member
#5
View attachment 82938 View attachment 82938

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

Here is a screen capture of my add ons:

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) {
}
}
 

Chris D

XenForo developer
Staff member
#6
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.
 

Temery

Active member
#7
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.

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.
 

Chris D

XenForo developer
Staff member
#8
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.
 

Jake Bunce

XenForo moderator
Staff member
#9
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.
 

pegasus

Well-known member
#10
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.
 

Mike

XenForo developer
Staff member
#11
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.
 

The Sandman

Well-known member
#12
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.