skybrud / Skybrud.Umbraco.Redirects

Redirects manager for Umbraco.
https://packages.limbo.works/skybrud.umbraco.redirects/
MIT License
38 stars 41 forks source link

Loading a type of node on our website throws errors in the backoffice #199

Closed smarshallsay closed 6 months ago

smarshallsay commented 6 months ago

Which version of Skybrud Redirects are you using? (Please write the exact version, example: 4.0.8)

13.0.0

Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)

13.0.3

Bug description

Hi, Thanks for your work :) We have been using SkyBrud Redirects 13.0.0 but I have found that upgrading to SR 13.0.1+ causes errors on certain nodes. The node I have been testing against does not even have any redirects set against it. The error is listed below. Even removing Skybrud Redirects from the solution does not fix the error and I need to restore an older version of the database if SR 13.0.1+ has been installed. Downgrading to 13.0.0 does not fix the error, I need to downgrade to 13.0.0 and then reinstate an unaltered DB and then all is fine. In case it is relevant, the site in question is in multiple languages but only the English language version of the node I'm testing against is published.

I can see that the only change to 13.0.1 is to src/Skybrud.Umbraco.Redirects/wwwroot/Scripts/Controllers/Dashboards/Default.js so I am a little confused as to what the error is all about.

Received an error from the server An error occurred Value cannot be null. (Parameter 'key') Exception Details System.ArgumentNullException, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e: Value cannot be null. (Parameter 'key')

at System.Collections.Generic.Dictionary`2.FindValue(TKey key)
   at System.Collections.Generic.Dictionary`2.TryGetValue(TKey key, TValue& value)
   at Umbraco.Cms.Core.PropertyEditors.NestedContentPropertyEditor.NestedContentValues.GetElementType(NestedContentRowValue item)
   at Umbraco.Cms.Core.PropertyEditors.NestedContentPropertyEditor.NestedContentValues.GetPropertyValues(Object propertyValue)
   at Umbraco.Cms.Core.PropertyEditors.NestedContentPropertyEditor.NestedContentPropertyValueEditor.ToEditor(IProperty property, String culture, String segment)
   at Umbraco.Cms.Core.PropertyEditors.NestedContentPropertyEditor.NestedContentPropertyValueEditor.ToEditor(IProperty property, String culture, String segment)
   at Umbraco.Cms.Core.Models.Mapping.ContentPropertyBasicMapper`1.Map(IProperty property, TDestination dest, MapperContext context)
   at Umbraco.Cms.Core.Models.Mapping.ContentPropertyDisplayMapper.Map(IProperty originalProp, ContentPropertyDisplay dest, MapperContext context)
   at Umbraco.Cms.Core.Models.Mapping.ContentPropertyMapDefinition.Map(IProperty source, ContentPropertyDisplay target, MapperContext context)
   at Umbraco.Cms.Core.Mapping.UmbracoMapper.<>c__DisplayClass11_0`2.<Define>b__1(Object source, Object target, MapperContext context)
   at Umbraco.Cms.Core.Mapping.UmbracoMapper.Map[TTarget](Object source, Type sourceType, MapperContext context)
   at Umbraco.Cms.Core.Mapping.UmbracoMapper.Map[TSource,TTarget](TSource source, MapperContext context)
   at Umbraco.Cms.Core.Mapping.MapperContext.Map[TSource,TTarget](TSource source)
   at System.Linq.Enumerable.SelectIPartitionIterator`2.MoveNext()
   at System.Linq.Enumerable.WhereEnumerableIterator`1.ToList()
   at Umbraco.Cms.Core.Mapping.MapperContext.MapEnumerable[TSourceElement,TTargetElement](IEnumerable`1 source)
   at Umbraco.Cms.Core.Models.Mapping.TabsAndPropertiesMapper.MapProperties(IContentBase content, List`1 properties, MapperContext context)
   at Umbraco.Cms.Core.Models.Mapping.TabsAndPropertiesMapper`1.Map(TSource source, MapperContext context)
   at Umbraco.Cms.Web.BackOffice.Mapping.ContentMapDefinition.Map(IContent source, ContentVariantDisplay target, MapperContext context)
   at Umbraco.Cms.Web.BackOffice.Mapping.ContentMapDefinition.Map(IContent source, ContentVariantScheduleDisplay target, MapperContext context)
   at Umbraco.Cms.Core.Mapping.UmbracoMapper.<>c__DisplayClass11_0`2.<Define>b__1(Object source, Object target, MapperContext context)
   at Umbraco.Cms.Core.Mapping.UmbracoMapper.Map[TTarget](Object source, Type sourceType, MapperContext context)
   at Umbraco.Cms.Core.Mapping.UmbracoMapper.Map[TTarget](Object source, MapperContext context)
   at Umbraco.Cms.Core.Mapping.MapperContext.Map[TTarget](Object source)
   at Umbraco.Cms.Core.Models.Mapping.ContentVariantMapper.CreateVariantDisplay[TVariant](MapperContext context, IContent content, Language language, String segment)
   at Umbraco.Cms.Core.Models.Mapping.ContentVariantMapper.<>c__DisplayClass9_0`1.<Map>b__0(Language language)
   at System.Linq.Enumerable.SelectListIterator`2.MoveNext()
   at System.Linq.Enumerable.WhereEnumerableIterator`1.ToList()
   at Umbraco.Cms.Core.Models.Mapping.ContentVariantMapper.Map[TVariant](IContent source, MapperContext context)
   at Umbraco.Cms.Web.BackOffice.Mapping.ContentMapDefinition.Map[TVariant](IContent source, ContentItemDisplay`1 target, MapperContext context)
   at Umbraco.Cms.Core.Mapping.UmbracoMapper.<>c__DisplayClass11_0`2.<Define>b__1(Object source, Object target, MapperContext context)
   at Umbraco.Cms.Core.Mapping.UmbracoMapper.Map[TTarget](Object source, Type sourceType, MapperContext context)
   at Umbraco.Cms.Core.Mapping.UmbracoMapper.Map[TTarget](Object source, MapperContext context)
   at Umbraco.Cms.Core.Mapping.UmbracoMapper.Map[TTarget](Object source, Action`1 f)
   at Umbraco.Cms.Web.BackOffice.Controllers.ContentController.MapToDisplayWithSchedule(IContent content)
   at Umbraco.Cms.Web.BackOffice.Controllers.ContentController.GetById(Int32 id)
   at lambda_method3407(Closure, Object, Object[])
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncObjectResultExecutor.Execute(ActionContext actionContext, 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.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
smarshallsay commented 6 months ago

I've also just tried upgrading Umbraco to a version newer than 13.0.3 just to rule it out but I still receive the error.

abjerner commented 6 months ago

Hi @smarshallsay

According to the stack trace, the exception occurs in some logic related to Umbraco's Nested Content property editor. There is nothing in the stack trace mentioning Skybrud Redirects.

Can you share how you're presented with the error? And if you using Network Tools or similar in your browser, can you see if any specific API call fails?

smarshallsay commented 6 months ago

/umbraco/backoffice/umbracoapi/content/GetById?id=5859 500 (Internal Server Error)

Presented in a popup when I try to load the node:

image

smarshallsay commented 6 months ago

Good point on the nested content, maybe I'm just seeing a symptom and it's nothing to do with your plugin. Thanks for your help.

abjerner commented 6 months ago

From what I can remember, the package isn't making a call to that endpoint. But even if it did, the problem appears to be with Umbraco it self.