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

XF 1.2 Intermittent permissions errors

Discussion in 'Troubleshooting and Problems' started by Chris D, Nov 1, 2013.

  1. Chris D

    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?
     
    arms and Harpers Tate like this.
  2. Mike

    Mike XenForo Developer Staff Member

    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.
     
  3. Stuart Wright

    Stuart Wright Well-Known Member

    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.
     
  4. Chris D

    Chris D XenForo Developer Staff Member

    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?
     
  5. Harpers Tate

    Harpers Tate Well-Known Member

  6. Chris D

    Chris D XenForo Developer Staff Member

    I knew I'd seen a post reporting something similar elsewhere. Thanks.
     
  7. Eoj Nawoh

    Eoj Nawoh Active Member

    @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:
    @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
     
    arms likes this.
  8. Mike

    Mike XenForo Developer Staff Member

    There are tweaks in 1.2.3 that help should help prevent this.
     
  9. Chris D

    Chris D XenForo Developer Staff Member

    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.
     
  10. Eoj Nawoh

    Eoj Nawoh Active Member

    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.
     

Share This Page