System.ArgumentException: Could not find a datatype with identifier

I am trying to run Umbraco CMS 13.7.2 on docker via an unattended install. I seem to be able to successfully do the unattended install but in the Umbraco logs, I run into a fatal error about a datatype with identifier 1059 that does not exist in my datatype table or anywhere else I can see. The base image for Docker is using .Net 9 and Windows.

The error is:

{"@t":"2025-04-06T21:16:02.7014625Z","@mt":"Panic, exception while loading cache data.","@l":"Fatal","@x":"System.ArgumentException: Could not find a datatype with identifier 1059. (Parameter 'id')\n   at Umbraco.Cms.Core.Models.PublishedContent.PublishedContentTypeFactory.GetDataType(Int32 id)\n   at Umbraco.Cms.Core.Models.PublishedContent.PublishedPropertyType..ctor(String propertyTypeAlias, Int32 dataTypeId, Boolean isUserProperty, ContentVariation variations, PropertyValueConverterCollection propertyValueConverters, IPublishedModelFactory publishedModelFactory, IPublishedContentTypeFactory factory)\n   at Umbraco.Cms.Core.Models.PublishedContent.PublishedPropertyType..ctor(IPublishedContentType contentType, IPropertyType propertyType, PropertyValueConverterCollection propertyValueConverters, IPublishedModelFactory publishedModelFactory, IPublishedContentTypeFactory factory)\n   at Umbraco.Cms.Core.Models.PublishedContent.PublishedContentTypeFactory.CreatePropertyType(IPublishedContentType contentType, IPropertyType propertyType)\n   at Umbraco.Cms.Core.Models.PublishedContent.PublishedContentType.<>c__DisplayClass2_0.<.ctor>b__0(IPropertyType x)\n   at System.Linq.Enumerable.SelectEnumerableIterator`2.ToList()\n   at Umbraco.Cms.Core.Models.PublishedContent.PublishedContentType..ctor(IContentTypeComposition contentType, IPublishedContentTypeFactory factory)\n   at Umbraco.Cms.Core.Models.PublishedContent.PublishedContentTypeFactory.CreateContentType(IContentTypeComposition contentType)\n   at Umbraco.Cms.Infrastructure.PublishedCache.PublishedSnapshotService.<LoadContentFromDatabaseLocked>b__63_0(IContentType x)\n   at System.Linq.Enumerable.SelectListIterator`2.MoveNext()\n   at Umbraco.Cms.Infrastructure.PublishedCache.ContentStore.SetAllContentTypesLocked(IEnumerable`1 types)\n   at Umbraco.Cms.Infrastructure.PublishedCache.PublishedSnapshotService.LoadContentFromDatabaseLocked(Boolean onStartup)\n   at Umbraco.Cms.Infrastructure.PublishedCache.PublishedSnapshotService.<EnsureCaches>b__56_3()\n   at Umbraco.Cms.Infrastructure.PublishedCache.PublishedSnapshotService.LockAndLoadContent(Func`1 action)\n   at Umbraco.Cms.Infrastructure.PublishedCache.PublishedSnapshotService.<EnsureCaches>b__56_0()\n   at System.Threading.LazyInitializer.EnsureInitializedCore[T](T& target, Boolean& initialized, Object& syncLock, Func`1 valueFactory)\n   at System.Threading.LazyInitializer.EnsureInitialized[T](T& target, Boolean& initialized, Object& syncLock, Func`1 valueFactory)\n   at Umbraco.Cms.Infrastructure.PublishedCache.PublishedSnapshotService.EnsureCaches()\n   at Umbraco.Cms.Infrastructure.PublishedCache.PublishedSnapshotService.CreatePublishedSnapshot(String previewToken)\n   at Umbraco.Cms.Web.Common.UmbracoContext.UmbracoContext.<>c__DisplayClass11_0.<.ctor>b__0()\n   at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)","@tr":"da2fe8d580b870f4d718d3a0d43761d9","@sp":"d304f22bba36417d","SourceContext":"Umbraco.Cms.Infrastructure.PublishedCache.PublishedSnapshotService","RequestId":"0HNBLA0U38DMT:00000001","RequestPath":"/","ConnectionId":"0HNBLA0U38DMT","ProcessId":1,"ProcessName":"dotnet","ThreadId":27,"ApplicationId":"d2b6c12ab2d22552b3a7faee0509e6139f633afc","MachineName":"38223dcede91","Log4NetLevel":"FATAL","HttpRequestId":"54771600-553b-4301-95d6-07b5b16e6230","HttpRequestNumber":1,"HttpSessionId":"0"}
{"@t":"2025-04-06T21:16:02.7061249Z","@mt":"An unhandled exception has occurred while executing the request.","@l":"Error","@x":"System.ArgumentException: Could not find a datatype with identifier 1059. (Parameter 'id')\n   at Umbraco.Cms.Core.Models.PublishedContent.PublishedContentTypeFactory.GetDataType(Int32 id)\n   at Umbraco.Cms.Core.Models.PublishedContent.PublishedPropertyType..ctor(String propertyTypeAlias, Int32 dataTypeId, Boolean isUserProperty, ContentVariation variations, PropertyValueConverterCollection propertyValueConverters, IPublishedModelFactory publishedModelFactory, IPublishedContentTypeFactory factory)\n   at Umbraco.Cms.Core.Models.PublishedContent.PublishedPropertyType..ctor(IPublishedContentType contentType, IPropertyType propertyType, PropertyValueConverterCollection propertyValueConverters, IPublishedModelFactory publishedModelFactory, IPublishedContentTypeFactory factory)\n   at Umbraco.Cms.Core.Models.PublishedContent.PublishedContentTypeFactory.CreatePropertyType(IPublishedContentType contentType, IPropertyType propertyType)\n   at Umbraco.Cms.Core.Models.PublishedContent.PublishedContentType.<>c__DisplayClass2_0.<.ctor>b__0(IPropertyType x)\n   at System.Linq.Enumerable.SelectEnumerableIterator`2.ToList()\n   at Umbraco.Cms.Core.Models.PublishedContent.PublishedContentType..ctor(IContentTypeComposition contentType, IPublishedContentTypeFactory factory)\n   at Umbraco.Cms.Core.Models.PublishedContent.PublishedContentTypeFactory.CreateContentType(IContentTypeComposition contentType)\n   at Umbraco.Cms.Infrastructure.PublishedCache.PublishedSnapshotService.<LoadContentFromDatabaseLocked>b__63_0(IContentType x)\n   at System.Linq.Enumerable.SelectListIterator`2.MoveNext()\n   at Umbraco.Cms.Infrastructure.PublishedCache.ContentStore.SetAllContentTypesLocked(IEnumerable`1 types)\n   at Umbraco.Cms.Infrastructure.PublishedCache.PublishedSnapshotService.LoadContentFromDatabaseLocked(Boolean onStartup)\n   at Umbraco.Cms.Infrastructure.PublishedCache.PublishedSnapshotService.<EnsureCaches>b__56_3()\n   at Umbraco.Cms.Infrastructure.PublishedCache.PublishedSnapshotService.LockAndLoadContent(Func`1 action)\n   at Umbraco.Cms.Infrastructure.PublishedCache.PublishedSnapshotService.<EnsureCaches>b__56_0()\n   at System.Threading.LazyInitializer.EnsureInitializedCore[T](T& target, Boolean& initialized, Object& syncLock, Func`1 valueFactory)\n   at System.Threading.LazyInitializer.EnsureInitialized[T](T& target, Boolean& initialized, Object& syncLock, Func`1 valueFactory)\n   at Umbraco.Cms.Infrastructure.PublishedCache.PublishedSnapshotService.EnsureCaches()\n   at Umbraco.Cms.Infrastructure.PublishedCache.PublishedSnapshotService.CreatePublishedSnapshot(String previewToken)\n   at Umbraco.Cms.Web.Common.UmbracoContext.UmbracoContext.<>c__DisplayClass11_0.<.ctor>b__0()\n   at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)\n   at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)\n   at System.Lazy`1.CreateValue()\n   at Umbraco.Cms.Web.Common.UmbracoContext.UmbracoContext.get_PublishedSnapshot()\n   at Umbraco.Cms.Web.Common.UmbracoContext.UmbracoContext.get_Content()\n   at Umbraco.Cms.Web.Website.Routing.UmbracoRouteValueTransformer.TransformAsync(HttpContext httpContext, RouteValueDictionary values)\n   at Microsoft.AspNetCore.Mvc.Routing.DynamicControllerEndpointMatcherPolicy.ApplyAsync(HttpContext httpContext, CandidateSet candidates)\n   at Microsoft.AspNetCore.Routing.Matching.DfaMatcher.SelectEndpointWithPoliciesAsync(HttpContext httpContext, IEndpointSelectorPolicy[] policies, CandidateSet candidateSet)\n   at Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware.<Invoke>g__AwaitMatch|10_1(EndpointRoutingMiddleware middleware, HttpContext httpContext, Task matchTask)\n   at StackExchange.Profiling.MiniProfilerMiddleware.Invoke(HttpContext context) in C:\\projects\\dotnet\\src\\MiniProfiler.AspNetCore\\MiniProfilerMiddleware.cs:line 112\n   at Umbraco.Cms.Web.Common.Middleware.UmbracoRequestMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)\n   at Umbraco.Cms.Web.Common.Middleware.UmbracoRequestMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)\n   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<<CreateMiddleware>b__0>d.MoveNext()\n--- End of stack trace from previous location ---\n   at Umbraco.Cms.Web.Common.Middleware.PreviewAuthenticationMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)\n   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<<CreateMiddleware>b__0>d.MoveNext()\n--- End of stack trace from previous location ---\n   at Umbraco.Cms.Web.Common.Middleware.UmbracoRequestLoggingMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)\n   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<<CreateMiddleware>b__0>d.MoveNext()\n--- End of stack trace from previous location ---\n   at Umbraco.Forms.Web.HttpModules.ProtectFormUploadRequestsMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)\n   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<<CreateMiddleware>b__0>d.MoveNext()\n--- End of stack trace from previous location ---\n   at SixLabors.ImageSharp.Web.Middleware.ImageSharpMiddleware.Invoke(HttpContext httpContext, Boolean retry)\n   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)","@tr":"da2fe8d580b870f4d718d3a0d43761d9","@sp":"d304f22bba36417d","EventId":{"Id":1,"Name":"UnhandledException"},"SourceContext":"Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware","RequestId":"0HNBLA0U38DMT:00000001","RequestPath":"/","ConnectionId":"0HNBLA0U38DMT","ProcessId":1,"ProcessName":"dotnet","ThreadId":27,"ApplicationId":"d2b6c12ab2d22552b3a7faee0509e6139f633afc","MachineName":"38223dcede91","Log4NetLevel":"ERROR"}

If you have access to the database, maybe figure out what is trying to use the datatype with that id

SELECT * FROM cmsPropertyType WHERE dataTypeId = 1059;

Make sure to use .NET 8 with v13, .NET 9 might work but it’s not recommended.

Not sure if you’re using uSync or something like that, you might not have all your dependencies synced properly.

I’ve seen this issue in the past where I added content via a package that used a package.xml to add some data types. After booting I needed to manually save the data types, otherwise they wouldn’t get loaded into the cache. This worked on newer versions correctly, so I’m not sure if it’s something that will help you, but you might try to save custom content types manually.