XF 1.2 Intermittent permissions errors

Chris D

XenForo developer
Staff member
AVForums are unfortunately experiencing a major issue with permissions. Randomly throughout the day, many of their staff members are unable to access any page on the forum with the standard "You do not have permission to..."

It's been happening for a few days. There's no specific pattern to it. Nothing specific causes it. It doesn't trigger on a specific page, and nothing specific seems to resolve it, but it eventually does resolve itself automatically after a seemingly random period of time.

I implemented some pretty rudimentary logging into a text file that is triggered to log the contents of the $visitor array when it happens.

Code:
2013-11-01 11:21:13 *** Permission Error: Phil Hinton | Nov 1, 2013 at 11:21 AM ***
2013-11-01 11:21:13 user_id: 6724
2013-11-01 11:21:13 username: Phil Hinton
2013-11-01 11:21:13 email: phil@avforums.com
2013-11-01 11:21:13 gender:
2013-11-01 11:21:13 custom_title: Editor
2013-11-01 11:21:13 language_id: 1
2013-11-01 11:21:13 style_id: 0
2013-11-01 11:21:13 timezone: Europe/London
2013-11-01 11:21:13 visible: 1
2013-11-01 11:21:13 user_group_id: 2
2013-11-01 11:21:13 secondary_group_ids: 4,9,14,18,21,22
2013-11-01 11:21:13 display_style_group_id: 22
2013-11-01 11:21:13 permission_combination_id: 2906
2013-11-01 11:21:13 message_count: 8555
2013-11-01 11:21:13 conversations_unread: 23
2013-11-01 11:21:13 register_date: 979819200
2013-11-01 11:21:13 last_activity: 1383304218
2013-11-01 11:21:13 trophy_points: 166
2013-11-01 11:21:13 alerts_unread: 2
2013-11-01 11:21:13 avatar_date: 1383152368
2013-11-01 11:21:13 avatar_width: 260
2013-11-01 11:21:13 avatar_height: 192
2013-11-01 11:21:13 gravatar:
2013-11-01 11:21:13 user_state: valid
2013-11-01 11:21:13 is_moderator: 1
2013-11-01 11:21:13 is_admin: 0
2013-11-01 11:21:13 is_banned: 0
2013-11-01 11:21:13 like_count: 5
2013-11-01 11:21:13 warning_points: 0
2013-11-01 11:21:13 is_staff: 1
2013-11-01 11:21:13 competition_entries:
2013-11-01 11:21:13 showcase_count: 0
2013-11-01 11:21:13 moderation_mode: 0
2013-11-01 11:21:13 active_checking: 0
2013-11-01 11:21:13 dob_day: 12
2013-11-01 11:21:13 dob_month: 3
2013-11-01 11:21:13 dob_year: 1974
2013-11-01 11:21:13 status:
2013-11-01 11:21:13 status_date: 0
2013-11-01 11:21:13 status_profile_post_id: 0
2013-11-01 11:21:13 signature: [b]AVForums Editor[/b]
[url="http://twitter.com/PhilHinton"]Follow me on Twitter![/url]  -  [size=1]My personal opinions are not those of AVForums or any other related website.[/size]
2013-11-01 11:21:13 homepage: http://www.avforums.tv
2013-11-01 11:21:13 location: AVForums
2013-11-01 11:21:13 occupation: Editor - AV Forums
2013-11-01 11:21:13 following: 1,4882,5786,5943,6002,6504,7561,9510,10145,11882,12676,14785,28808,31579,34875,36506,39728,55108,61065,83728,87967,155875,168679,202164,407545,413150,463354,463738,502389,503783
2013-11-01 11:21:13 ignored: a:0:{}
2013-11-01 11:21:13 csrf_token: 1C1316FD4147CB5AA784E754030021420B2F283F
2013-11-01 11:21:13 avatar_crop_x: 17
2013-11-01 11:21:13 avatar_crop_y: 0
2013-11-01 11:21:13 about:
2013-11-01 11:21:13 facebook_auth_id: 0
2013-11-01 11:21:13 custom_fields: a:9:{s:14:"AVFheaderStyle";s:0:"";s:3:"aim";s:0:"";s:22:"avForumsForumListStyle";s:8:"expanded";s:8:"facebook";s:0:"";s:5:"gtalk";s:0:"";s:3:"icq";s:0:"";s:5:"skype";s:0:"";s:7:"twitter";s:0:"";s:5:"yahoo";s:0:"";}
2013-11-01 11:21:13 hotspots_created: 0
2013-11-01 11:21:13 show_dob_year: 1
2013-11-01 11:21:13 show_dob_date: 0
2013-11-01 11:21:13 content_show_signature: 1
2013-11-01 11:21:13 receive_admin_email: 1
2013-11-01 11:21:13 email_on_conversation: 1
2013-11-01 11:21:13 is_discouraged: 0
2013-11-01 11:21:13 default_watch_state:
2013-11-01 11:21:13 alert_optout:
2013-11-01 11:21:13 enable_rte: 1
2013-11-01 11:21:13 enable_flash_uploader: 1
2013-11-01 11:21:13 allow_view_profile: everyone
2013-11-01 11:21:13 allow_post_profile: none
2013-11-01 11:21:13 allow_send_personal_conversation: members
2013-11-01 11:21:13 allow_view_identities: everyone
2013-11-01 11:21:13 allow_receive_news_feed: everyone
2013-11-01 11:21:13 positive_rating_count: 5058
2013-11-01 11:21:13 positive_rating_count_incl_likes: 5063
2013-11-01 11:21:13 negative_rating_count:
2013-11-01 11:21:13 neutral_rating_count:
2013-11-01 11:21:13 total_rating_count: 5058
2013-11-01 11:21:13 fb_percent: 100
2013-11-01 11:21:13 fb_positive: 33
2013-11-01 11:21:13 pr_user_id:
2013-11-01 11:21:13 xc_trade_notify_email:
2013-11-01 11:21:13 xc_trade_notify_pm:
2013-11-01 11:21:13 xc_trade_notify_notification:
2013-11-01 11:21:13 xc_trade_is_invisible:
2013-11-01 11:21:13 csrf_token_page: 6724,1383304873,bfdef7458473fa6a81e1d0c463268e9952e85543
2013-11-01 11:21:13 customFields: a:9:{s:14:"AVFheaderStyle";s:0:"";s:3:"aim";s:0:"";s:22:"avForumsForumListStyle";s:8:"expanded";s:8:"facebook";s:0:"";s:5:"gtalk";s:0:"";s:3:"icq";s:0:"";s:5:"skype";s:0:"";s:7:"twitter";s:0:"";s:5:"yahoo";s:0:"";}
2013-11-01 11:21:13 isTrusted: 1
2013-11-01 11:21:13 referer:
2013-11-01 11:21:13 from_search:
2013-11-01 11:21:13 ignoredUsers: a:0:{}
2013-11-01 11:21:13 permissions: a:0:{}
2013-11-01 11:21:13 *** End ***
Note: If you see anything in there that is usually an array that is serialised, this was done deliberately as part of the logging process.

The interesting points to note here:

The global_permission_cache and permissions keys are blank. Presumably this is the issue.

Any advice on what we can do to debug the issue further?

Of course it may be add-on related, but I can't really think of what add-on would intermittently trigger this for some users. Is there anything in the core software that could trigger a permissions rebuild, clear these two fields and cause this issue?
 
Right now, adding a permission combination (which triggers permission rebuilds) can trigger some weird behaviors but it should generally be resolved in a page view or two. I have looked into a workaround but it had other problems.
 
We have built up permissions as logically as possible. All members are guests or registered with secondary user groups adding or removing permissions. There are also several private nodes.
And of course we have 50 or so addons. Very few of which are not considered very important.
 
The frequency at which this is happening and the number of people to whom this is happening is concerning. Also the length of time it appears to take too. Phil reported at one point that it took him around 25 minutes before he was able to resume what he was doing.

Although there may be a workaround that lessens the impact of the rebuild eventually, should we be concerned at the frequency this rebuild is happening? It has happened to Phil 3 or 4 times today already. I guess from what you're saying we should probably inspect some of the add-ons we have installed to see if they are frequently adding permission combinations for some reason? Or arbitrarily rebuilding the permissions for some reason?
 
@Chris Deeming @Harpers Tate @arms @GetParanoid @Stuart Wright
After reading through every thread that pretty much mentions a permission error/issue, it seems this is the group that has identical issues. @Divvens, your problem is similar but I believe it's different, but I included you just in case.

