Exception when updating CustomerContact after upgrade to Commercer 11.8.3

Member since: 2004
 

Hi!

After upgrade to 11.8.3 we get an exception when trying to update a customer contact.

//Change adress information and then update
BusinessManager.Update(customerAddress);

//Save customer Contact changes
currentContact.SaveChanges();

We now get this exception:

Invalid validators:
[0] Field 'CustomerGroup' has a wrong enum id '1'.
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: Mediachase.BusinessFoundation.Data.Meta.MetaObjectValidationException: Invalid validators:
[0] Field 'CustomerGroup' has a wrong enum id '1'.


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: 


[MetaObjectValidationException: Invalid validators:
[0] Field 'CustomerGroup' has a wrong enum id '1'.
]
   Mediachase.BusinessFoundation.Data.Meta.MetaObject.OnSaving() +425
   Mediachase.BusinessFoundation.Data.Meta.MetaObject.Save(Boolean forceSave) +71
   Mediachase.BusinessFoundation.Data.Meta.MetaObject.Save() +49
   Mediachase.BusinessFoundation.Data.Business.EntityObjectDefaultRequestHandler.Update(BusinessContext context) +636
   Mediachase.BusinessFoundation.Data.Business.EntityObjectDefaultRequestHandler.Execute(BusinessContext context) +744
   Mediachase.BusinessFoundation.Data.Business.BaseRequestHandler.Mediachase.BusinessFoundation.Data.Business.IRequestHandler.Execute(BusinessContext context) +55
   Mediachase.BusinessFoundation.Data.Business.BusinessManager.ExecutePipeline(IRequestHandler handler) +142
   Mediachase.BusinessFoundation.Data.Business.BusinessManager.ExecutePipelineInTransaction(IRequestHandler handler) +103
   Mediachase.BusinessFoundation.Data.Business.BusinessManager.Execute(Request request) +650
   Mediachase.BusinessFoundation.Data.Business.BusinessManager.Update(EntityObject target) +80
   Mediachase.Commerce.Customers.CustomerContact.SaveChanges() +1636
   Direktronik.Core.Controllers.Pages.CheckoutController.SaveShippingAddresses(CheckoutViewModel checkoutViewModel) in Z:\ProgramData\JetBrains\TeamCity\BuildAgent-Dev01-1\work\806cc4af7e390e00\Direktronik.Core\Controllers\Pages\CheckoutController.cs:892
   Direktronik.Core.Controllers.Pages.CheckoutController.Purchase(CheckoutPage currentPage, CheckoutViewModel checkoutViewModel, IPaymentMethodViewModel`1 paymentViewModel) in Z:\ProgramData\JetBrains\TeamCity\BuildAgent-Dev01-1\work\806cc4af7e390e00\Direktronik.Core\Controllers\Pages\CheckoutController.cs:826
   lambda_method(Closure , ControllerBase , Object[] ) +220
   System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +229
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +35
   System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState) +39
   System.Web.Mvc.Async.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult) +67
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +42
   System.Web.Mvc.Async.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d() +72
   System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +385
   System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +385
   System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +385
   System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +385
   System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +385
   System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +385
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +42
   System.Web.Mvc.Async.<>c__DisplayClass2b.<BeginInvokeAction>b__1c() +38
   System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) +185
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +38
   System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +29
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +65
   System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +52
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +36
   System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +38
   System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) +43
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +65
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +38
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +607
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +134

Any ideas?

Thanks!

/Kristoffer

#189695 Mar 23, 2018 8:18
  • Member since: 2016
     

    What does the customer your trying to save have as a CustomerGroup? Is it "Customer" perhaps?

    It seems to me like your table storing the metaenum fields might have gotten messed up.

    Running this query:

    SELECT *
    FROM [mcmd_MetaEnum]
    WHERE TypeName = 'ContactGroup'

    Do you see a row with the "Id" column set to 1 ?

    #189716 Edited, Mar 23, 2018 9:53
  • Member since: 2012
     

    Enter commerce manager and see which Contact Groups you have defined there.

    Then enter the CMS and create a new visitor group, drag in customer properties and choose customer group and see which groups are available in that drop down.

    Is there a difference?

    Does an iisreset solve the problem?

    We got this same error in production when an administrator had created a new customer group and set it on a customer.

    Everytime we tried to update that customer it would fail in validation.

    My investigation lead me to believe that the CMS has a cache used for the vallidation (and visitor groups etcetera) but changes in commerce manager didn't invalidate the cache. Furthermore there didn't seem to be a timeout that ejected the cache either, the issue stayed with us for atleast a week until we made a deploy.

    The support has accepted it as a bug but it isn't public yet:

    https://world.episerver.com/support/Bug-list/bug/COM-6776

    #189741 Mar 23, 2018 13:08
  • Member since: 2011
     

    Enter commerce manager and see which Contact Groups you have defined there.

    Then enter the CMS and create a new visitor group, drag in customer properties and choose customer group and see which groups are available in that drop down.

    Is there a difference?

    Does an iisreset solve the problem?

    We got this same error in production when an administrator had created a new customer group and set it on a customer.

    Everytime we tried to update that customer it would fail in validation.

    My investigation lead me to believe that the CMS has a cache used for the vallidation (and visitor groups etcetera) but changes in commerce manager didn't invalidate the cache. Furthermore there didn't seem to be a timeout that ejected the cache either, the issue stayed with us for atleast a week until we made a deploy.

    The support has accepted it as a bug but it isn't public yet:

    https://world.episerver.com/support/Bug-list/bug/COM-6776

    Didn't know it was you (who reported the bug). It is under review now. Was almost closed because it could be a major change. Luckily it's small enough to be included in Commerce 12.1 (likely)

    #189839 Edited, Mar 26, 2018 9:58
  • Member since: 2012
     

    Didn't know it was you (who reported the bug). It is under review now. Was almost closed because it could be a major change. Luckily it's small enough to be included in Commerce 12.1 (likely)

    That is quite alright. There are more important things for you to know than who reported which bug. wink

    I'm glad it wasn't closed then, having to tell our clients that they have to wait for a server reset before they can use new customer groups could prove embarrasing as well as an inconvenience. embarassed

    #189845 Mar 26, 2018 14:01
  • Member since: 2011
     

    Didn't know it was you (who reported the bug). It is under review now. Was almost closed because it could be a major change. Luckily it's small enough to be included in Commerce 12.1 (likely)

    That is quite alright. There are more important things for you to know than who reported which bug. wink

    I'm glad it wasn't closed then, having to tell our clients that they have to wait for a server reset before they can use new customer groups could prove embarrasing as well as an inconvenience. embarassed

    It's more of a way to start a conversation ;) . We treat bugs by their severity and their impact, as well as how would the fix look like (is it too big/too risky to worth the effort). The reporter would be in the bottom of the list - well, bugs reported by external sources will be given higher priority than bugs reported by QAs (given all other criteria are the same). Bugs reported by EMVPs get a slight boost in priority as well.

    #189846 Mar 26, 2018 14:06
  • Member since: 2011
     

    For future visitors: the bug COM-6776 has been fixed in Commerce 12.1.0. Cache validation has been added for Business Foundation MetaModel, to ensure it's correctly validated when you update the models in Commerce Manager. As always we recommend to upgrade to latest version. 

    #192087 May 06, 2018 21:08
  • Member since: 2012
     

    Thanks Quan, but is it really necessary to keep it hidden until after it is "Closed, Fixed and tested"?

    Not being able to refer people on the forum to a registered bug before it is fixed and about to be released is something of a bother and hampers communication.

    #192103 May 07, 2018 15:24
  • Member since: 2011
     

    Not really. We tend to make the bug public as soon as possible, but that needs some cleanups - i.e. sensitive information must be removed, grammar errors and typos must be corrected. Someone (and sometimes, two people) needs to review all that, of course, so that takes time. 

    #192104 Edited, May 07, 2018 15:33
  • Member since: 2012
     

    Maybe not the review part but the sensitive information, grammar, typos could customer support fix before they close the issue?

    I mean the large gap in time from the issue gets closed to the bug becoming public is a period where i have no way of following the progress (and starts pestering customer support about updates innocent).

    #192108 May 07, 2018 16:16
  • Member since: 2011
     

    Go for it - I mean you can always poke support for status update and they will push us for making it public. Yes it might not sound like the best way to do thing, but our process is to do a review of work items before creating the public release (someone from development team will review technical information and someone from documentation team will review anything else). The reason: doing things in batch is always faster - less interuption and less context switch. Unless the bug is needed then we leave it there.

    You can always tell support to make the bug public when you report it - btw. We will take care of such request on triage process.

    EDIT: I think I can ask my team to try to make a bug public on triage if possible - if it comes from external sources. 

    #192109 Edited, May 07, 2018 17:01
First   1 2 3 4   Last