dnnsoftware / Dnn.AdminExperience

DNN (formerly DotNetNuke) Combined Admin Experience
MIT License
17 stars 39 forks source link

Issue when loading the Persona Bar: Not Thread Safe #1125

Closed berkarslan-xo closed 5 years ago

berkarslan-xo commented 5 years ago

Description of bug

An error, which has the screenshot of it below, is present sometimes several times per day.

Steps to reproduce

Customer has the error frequently; however, unable to reproduce the error on demand, it just happens randomly.

Current result

The following error appears:

2019-04-01 10:04:31,130 [JWWEBSVR21][Thread:44][FATAL] DotNetNuke.Framework.PageBase - An error has occurred while loading page. 
System.InvalidOperationException: Collection was modified; enumeration operation may not execute. 
at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) 
at System.Collections.Generic.List`1.Enumerator.MoveNextRare() 
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source, Func`2 predicate) 
at Evoq.PersonaBar.UI.Controllers.EvoqPersonaBarContainer.Initialize(UserControl personaBarControl) 
at Dnn.PersonaBar.UI.UserControls.PersonaBarContainer.OnInit(EventArgs e) 
at System.Web.UI.Control.InitRecursive(Control namingContainer) 
at System.Web.UI.Control.AddedControl(Control control, Int32 index) 
at DotNetNuke.UI.Skins.Skin.InjectControlPanel() 
at DotNetNuke.UI.Skins.Skin.OnInit(EventArgs e) 
at System.Web.UI.Control.InitRecursive(Control namingContainer) 
at System.Web.UI.Control.AddedControl(Control control, Int32 index) 
at DotNetNuke.Framework.DefaultPage.OnInit(EventArgs e) 
at System.Web.UI.Control.InitRecursive(Control namingContainer) 
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 

Expected result

This error shouldn't occur.

Screenshots

image

Error log

Additional context

Affected version

Affected browser

bdukes commented 5 years ago

Do we know what's modifying that list? It seems like the underlying list shouldn't be exposed in the first place.

berkarslan-xo commented 5 years ago

Do we know what's modifying that list? It seems like the underlying list shouldn't be exposed in the first place.

It's coming from cache so that any place that updates the cache for this entity might cause this error but I didn't check the specific locations which update the cache for this entity.

Btw, I have opened PR #1126 for this issue and I put some more info there why this defect occurs.