Received an error from the server when in Info tab in Content
I'm working on an 7.15.0 Umbraco site and for some Content, whenever I click on the Info, I got an error like this:
Here is the stacktrace:
at System.Collections.Generic.Dictionary2.get_Item(TKey key)
at Umbraco.Web.Editors.LogController.MapAvatarsAndNames(IEnumerable1 items)
at Umbraco.Web.Editors.LogController.GetPagedEntityLog(Int32 id, Int32 pageNumber, Int32 pageSize, Direction orderDirection, Nullable1 sinceDate)
at lambda_method(Closure , Object , Object[] )
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass6_2.<GetExecutor>b__2(Object instance, Object[] methodParameters)
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary2 arguments, CancellationToken cancellationToken)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Controllers.ApiControllerActionInvoker.
Looks like a problem on the Info tab, as here for a content item, the audit history of activities for the page is displayed, eg 'saved' 'published' etc
If you notice on a page that's working ok, each audit entry has a little avatar next to it for the person who performed the action.
The error your seeing is being thrown in 'MapAvatarsAndNames'...
So I reckon there is a user in your backoffice who has interacted with the page in the past, and either has been deleted or somehow has a mucked up avatar..
I think that's possible. I check the users tab and see some users are disabled. I enabled them but the error is still there. The avatars are default (just initials for their names) so I think maybe some users are deleted and cause the error?
If so is there a way to fix the error or maybe just show the audit history from other users?
Hi Ryan, please check the document type or User Name, it seems document-Type/ User Name for that particular node is deleted... Or can you update the log file here...??
One way to debug this is to try and see which Users have interacted with this content item (and so are 'in the audit log'). You could do this via SQL, or also in code.
If you look at the implementation of GetPagedEntityLog where the error is occurring:
and hopefully locate which audit entry doesn't have a user or has a user that has been deleted.
Then it will be a case of either removing the audit log entry, fixing the user's avatar, or reinstating the deleted User , or updating the audit log entries for the deleted user to be assigned to a new user (probalby via SQL)
Received an error from the server when in Info tab in Content
I'm working on an 7.15.0 Umbraco site and for some Content, whenever I click on the Info, I got an error like this:
Here is the stacktrace: at System.Collections.Generic.Dictionary
2.get_Item(TKey key) at Umbraco.Web.Editors.LogController.MapAvatarsAndNames(IEnumerable
1 items) at Umbraco.Web.Editors.LogController.GetPagedEntityLog(Int32 id, Int32 pageNumber, Int32 pageSize, Direction orderDirection, Nullable1 sinceDate) at lambda_method(Closure , Object , Object[] ) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass6_2.<GetExecutor>b__2(Object instance, Object[] methodParameters) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary
2 arguments, CancellationToken cancellationToken) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Controllers.ApiControllerActionInvoker.I open devtool to check the console and got this: Failed to load resource: the server responded with a status of 500 (Internal Server Error) http://localhost:63417/umbraco/backoffice/UmbracoApi/Log/GetPagedEntityLog?pageSize=10&pageNumber=1&orderDirection=Descending&id=9589
I'm really confused because the content sites are similar but only some got this error.
Hi Ryan
Looks like a problem on the Info tab, as here for a content item, the audit history of activities for the page is displayed, eg 'saved' 'published' etc
If you notice on a page that's working ok, each audit entry has a little avatar next to it for the person who performed the action.
The error your seeing is being thrown in 'MapAvatarsAndNames'...
https://github.com/umbraco/Umbraco-CMS/blob/v7/dev/src/Umbraco.Web/Editors/LogController.cs#L86
So I reckon there is a user in your backoffice who has interacted with the page in the past, and either has been deleted or somehow has a mucked up avatar..
does that sound possible?
regards
Marc
.
Hi Marc,
I think that's possible. I check the users tab and see some users are disabled. I enabled them but the error is still there. The avatars are default (just initials for their names) so I think maybe some users are deleted and cause the error? If so is there a way to fix the error or maybe just show the audit history from other users?
Thank you!
Hi Ryan, please check the document type or User Name, it seems document-Type/ User Name for that particular node is deleted... Or can you update the log file here...??
Thanks, Shekhar
Hi Ryan
One way to debug this is to try and see which Users have interacted with this content item (and so are 'in the audit log'). You could do this via SQL, or also in code.
If you look at the implementation of GetPagedEntityLog where the error is occurring:
https://github.com/umbraco/Umbraco-CMS/blob/d428a4543f33bb7094cf7db5f6b6fdc2d1de3063/src/Umbraco.Web/Editors/LogController.cs#L33
You can see the lines that retrieves the audit information:
You can get the id of the umbraco item that is failing to load the audit trail (from the querystring, or from info tab)
And then run this code with a breakpoint on it or 'just' write out each item in 'mapped' to 'see' which users are being returned,
then you could even create a version of MappedAvatarsAndNames for each audit log item... to see where the error is occuring:
https://github.com/umbraco/Umbraco-CMS/blob/d428a4543f33bb7094cf7db5f6b6fdc2d1de3063/src/Umbraco.Web/Editors/LogController.cs#L73
and hopefully locate which audit entry doesn't have a user or has a user that has been deleted.
Then it will be a case of either removing the audit log entry, fixing the user's avatar, or reinstating the deleted User , or updating the audit log entries for the deleted user to be assigned to a new user (probalby via SQL)
regards
marc
is working on a reply...