System.ArgumentNullException 500 error response from /EPiServer/cms/Stores/contentdata

Vote:
 

Working on an upgrade... The CMS 11 version before upgrading DB doesn't show this error.

When I load it shows in Dev Tools network tab and also try to publish a page this error is shown in a lightbox/dialog.

The API endpoint works for other IDs so something is wrong with my ID 6 but I haven't been able circle it in further.

I think the endpoint runs the query exec netContentDataLoad @ContentID=6,@LanguageBranchID=1 and that one doesn't seem fail on anything.

Anyone been snooping around something similar and have some suggestions?

The URL /EPiServer/cms/Stores/contentdata/6_80701 gives:

System.ArgumentNullException: Value cannot be null. (Parameter 'value')
   at EPiServer.Validation.DataAnnotationsValidator`1.ValidateInstance(Object instance, List`1 validationResult, ValidationContext validationContext)
   at EPiServer.Validation.DataAnnotationsValidator`1.ValidateInstance(Object instance, List`1 validationResult, ValidationContext validationContext)
   at EPiServer.Validation.DataAnnotationsValidator`1.Validate(T instance)
   at EPiServer.Validation.Internal.ContextValidatorWrapper`2.Validate(Object instance)
   at EPiServer.Validation.Internal.ValidationService.ValidateRecursively(Object instance, Object context, HashSet`1 visitedInstances)
   at EPiServer.Validation.Internal.ValidationService.Validate(Object instance)
   at EPiServer.Cms.Shell.UI.Rest.Internal.ContentDataStore.<>c__DisplayClass20_1.<Validate>b__1(IValidationService x)
   at System.Linq.Enumerable.SelectManySingleSelectorIterator`2.MoveNext()
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.ToList()
   at EPiServer.Cms.Shell.UI.Rest.Internal.ContentDataStore.<>c__DisplayClass20_0.<Validate>b__0(IContent content)
   at EPiServer.Cms.Shell.UI.Rest.Internal.RestStatusUtil.ExecuteWithSecurityCheck[T](ContentReference contentLink, IContentLoader contentLoader, AccessLevel accessLevel, Func`2 func)
   at EPiServer.Cms.Shell.UI.Rest.Internal.ContentDataStore.Validate(ContentReference id, ValidationFilering filter)
   at lambda_method687(Closure, Object, Object[])
#338194
May 16, 2025 13:04
Vote:
 

Looks like your page at ID 6 has content in one of its properties that can not be correctly loaded or cast.

I would probably set a breakpoint on the internal code, to see which property that has instance being null. Rider and Resharper are good at that.

#338313
May 18, 2025 20:12
Vote:
 

As suggested by Stefan I used Rider and noticed DisplayNames coming in as "" causing the ArgumentNullException being thrown.

For some reason an IList complex object got their [Display(Name = "/somepath/in/xml")] localized label returning an empty string.

#338423
May 20, 2025 10:49
* 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.