U4-4395 - YSOD when creating membergroup

Created by Richard Soeteman 11 Mar 2014, 12:35:25 Updated by Shannon Deminick 12 Mar 2014, 04:11:49

When you create a Membergroup in the Umbraco 7.1 Backoffice the following exception is thrown after you press the save button. The meber group is created

Server Error in '/' Application. Object reference not set to an instance of an object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.] Umbraco.Web.Cache.MemberGroupCacheRefresher.b__1(JsonPayload payload) +88 Umbraco.Core.EnumerableExtensions.ForEach(IEnumerable1 items, Action1 action) +147 Umbraco.Web.Cache.MemberGroupCacheRefresher.Remove(Int32 id) +287 Umbraco.Core.Sync.DefaultServerMessenger.InvokeMethodOnRefresherInstance(ICacheRefresher refresher, MessageType dispatchType, IEnumerable1 ids, String jsonPayload) +603 Umbraco.Core.Sync.DefaultServerMessenger.MessageSeversForIdsOrJson(IEnumerable1 servers, ICacheRefresher refresher, MessageType dispatchType, IEnumerable1 ids, String jsonPayload) +590 Umbraco.Core.Sync.DefaultServerMessenger.PerformRemove(IEnumerable1 servers, ICacheRefresher refresher, Int32[] numericIds) +74 Umbraco.Web.Cache.DistributedCache.Remove(Guid factoryGuid, Int32 id) +219 Umbraco.Web.Cache.CacheRefresherEventHandler.MemberGroupService_Saved(IMemberGroupService sender, SaveEventArgs1 e) +191 Umbraco.Core.Events.TypedEventHandler2.Invoke(TSender sender, TEventArgs e) +0 Umbraco.Core.Persistence.Repositories.MemberGroupRepository.CreateIfNotExists(String roleName) +834 Umbraco.Core.Services.MemberService.AddRole(String roleName) +98 System.Web.Security.Roles.CreateRole(String roleName) +335 umbraco.MemberGroupTasks.PerformSave() +21 Umbraco.Web.UI.LegacyDialogHandler.Create(HttpContextBase httpContext, User umbracoUser, String nodeType, Int32 nodeId, String text, Int32 typeId) +100 umbraco.cms.presentation.create.controls.simple.sbmt_Click(Object sender, EventArgs e) +386 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +154 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3803

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34009

Comments

Shannon Deminick 11 Mar 2014, 23:00:26

Can't replicate this. Seen this before with other objects which was due to old assemblies and the plugin manager not picking up the most recent plugins. Can you please ensure that you have copied over and replaced all of the correct 7.1 assemblies to your /bin ?

I will add some null checks though.


Sebastiaan Janssen 11 Mar 2014, 23:32:21

Not a YSOD in the latest build but a red warning say * object reference not set.

Build.bat, open in webmatrix, try to add a member group, definitely gives an error.


Shannon Deminick 12 Mar 2014, 03:18:56

Hrm, yup i can replicate on a new install, the strange part though is if you try again you don't get the error. Will investigate.


Shannon Deminick 12 Mar 2014, 04:07:11

Found the problem, the member group repo wasn't assigning the id from the db back to the entity itself (which then gets cached)


Priority: Normal

Type: Bug

State: Fixed

Assignee: Shannon Deminick

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions: 7.1.0

Due in version: 7.1.0

Sprint:

Story Points:

Cycle: