volume_up

A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More. 

volume_up

A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More. 

Episerver Error - Sequence contains no matching element

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.


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

#174343
Jan 24, 2017 18:41

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

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

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.