I don't know if we have any Addons in common that could be causing it. I will say, I was just forced to do a fresh install and I received the error earlier. So perhaps, the 5/6 of us could get together and brainstorm on it.

As far as I'm seeing, here's the problem that is happening:
(Please add/confirm/deny these things happening, so we know if it's the same issue)
  • Happens intermittently
  • No specific location/page
  • Refreshing/Trying to Load other pages can resolve it
  • Happens often after logging in/returning to forums after period of time


Info for my Forum:
Style: Xenfocus' Platform theme
Multiple Private Nodes, also using Registered as Primary group and access given by various secondary groups
Addons:
Ad Manager 1.0 Beta 3.0.1
Bb Codes & Buttons Manager 2.3.0
Email Idle Users by Waindigo 1.0.2a
LiquidPro Simple Forms 2.0.1
Live Update 3.0
Nodes As Tabs 1.2.2
ParseHTML 1.0.6
Post Ratings 1.6.1
Profile Completion Steps 1.0 RC1
Similar Threads 1.5
Sitemap for XenForo 1.3.2
Smilie Importer by Waindigo 1.0.2
Special Avatar for Banned Members 1.3.3
Steam Auth 1.3.4
TaigaChat Pro 1.2.0
Template Modification System 1.3.0
Toggle ME 2.1.2
Unread Post Count 1.1.3
User Essentials 1.1.6
User Search by Waindigo 1.0.2
WebGuruBB.com DPC Addon 1.0.2
XenMoods 1.1.3
XFA - BBCode for tabs 1.0.3
[8wayRun.Com] XenPorta (Portal) 1.6.0
[bd] Tag Me 2.0.1
[bd] Widget Framework 2.4.3
[BW] Source Server List 1.0.0
[Tinhte] Attach Image Optimization 2.2.11

@HowIChrgeLazer, I know arms and I were driving you crazy with this. I hope we can find a solution that doesn't involve giving you more stress :p
 
I'm really sorry. I should have come back and said.

This ended up being fixed after a tweak made in 1.2.3.

@Mike very kindly gave us the new code prior to 1.2.3's release and we were able to verify that the permissions error did not reoccur after the code was changed.

Therefore you should upgrade to 1.2.3 at the earliest opportunity. @Arty I forgot to catch up with you, but the fix should also resolve the permissions disappearing briefly after User Upgrades happen which is something you reported a few months ago in Development Discussions forum.

If the problem persists, then the issue is unlikely to be the same and therefore I'd recommend starting a new troubleshooting thread. I can also give you my code edit that will provide logging when the permissions error hits.
 
I'm really sorry. I should have come back and said.

This ended up being fixed after a tweak made in 1.2.3.

@Mike very kindly gave us the new code prior to 1.2.3's release and we were able to verify that the permissions error did not reoccur after the code was changed.

Therefore you should upgrade to 1.2.3 at the earliest opportunity. @Arty I forgot to catch up with you, but the fix should also resolve the permissions disappearing briefly after User Upgrades happen which is something you reported a few months ago in Development Discussions forum.

If the problem persists, then the issue is unlikely to be the same and therefore I'd recommend starting a new troubleshooting thread. I can also give you my code edit that will provide logging when the permissions error hits.

I have seen one error, however, compared to number before, I wasn't sure if this one was because I was rebuilding the site. If you could provide the code, I would be extremely grateful.
 
Top Bottom