Unhandled exception in GetRolesFromCookie

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
1/4/2012 1:21:39 PM
Gravatar
Total Posts 537
feet planted firmly on the ground

Unhandled exception in GetRolesFromCookie

Hi Joe

I'm not sure if you'd count this as a bug, but it is an unhandled exception that has just occured to me on one of our mojoPortal sites... (and could happen to real site users).  After rebooting the web server, I had a browser window sitting there with a page that I had loaded before the reboot. On clicking a link I was asked to log in (I had previously been logged in already). On entering the login details, the site bombed with your standard "...something wrong, you might like to click back or visit the home page..." page.

I then checked on the server, stopped and started the site and app pool etc and no change. Then I found that the site worked fine in a different browser. Then I found this in the server event log (specifics obscured):

Event code: 3005

Event message: An unhandled exception has occurred.

Event time: 04/01/2012 19:07:37

Event time (UTC): 04/01/2012 19:07:37

Event ID: 90dcc093b40e40a99bf76bfea29e4f13

Event sequence: 3

Event occurrence: 1

Event detail code: 0

Application information:

Application domain: /LM/W3SVC/15/ROOT-2-129701776569993468

Trust level: Full

Application Virtual Path: /

Application Path: D:\Websites\mywebsite\

Machine name: ESDM-WEB-07

Process information:

Process ID: 8176

Process name: w3wp.exe

Account name: NT AUTHORITY\NETWORK SERVICE

Exception information:

Exception type: NullReferenceException

Exception message: Object reference not set to an instance of an object.

at mojoPortal.Web.mojoRoleProvider.GetRolesFromCookie()

at mojoPortal.Web.mojoRoleProvider.GetRolesForUser(String userName)

at System.Web.Security.RolePrincipal.IsInRole(String role)

at mojoPortal.Business.WebHelpers.WebUser.IsInRole(String role)

at mojoPortal.Business.WebHelpers.WebUser.IsInRoles(String roles)

at mojoPortal.Web.SiteUtils.GetSkinName(Boolean allowPageOverride, Page page)

at mojoPortal.Web.mojoBasePage.SetupMasterPage()

at mojoPortal.Web.mojoBasePage.OnPreInit(EventArgs e)

at mojoPortal.Web.UI.CmsPage.OnPreInit(EventArgs e)

at System.Web.UI.Page.PerformPreInit()

at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Request information:

Request URL: http://www.mywebsite.co.uk/Default.aspx

Request path: /Default.aspx

User host address: 11.22.33.44

User: adfsdsdfsg

Is authenticated: True

Authentication Type: Forms

Thread account name: NT AUTHORITY\NETWORK SERVICE

Thread information:

Thread ID: 14

Thread account name: NT AUTHORITY\NETWORK SERVICE

Is impersonating: False

Stack trace:    at mojoPortal.Web.mojoRoleProvider.GetRolesFromCookie()

at mojoPortal.Web.mojoRoleProvider.GetRolesForUser(String userName)

at System.Web.Security.RolePrincipal.IsInRole(String role)

at mojoPortal.Business.WebHelpers.WebUser.IsInRole(String role)

at mojoPortal.Business.WebHelpers.WebUser.IsInRoles(String roles)

at mojoPortal.Web.SiteUtils.GetSkinName(Boolean allowPageOverride, Page page)

at mojoPortal.Web.mojoBasePage.SetupMasterPage()

at mojoPortal.Web.mojoBasePage.OnPreInit(EventArgs e)

at mojoPortal.Web.UI.CmsPage.OnPreInit(EventArgs e)

at System.Web.UI.Page.PerformPreInit()

at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

I found that when I cleared the browser cache and cookies for the domain, the site loaded fine.

My installation details:

mojoPortal Version                                2.3.7.5                MSSQL           Operating System                Microsoft Windows NT 6.0.6002 Service Pack 2

ASP.NET Info                v4.0.30319 Running in Full Trust

Server Time Zone                GMT Standard Time

Server Local Time                (GMT 0) 04/01/2012 19:18:43

Greenwich Mean Time (GMT/UTC)                04/01/2012 19:18:43

 

1/4/2012 1:26:24 PM
Gravatar
Total Posts 18439

Re: Unhandled exception in GetRolesFromCookie

Hi Crispin,

This is the result of a change in behavior in the .NET runtime after a recent ASP.NET security update that came down via windows update. The security update came out right after we shipped mojoPortal 2.3.7.6 and this problem was reported on this thread.

I have patched the 2.3.7.6 release to handle this exception so upgrading should solve it.

Best,

Joe

You must sign in to post in the forums. This thread is closed to new posts.