November Happy Hour will be moved to Thursday December 5th.

Error everytime we go to the Edit Page view

Vote:
 

We get the following error everytime you open a page for Edit in our backend. We're completely stumped as to why!

We're on:

        <PackageReference Include="EPiServer.CMS" Version="12.31.2" />
        <PackageReference Include="EPiServer.CMS.AspNetCore" Version="12.22.0" />

But CAN NOT figure out why our middleware is crashing on page edit!

2024-11-07 14:47:40.307 [Error] [Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware] An unhandled exception has occurred while executing the request.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.InvalidOperationException: Lazy loaded property value is not supported by the current property instance
   at EPiServer.DataAccess.Internal.LazyPropertyValueLoader.SetValue(PropertyData property, PropertyDataRecord dataRecord, Func`3 valueConverter)
   at EPiServer.DataAccess.Internal.ContentDB.ReadPropertyData(PropertyData prop, DbDataReader reader, ContentReference contentLink, CultureInfo language)
   at EPiServer.DataAccess.Internal.ContentListDB.ReadCustomProperties(DbDataReader reader, Dictionary`2 allFetchedItems, Boolean isReadingVersions)
   at EPiServer.DataAccess.Internal.ContentListDB.ReadPublishedList(DbCommand cmd)
   at EPiServer.Data.Providers.Internal.SqlDatabaseExecutor.<>c__DisplayClass26_0`1.<Execute>b__0()
   at EPiServer.Data.Providers.SqlTransientErrorsRetryPolicy.Execute[TResult](Func`1 method)
   at EPiServer.DataAccess.Internal.ContentListDB.LoadSpecificContentInstances(IList`1 contentLinks, Int32 languageBranchID)
   at EPiServer.Core.Internal.DefaultContentProvider.BatchLoad(IList`1 contentLinks, Func`2 dbLoader)
   at EPiServer.Core.Internal.DefaultContentProvider.LoadContents(IList`1 contentReferences, ILanguageSelector selector)
   at EPiServer.Core.ContentProvider.GetContentBatch(IList`1 batch, ILanguageSelector selector, List`1& contents, Dictionary`2& contentMap)
   at EPiServer.Core.ContentProvider.GetScatteredContents(IEnumerable`1 contentLinks, ILanguageSelector selector)
   at EPiServer.Core.Internal.ProviderPipelineImplementation.GetItems(ContentProvider provider, IList`1 contentLinks, LoaderOptions loaderOptions)
   at EPiServer.Core.Internal.DefaultContentLoader.GetChildren[T](ContentReference contentLink, LoaderOptions loaderOptions, Int32 startIndex, Int32 maxRows)
   at EPiServer.Core.Internal.DefaultContentLoader.GetChildren[T](ContentReference contentLink, LoaderOptions loaderOptions)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Span`1& arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at EPiServer.Cms.Shell.UI.Rest.ContentQuery.ContentQueryBase.GetChildrenByType(Type type, ContentReference parentLink, ILanguageSelector selector)
   at EPiServer.Cms.Shell.UI.Rest.ContentQuery.GetChildrenQuery.<>c__DisplayClass12_0.<GetChildren>b__0(ContentTypeRecord type)
   at System.Linq.Enumerable.SelectManySingleSelectorIterator`2.MoveNext()
   at System.Linq.Enumerable.DistinctIterator`1.MoveNext()
   at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)
   at EPiServer.Cms.Shell.UI.Rest.ContentQuery.GetChildrenQuery.GetContent(ContentQueryParameters parameters)
   at EPiServer.Cms.Shell.UI.Rest.ContentQuery.ContentQueryBase.ExecuteQuery(IQueryParameters parameters)
   at EPiServer.Cms.Shell.UI.Rest.ContentQuery.Internal.GetPagedChildrenQuery.ExecuteQuery(IQueryParameters parameters)
   at EPiServer.Cms.Shell.UI.Rest.Internal.ContentStore.Get(ContentReference id, String query, ContentReference referenceId, ContentReference[] references, String[] typeIdentifiers, Nullable`1 allLanguages, String propertyName, ContentReference ownerContentLink, IEnumerable`1 sortColumns, ContentReference selectedContentReference, ItemRange range)
   at lambda_method1259(Closure , Object , Object[] )
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync()
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at SixLabors.ImageSharp.Web.Middleware.ImageSharpMiddleware.Invoke(HttpContext httpContext, Boolean retry)
   at Microsoft.AspNetCore.Authorization.Policy.AuthorizationMiddlewareResultHandler.HandleAsync(RequestDelegate next, HttpContext context, AuthorizationPolicy policy, PolicyAuthorizationResult authorizeResult)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at React.AspNet.BabelFileMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.StatusCodePagesMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

#332542
Nov 07, 2024 19:51
Vote:
 

Send this to Optimizely Support. But please, reply on this thread when you figure it out, thank you! 

#332663
Nov 10, 2024 20:40
Vote:
 

it seems there is a problem with your content type. do you have a property which is very long in value?

#332701
Nov 11, 2024 14:27
Vote:
 

Hey all, OP here, yeah we think we've tracked it down to a pretty COMMON Opti/Epi issue around the "LongString" property type.

Basically, we have a collection property on our base page content type to hold the Meta Keywords we want to attach to the HTML for SEO. Epi/Opti has a Lazyload setting that says to well, lazy load anything past X size. LongString doesn't have a lazy load method in Entity framework... so BOOM, every time you open a page in edit and it tries to get that collection property ready, crash out. 

A quick lazyload = 0 in the app settings seems to have fixed us up there, no more error in our logs. BUT, there was a bigger problem we were chasing. Something about something in our setup causes the Properties Editor page on CERTAIN Page Types to go haywire. 

What happens to us, especailly after restart or deployment is that certain page types both will NOT create and will not allow the property editor page panel to be shown. When you go to one of these pages in the backend and the problem is happening, you get a blank grey screen where the properties should all be. You get no error in the browser and no error on the server logs, it's like something just causes Opti to be NOT ABLE to complete loading the properties so it stops. The page editor pane works fine, but NOT the page properties.

Our uses HATE it, they complain the minute they see it and really get nasty because they can't do their jobs. We've been unable to find a solution other than a restart which works about 75% of the time, if not we restart again and something takes after a few.

We've presented it to Opti Support, but it's a DEEP thing. It's something that our partner devs built into our sytem and they are LONG GONE. The worst part is that we get no error, nothing that we can track and say, oh yeah that's were it all went wrong.

Opti Support did their best, but you'd have to spend days on it to REALLY figure it out. You'd need a full copy of our env to run local, etc etc and they so far haven't felt like they want to devote that time. We get it, we feel the same way more or less.

It was REALLY bad and happening in our Pre-prod last week, hence the message I posted about the stacktrace. It's better now.

#332702
Nov 11, 2024 14:40
* 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.