Not able to open the left tree which lists pages

Not able to open the left tree which lists pages. I couldn’t find any error from event log/console
But I’m able to reach pages through sub pages option while in edit mode

tree
Litium version: 7.0.2

I’m dealing with the same thing, you should see the error in the network tab.

If you expand this you should see.

{"message":"An error has occurred.","exceptionMessage":"Error mapping types.\r\n\r\nMapping types:\r\nPage -> PageTreeViewModel\r\nLitium.Websites.Page -> Litium.Web.Administration.WebApi.Websites.ViewModels.PageTreeViewModel\r\n\r\nType Map configuration:\r\nPage -> PageTreeViewModel\r\nLitium.Websites.Page -> Litium.Web.Administration.WebApi.Websites.ViewModels.PageTreeViewModel\r\n\r\nProperty:\r\nHasChildren","exceptionType":"AutoMapper.AutoMapperMappingException","stackTrace":" at lambda_method(Closure , Page , PageTreeViewModel , ResolutionContext )\r\n at lambda_method(Closure , Object , Object , ResolutionContext )\r\n at Litium.Runtime.AutoMapper.AutoMapperExtensions.MapTo[TResult](Object source)\r\n at Litium.Web.Administration.WebApi.Websites.Controllers.PageController.<>c.<GetPageModelList>b__34_3(Page c)\r\n at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext()\r\n at System.Linq.Enumerable.d__591.MoveNext()\r\n at System.Collections.Generic.List1…ctor(IEnumerable1 collection)\r\n at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source)\r\n at Litium.Web.Administration.WebApi.Websites.Controllers.PageController.Treeview(Guid systemId, Boolean includeContainer, Boolean sort)\r\n at lambda_method(Closure , Object , Object[] )\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass6_2.b__2(Object instance, Object[] methodParameters)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary2 arguments, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Tracing.ITraceWriterExtensions.<TraceBeginEndAsyncCore>d__171.MoveNext()\r\n— End of stack trace from previous location where exception was thrown —\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ApiControllerActionInvoker.d__1.MoveNext()\r\n— End of stack trace from previous location where exception was thrown —\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Tracing.ITraceWriterExtensions.d__171.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__3.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__3.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__3.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__6.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__6.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Tracing.Tracers.HttpControllerTracer.<ExecuteAsyncCore>d__10.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Tracing.ITraceWriterExtensions.<TraceBeginEndAsyncCore>d__171.MoveNext()\r\n— End of stack trace from previous location where exception was thrown —\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Dispatcher.HttpControllerDispatcher.d__15.MoveNext()",“innerException”:{"$type":“System.Web.Http.HttpError, System.Web.Http”,“message”:“An error has occurred.”,“exceptionMessage”:“Error mapping types.\r\n\r\nMapping types:\r\nPageEntity -> Page\r\nLitium.Application.Websites.Data.PageEntity -> Litium.Websites.Page\r\n\r\nType Map configuration:\r\nPageEntity -> Page\r\nLitium.Application.Websites.Data.PageEntity -> Litium.Websites.Page\r\n\r\nProperty:\r\nItem”,“exceptionType”:“AutoMapper.AutoMapperMappingException”,“stackTrace”:" at lambda_method(Closure , PageEntity , Page , ResolutionContext )\r\n at lambda_method(Closure , Object , Object , ResolutionContext )\r\n at Litium.Application.Caching.CacheLoader.<>c__DisplayClass4_13.<LoadByPrimaryKey>b__1(TValueEntity x)\r\n at System.Linq.Enumerable.WhereSelectListIterator2.MoveNext()\r\n at System.Collections.Generic.List1..ctor(IEnumerable1 collection)\r\n at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source)\r\n at Litium.Application.Caching.CacheLoader.<>c__DisplayClass4_03.b__0(LitiumDbContext db)\r\n at Litium.Application.Data.DbContextExtension.ExecuteInDbContext[T](IServiceProvider serviceProvider, Func2 loaderFunc)\r\n at Litium.Application.Caching.CacheLoader.LoadByPrimaryKey[TKey,TValue,TValueEntity](IEnumerable1 keys, Expression1 keyEntityProperty)\r\n at Litium.Application.Caching.EntityCache2.TryLoadItems(IEnumerable1 keys)\r\n at Litium.Application.Caching.EntityCache2.Get(IEnumerable1 key)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at lambda_method(Closure , Exception )\r\n at Litium.Application.Runtime.ExceptionEnlightenment.PrepareForRethrow(Exception exception)\r\n at Litium.Application.Runtime.ExceptionHelpers.PrepareForRethrow(Exception exception)\r\n at Litium.Application.Caching.EntityCache2.LoadableCacheItem.SetException(Exception exception)\r\n at Litium.Application.Caching.EntityCache2.Get(IEnumerable1 key)\r\n at Litium.Application.Caching.EntityReferenceCacheImpl3.Get(TKey key)\r\n at Litium.Application.Websites.PageServiceImpl.GetChildPages(Guid parentPageSystemId, Nullable1 websiteSystemId)\r\n at Litium.Web.Administration.WebApi.Websites.ViewModels.PageTreeViewModel.HasChildrenAvailableResolver.Resolve(Page page, PageTreeViewModel pageModel, Boolean destMember, ResolutionContext context)\r\n at lambda_method(Closure , Page , PageTreeViewModel , ResolutionContext )",“innerException”:{"$type":“System.Web.Http.HttpError, System.Web.Http”,“message”:“An error has occurred.”,“exceptionMessage”:“Field with name ‘ErrorMessage’ does not match any field definition in area ‘WebsiteArea’.”,“exceptionType”:“Litium.FieldFramework.FieldFrameworkException”,“stackTrace”:" at Litium.Application.AutoMapper.ValueResolvers.FieldDataToFieldDataContainerItemValueReolver4.Resolve(TDataEntity source, T destination, ICollection1 sourceMember, FieldContainer destMember, ResolutionContext context)\r\n at lambda_method(Closure , PageEntity , Page , ResolutionContext )"}}}`

To be able to help out and debug the issue you have to open a support case with support@litium.com where you provide link to where we can get access to your code and a database backup.

1 Like

I fixed my code, don’t know exactly how :slight_smile:
Thanks!

I have been able to find an bug (44891) during the execution of the migration script. The error is because of property names with - not is migrated correctly.

To fix this in your upgraded database you can run the following sql command.

UPDATE
	Sites.PageFieldData 
SET 
	FieldDefinitionId = Replace(Replace(FieldDefinitionId, '-', ''), ' ', '_'), 
	ChildOwnerId = Replace(Replace(ChildOwnerId, '-', ''), ' ', '_')
WHERE
	FieldDefinitionId LIKE '%-%' 
	OR ChildOwnerId LIKE '%-%';

If you want to validate if it exists some other fields that have wrong name you can use the following script that will print them out

SELECT FD.*
FROM Sites.PageFieldData FD
LEFT JOIN FieldFramework.FieldDefinition F ON F.Id = FD.FieldDefinitionId
LEFT JOIN FieldFramework.FieldDefinition F2 ON F2.Id = FD.ChildOwnerId
WHERE
	(F.Id IS NULL OR (FD.ChildOwnerId <> '' AND F2.Id IS NULL))
	AND NOT SUBSTRING(FD.FieldDefinitionId, 1, 1) = '_'
1 Like

Another part that can be an issue in solutions is when the same package is used in different versions in the installation. You will easy find them in the NuGet - Solution view in the below tab.
image

If you go into settings \ system settings \ web log and you will see a nice error message.

The query updated no rows. Consolidate update didn’t fixed as well

If you go into this view, what is that saying?

settings \ system settings \ web log

Do you get any rows back with the select-command?

SELECT FD.*
FROM Sites.PageFieldData FD
LEFT JOIN FieldFramework.FieldDefinition F ON F.Id = FD.FieldDefinitionId
LEFT JOIN FieldFramework.FieldDefinition F2 ON F2.Id = FD.ChildOwnerId
WHERE
	(F.Id IS NULL OR (FD.ChildOwnerId <> '' AND F2.Id IS NULL))
	AND NOT SUBSTRING(FD.FieldDefinitionId, 1, 1) = '_'

It doesn’t return any rows. I checked event log as well, as soon i clicked on tree node. But couldn’t find anything there as well. But got the below error from console


The first error is fine, its due to a code issue while previewing page.
The second error says net::ERR_CONNECTION_RESET

What’s the weblog-saying?

The database that you provided in the support ticket is working with your code after I run the above SQL script. So little hard to get advise about whats wrong.

I did an upgrade on fresh DB, and executed the update query that you send above.
Now it works fine.
I guess, some weird thing happened to old DB, while I tried to upgrade it (May be while renaming field definition)