Episerver Error - Sequence contains no matching element

Vote:
 

Hi Everyone,
I'm getting an error for some reason when I load any of my categories on either catalog ui, or commerce manager.

In commerce manager when I load up the categories I get the error..

Exception Details: System.InvalidOperationException: Sequence contains no matching element

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:

[InvalidOperationException: Sequence contains no matching element]
   System.Linq.Enumerable.Single(IEnumerable`1 source, Func`2 predicate) +539
   Mediachase.MetaDataPlus.Configurator.MetaObjectDB.LoadMetaObjectData(MetaDataContext context, Int32 metaObjectId, MetaClass metaClass, String fallbackLanguage) +2172
   Mediachase.MetaDataPlus.MetaObject.DoLoad(MetaDataContext context, Int32 objectId, MetaClass metaClass) +424
   Mediachase.Commerce.Manager.Core.MetaData.EditTab.GetMetaObjectsForBinding(MetaDataContext context, MetaClass metaClass, IEnumerable`1 languages, Int32 metaObjectId, String creatorId) +524
   Mediachase.Commerce.Manager.Core.MetaData.EditTab.DataBind() +393
   Mediachase.Commerce.Manager.Catalog.Tabs.NodeOverviewEditTab.BindMetaForm() +712
   System.Web.UI.Control.OnLoad(EventArgs e) +101
   System.Web.UI.Control.LoadRecursive() +154
   System.Web.UI.Control.LoadRecursive() +251
   System.Web.UI.Control.LoadRecursive() +251
   System.Web.UI.Control.LoadRecursive() +251
   System.Web.UI.Control.LoadRecursive() +251
   System.Web.UI.Control.LoadRecursive() +251
   System.Web.UI.Control.LoadRecursive() +251
   System.Web.UI.Control.LoadRecursive() +251
   System.Web.UI.Control.LoadRecursive() +251
   System.Web.UI.Control.LoadRecursive() +251
   System.Web.UI.Control.LoadRecursive() +251
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3868

In catalog ui, I just get a white screen however, when I open up dev tools and go to console, I see that I'm getting a 500 error while loading up a backend include.
The url for that is... /EPiServer/cms/Stores/contentdata/1073743626_344232_CatalogContent?dojo.preventCache=1423276404599

Here is my stacktrace for this error message...

Server Error in '/' Application.

Sequence contains no matching element

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.InvalidOperationException: Sequence contains no matching element

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:

[InvalidOperationException: Sequence contains no matching element]
   System.Linq.Enumerable.Single(IEnumerable`1 source, Func`2 predicate) +2691969
   Mediachase.MetaDataPlus.Configurator.MetaObjectDB.LoadMetaObjectData(MetaDataContext context, Int32 metaObjectId, MetaClass metaClass, String fallbackLanguage) +1357
   Mediachase.MetaDataPlus.MetaObject.DoLoad(MetaDataContext context, Int32 objectId, MetaClass metaClass) +331
   Mediachase.MetaDataPlus.MetaObject.Load(MetaDataContext context, Int32 objectId, Int32 metaClassId) +33
   Mediachase.Commerce.Catalog.Dto.CatalogNodeRowExtensions.IsPublished(CatalogNodeRow row, MetaDataContext context) +38
   EPiServer.Commerce.Catalog.Provider.Construction.NodeBuilder.ConstructNodes(IEnumerable`1 nodeRows, IDictionary`2 versionForUnpublishedContent, String language) +376
   EPiServer.Commerce.Catalog.Provider.Construction.NodeBuilder.Create(IList`1 contentLinks, String language) +556
   EPiServer.Commerce.Catalog.Provider.<>c__DisplayClass8.b__6(ICatalogContentBuilder builder, IList`1 links) +16
   EPiServer.Commerce.Catalog.Provider.CatalogContentLoader.ConstructContent(IList`1 contentLinks, Func`3 createContentFunc) +359
   EPiServer.Commerce.Catalog.Provider.CatalogContentLoader.LoadSpecificContentInstances(IList`1 contentLinks, String language) +458
   EPiServer.Commerce.Catalog.Provider.<>c__DisplayClass7.b__1(IList`1 refs) +44
   EPiServer.Commerce.Catalog.Provider.CatalogContentProvider.BatchLoad(IList`1 contentLinks, Func`2 dbLoader) +141
   EPiServer.Commerce.Catalog.Provider.CatalogContentProvider.LoadContents(IList`1 contentReferences, ILanguageSelector selector) +447
   EPiServer.Commerce.Catalog.Provider.CatalogContentProvider.LoadContent(ContentReference contentLink, ILanguageSelector languageSelector) +138
   EPiServer.Core.<>c__DisplayClass181_0.b__0() +72
   EPiServer.Core.OptimisticCache`1.Read(String cacheKey, ReadAndCacheObject`1 readAndCacheObject) +637
   EPiServer.Core.ContentProvider.LoadContentFromCacheOrRepository(ContentReference contentreference, ILanguageSelector selector) +580
   EPiServer.Core.ProviderPipelineImplementation.GetItem(ContentProvider provider, ContentReference contentLink, LoaderOptions loaderOptions) +247
   EPiServer.Core.DefaultContentLoader.TryGet(ContentReference contentLink, LoaderOptions loaderOptions, T& content) +259
   EPiServer.Core.DefaultContentLoader.Get(ContentReference contentLink, LoaderOptions loaderOptions) +73
   EPiServer.Core.DefaultContentRepository.Get(ContentReference contentLink, LoaderOptions loaderOptions) +66
   EPiServer.Cms.Shell.UI.Rest.Models.Transforms.<>c__DisplayClass2.b__1(CultureInfo l) +144
   System.Linq.WhereSelectEnumerableIterator`2.MoveNext() +164
   Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeList(JsonWriter writer, IEnumerable values, JsonArrayContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty) +475
   Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue(JsonWriter writer, Object value, JsonContract valueContract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerProperty) +332
   Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty) +340
   Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue(JsonWriter writer, Object value, JsonContract valueContract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerProperty) +260
   Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value, Type objectType) +220
   Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Object value, Type objectType) +824
   EPiServer.Framework.Serialization.Json.JsonObjectSerializer.Serialize(TextWriter textWriter, Object value) +51
   EPiServer.Shell.Services.Rest.RestResultBase.ExecuteResult(ControllerContext context) +222
   EPiServer.Shell.Services.Rest.RestResult.ExecuteResult(ControllerContext context) +18
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) +15
   System.Web.Mvc.<>c__DisplayClass1a.b__17() +23
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +242
   System.Web.Mvc.<>c__DisplayClass1c.b__19() +25
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +242
   System.Web.Mvc.<>c__DisplayClass1c.b__19() +25
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +242
   System.Web.Mvc.<>c__DisplayClass1c.b__19() +25
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +175
   System.Web.Mvc.Async.<>c__DisplayClass2a.b__20() +89
   System.Web.Mvc.Async.<>c__DisplayClass25.b__22(IAsyncResult asyncResult) +102
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +58
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +44
   EPiServer.Shell.Services.Rest.RestControllerBase.EndExecute(IAsyncResult asyncResult) +38
   EPiServer.Shell.Services.Rest.RestHttpHandler.EndProcessRequest(IAsyncResult result) +28
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9744373
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155


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

#174343
Jan 24, 2017 18:41
Vote:
 

Worth noting is we've imported these categories not that long ago using the commerce manager tools. We imported many other things and they mostly work fine, no issues editing or anything. Also we are having this issue on our qa server, while our dev server followed the same process and we had no issues.

#174344
Jan 24, 2017 18:42
Vote:
 

Start comparing the databases on dev and qa, something seem to be missing in your Meta class definitions.

in the commerce database look in these tables to start with:

dbo.MetaClass
dbo.MetaClassetaFieldRelation
dbo.MetaField

Which version of episerver commerce are you using?

#174395
Jan 25, 2017 15:04
Vote:
 

Which Version are you working on? 

Have you done any recent deployment on other enviornment? Has any new property been added in Meta class and probably, Meta Class is not updated.

Can you compare the Category Meta Class in both enviornments? Any difference?

Consider Language factor also.

Regards
/K

#174410
Jan 25, 2017 22:02
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.