question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Exception thrown when upgrading from Umbraco 8.17.0 to 10.0.0

See original GitHub issue

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

10.0.0

Bug summary

I’m trying to upgrade the database from 8.17.0 to 10.0.0, then I got the following error. The same error can be reproduced using 10.5.1

System.InvalidOperationException: Set an alias before adding the property group. at Umbraco.Cms.Core.Models.PropertyGroupCollection.Add(PropertyGroup item) at Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement.ContentTypeCommonRepository.MapGroupsAndProperties(IDictionary`2 contentTypes) at Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement.ContentTypeCommonRepository.GetAllTypesInternal() at Umbraco.Extensions.AppCacheExtensions.<>c__DisplayClass0_0`1.b__0() at Umbraco.Cms.Core.Cache.SafeLazy.<>c__DisplayClass1_0.b__0() --- End of stack trace from previous location --- at Umbraco.Cms.Core.Cache.ObjectCacheAppCache.Get(String key, Func`1 factory, Nullable`1 timeout, Boolean isSliding, String[] dependentFiles) at Umbraco.Cms.Core.Cache.DeepCloneAppCache.Get(String key, Func`1 factory, Nullable`1 timeout, Boolean isSliding, String[] dependentFiles) at Umbraco.Extensions.AppCacheExtensions.GetCacheItem[T](IAppPolicyCache provider, String cacheKey, Func`1 getCacheItem, Nullable`1 timeout, Boolean isSliding, String[] dependentFiles) at Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement.ContentTypeCommonRepository.GetAllTypes() at Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement.ContentTypeRepository.GetAllWithFullCachePolicy() at Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement.ContentTypeRepositoryBase`1.PerformGetAll(Int32[] ids) at Umbraco.Cms.Core.Cache.FullDataSetRepositoryCachePolicy`2.GetAllCached(Func`2 performGetAll) at Umbraco.Cms.Core.Cache.FullDataSetRepositoryCachePolicy`2.GetAll(TId[] ids, Func`2 performGetAll) at Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement.EntityRepositoryBase`2.GetMany(TId[] ids) at Umbraco.Cms.Core.Services.ContentTypeServiceBase`2.GetAll(Int32[] ids) at Umbraco.Cms.Infrastructure.PublishedCache.DataSource.MsgPackContentNestedDataSerializerFactory.Create(ContentCacheDataSerializerEntityType types) at Umbraco.Cms.Infrastructure.PublishedCache.Persistence.NuCacheContentRepository.Rebuild(IReadOnlyCollection`1 contentTypeIds, IReadOnlyCollection`1 mediaTypeIds, IReadOnlyCollection`1 memberTypeIds) at Umbraco.Cms.Infrastructure.PublishedCache.Persistence.NuCacheContentService.Rebuild(IReadOnlyCollection`1 contentTypeIds, IReadOnlyCollection`1 mediaTypeIds, IReadOnlyCollection`1 memberTypeIds) at Umbraco.Cms.Infrastructure.PublishedCache.Persistence.NuCacheContentService.RebuildDatabaseCacheIfSerializerChanged() at Umbraco.Cms.Infrastructure.PublishedCache.NuCacheStartupHandler.Handle(UmbracoApplicationStartingNotification notification) at Umbraco.Cms.Core.Events.EventAggregator.PublishCore(IEnumerable`1 allHandlers, INotification notification) at Umbraco.Cms.Core.Events.NotificationHandlerWrapperImpl`1.Handle(INotification notification, ServiceFactory serviceFactory, Action`2 publish) at Umbraco.Cms.Core.Events.EventAggregator.PublishNotification(INotification notification) at Umbraco.Cms.Core.Events.EventAggregator.PublishAsync[TNotification](TNotification notification, CancellationToken cancellationToken) at Umbraco.Cms.Infrastructure.Runtime.CoreRuntime.StartAsync(CancellationToken cancellationToken, Boolean isRestarting) at Umbraco.Cms.Infrastructure.Runtime.CoreRuntime.RestartAsync() at Umbraco.Cms.Web.BackOffice.Install.InstallApiController.CompleteInstall() at lambda_method216(Closure , Object ) at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) 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.g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope) at Microsoft.AspNetCore.Routing.EndpointMiddleware.g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger) at Umbraco.Cms.Web.Common.Middleware.BasicAuthenticationMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<b__1>d.MoveNext() --- End of stack trace from previous location --- at Umbraco.Cms.Web.BackOffice.Middleware.BackOfficeExternalLoginProviderErrorMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<b__1>d.MoveNext() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) at SixLabors.ImageSharp.Web.Middleware.ImageSharpMiddleware.Invoke(HttpContext httpContext, Boolean retry) at StackExchange.Profiling.MiniProfilerMiddleware.Invoke(HttpContext context) in C:\projects\dotnet\src\MiniProfiler.AspNetCore\MiniProfilerMiddleware.cs:line 119 at Umbraco.Cms.Web.Common.Middleware.UmbracoRequestMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) at Umbraco.Cms.Web.Common.Middleware.UmbracoRequestMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<b__1>d.MoveNext() --- End of stack trace from previous location --- at Umbraco.Cms.Web.Common.Middleware.PreviewAuthenticationMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<b__1>d.MoveNext() --- End of stack trace from previous location --- at Umbraco.Cms.Web.Common.Middleware.UmbracoRequestLoggingMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<b__1>d.MoveNext() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context) HEADERS ======= Accept: application/json, text/plain, */* Connection: keep-alive Host: localhost:3178 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.51 Accept-Encoding: gzip, deflate, br Accept-Language: en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7 Content-Type: application/json;charset=UTF-8 Cookie: UMB_UPDCHK=1; Bucket=cEfgioe5QBKeQJ4tYnpGow; Varient=1; umb_installId=8e09e6c8-ba39-4ede-8458-195fd1e3cc2b; UMB_UCONTEXT_C=2023-06-19T10%3A04%3A02.7568504%2B00%3A00; UMB_UCONTEXT=<redacted> Origin: http://localhost:3178 Referer: http://localhost:3178/install?redir=true&url=http://localhost:3178/ Content-Length: 269 sec-ch-ua: "Not.A/Brand";v="8", "Chromium";v="114", "Microsoft Edge";v="114" sec-ch-ua-mobile: ?0 sec-ch-ua-platform: "Windows" Sec-Fetch-Site: same-origin Sec-Fetch-Mode: cors Sec-Fetch-Dest: empty

Specifics

Context: I’m upgrading an old umbraco project from 7. I removed and updated some of the data properties and managed to successfully upgrade to 8.17.0. But I am unable to continue down the path of upgrade to 10 due the above error.

Steps to reproduce

Have my 8.17.0 database Install a new Umbraco 10 project Hit upgrade, failed with the above exception

Expected result / actual result

Upgrade should be successful

Issue Analytics

  • State:open
  • Created 3 months ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
yawkalecommented, Aug 11, 2023

possible workaround find all Property Type Group with empty alias and set it SELECT * FROM [cmsPropertyTypeGroup] WHERE [alias] is null

1reaction
andr317ccommented, Jun 26, 2023

I looked further into the issue and found out that we have an issue with translating Chinese and some other special characters to a PropertyTypeGroup alias, the issue left some aliases empty which is why this upgrade failed.

I’m guessing that we did not have a validation checking if the PropertyTypeGroup alias was empty or not. in V7 and under.

To fix the missing aliases on your PropertyTypeGroup, go into your cmsPropertyTypeGroup table and add the missing aliases for the PropertyTypeGroups.

The actual issue happens when you try to input Chinese or some other special characters in the PropertyTypeGroup name for the first time and try to save it, the alias for the PropertyTypeGroup will be empty.

An example could be that you try to input “内容” as the PropertyTypeGroup name, when you input this, the alias will be empty. This will throw a validation error on V10 and up so you won’t be able to save the document type, my guess would be that on earlier versions around V7 and under it did not throw an error, so you were allowed to save a PropertyTypeGroup with an empty alias. If you then try to write “内容内容” it will set the alias as “1” and it will save the document type. The alias should be translated to “1” the first time we input the PropertyTypeGroup name, and not the second time.

I will mark this issue as an up for grabs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

upgrade to umbraco 10 error
I have upgraded to Umbraco 10.0.1 via Nuget and also upgraded uSkinned to 3.0.0 but now when ... ThrowMoreThanOneMatchException() at System.
Read more >
Problem upgrading to 8.17.1
I have problems with an upgrade to version 8.17.1. ... BootFailedException: Local version "8.17.1" > code version "8.12.1", downgrading is ...
Read more >
umbraco forms upgrade v8 to v10
Now I install Umbraco Forms and it throw this error: Umbraco.Cms.Core.Exceptions.BootFailedException: The migration plan does not support ...
Read more >
Compare Releases
Features released in version 10.0.0 ... 6894 - Opening Help Panel Without Connection to Internet Throws Exception ... Bugfixing on the 8.17.0 release....
Read more >
Upgrade from 8.17 to 9.0.1 causing error
Invalid column name 'emailConfirmedDate'. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found