umbraco / Umbraco-CMS

Umbraco is a free and open source .NET content management system helping you deliver delightful digital experiences.
https://umbraco.com
MIT License
4.42k stars 2.66k forks source link

Locking issue on installation (v10 RC3) #12464

Closed Padbury closed 2 years ago

Padbury commented 2 years ago

Which exact Umbraco version are you using? For example: 9.0.1 - don't just write v9

v10 RC3

Bug summary

I've been trying out the RC3 of v10 and encountered an issue. Obviously it's not a release version so I wasn't sure if I should report it or not but I'll list it out anyway and you can decide if it's useful or not useful. I simply attempted to install RC3 using Visual Studio 2022, ran the site, got the installer, filled in the details and received the following error:

System.InvalidOperationException: Couldn't find an appropriate default distributed locking mechanism.

I stopped and restarted the site and that cleared the issue.

Specifics

No response

Steps to reproduce

  1. I installed the RC3 templates into Visual Studio 2022
  2. I created a new site based on that template (using .Net 6) and included HTTPS redirection
  3. I didn't fill in the information in the Visual Studio project wizard for Umbraco. The connection string, user/pass combination was left empty.
  4. I built then ran the site
  5. I was presented with the usual Umbraco installation window in the browser. At this point I entered the user/pass and pointed Umbraco to use a local SQLExpress database.
  6. Installation proceeded. Upon completition I received the following error:

System.InvalidOperationException: Couldn't find an appropriate default distributed locking mechanism. at Umbraco.Cms.Infrastructure.DistributedLocking.DefaultDistributedLockingMechanismFactory.Initialize() at System.Threading.LazyInitializer.EnsureInitializedCore[T](T& target, Boolean& initialized, Object& syncLock, Func1 valueFactory) at Umbraco.Cms.Infrastructure.DistributedLocking.DefaultDistributedLockingMechanismFactory.EnsureInitialized() at Umbraco.Cms.Infrastructure.DistributedLocking.DefaultDistributedLockingMechanismFactory.get_DistributedLockingMechanism() at Umbraco.Cms.Infrastructure.Scoping.Scope.ObtainReadLock(Int32 lockId, Nullable1 timeout) at Umbraco.Cms.Infrastructure.Scoping.Scope.LockInner(Guid instanceId, Dictionary2& locks, HashSet1& locksSet, Action2 obtainLock, Nullable1 timeout, Int32 lockId) at Umbraco.Cms.Infrastructure.Scoping.Scope.EagerReadLockInner(Guid instanceId, Nullable1 timeout, Int32[] lockIds) at Umbraco.Cms.Infrastructure.Scoping.Scope.EnsureDbLocks() at Umbraco.Cms.Infrastructure.Scoping.Scope.get_Database() at Umbraco.Cms.Infrastructure.Scoping.Scope.get_Database() at Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement.ContentTypeCommonRepository.GetAllTypesInternal() at Umbraco.Extensions.AppCacheExtensions.<>cDisplayClass0_0`1.b0() at Umbraco.Cms.Core.Cache.SafeLazy.<>cDisplayClass1_0.b0() --- End of stack trace from previous location --- at Umbraco.Cms.Core.Cache.ObjectCacheAppCache.Get(String key, Func1 factory, Nullable1 timeout, Boolean isSliding, String[] dependentFiles) at Umbraco.Cms.Core.Cache.DeepCloneAppCache.Get(String key, Func1 factory, Nullable1 timeout, Boolean isSliding, String[] dependentFiles) at Umbraco.Extensions.AppCacheExtensions.GetCacheItem[T](IAppPolicyCache provider, String cacheKey, Func1 getCacheItem, Nullable1 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.ContentTypeRepositoryBase1.PerformGetAll(Int32[] ids) at Umbraco.Cms.Core.Cache.FullDataSetRepositoryCachePolicy2.GetAllCached(Func2 performGetAll) at Umbraco.Cms.Core.Cache.FullDataSetRepositoryCachePolicy2.GetAll(TId[] ids, Func2 performGetAll) at Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement.EntityRepositoryBase2.GetMany(TId[] ids) at Umbraco.Cms.Core.Services.ContentTypeServiceBase2.GetAll(Int32[] ids) at Umbraco.Cms.Infrastructure.PublishedCache.DataSource.MsgPackContentNestedDataSerializerFactory.Create(ContentCacheDataSerializerEntityType types) at Umbraco.Cms.Infrastructure.PublishedCache.Persistence.NuCacheContentRepository.Rebuild(IReadOnlyCollection1 contentTypeIds, IReadOnlyCollection1 mediaTypeIds, IReadOnlyCollection1 memberTypeIds) at Umbraco.Cms.Infrastructure.PublishedCache.Persistence.NuCacheContentService.Rebuild(IReadOnlyCollection1 contentTypeIds, IReadOnlyCollection1 mediaTypeIds, IReadOnlyCollection1 memberTypeIds) at Umbraco.Cms.Infrastructure.PublishedCache.Persistence.NuCacheContentService.RebuildDatabaseCacheIfSerializerChanged() at Umbraco.Cms.Infrastructure.PublishedCache.NuCacheStartupHandler.Handle(UmbracoApplicationStartingNotification notification) at Umbraco.Cms.Core.Events.NotificationHandlerWrapperImpl1.<>cDisplayClass0_0.b__1(INotification theNotification) at Umbraco.Cms.Core.Events.EventAggregator.PublishCore(IEnumerable1 allHandlers, INotification notification) at Umbraco.Cms.Core.Events.NotificationHandlerWrapperImpl1.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_method324(Closure , Object ) at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.gAwaited|12_0(ControllerActionInvoker invoker, ValueTask1 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, */* Accept-Encoding: gzip, deflate, br Accept-Language: en-GB,en;q=0.5 Connection: close Content-Length: 2398 Content-Type: application/json;charset=utf-8 Cookie: hasConsent=true; _ga=GA1.1.1679755120.1643371243; EntryCode=1234; _uetvid=473a8e10834511ec85f67fa6dc4793d4; _ga_VP06YQG8LV=GS1.1.1651570949.27.1.1651570987.0; _clck=ecz3o6|1|f15|0; __zlcmid=18KkfqEvwVGkpCn; UMB_MCULTURE=en-GB; CookieConsent={stamp:%27AvcDIHjUKEPAcx5TAjq/ZeYmq6ijmJxGrnY/U/JKAAmf5xU15kIc9Q==%27%2Cnecessary:true%2Cpreferences:true%2Cstatistics:true%2Cmarketing:true%2Cver:1%2Cutc:1644395702281%2Cregion:%27gb%27}; __qca=P0-36456138-1646653284650; cookieconsent_status=dismiss; _ga_QT7MH2XW38=GS1.1.1647864117.2.0.1647864117.60; Profile=d5090d30-0679-4f20-bb3b-a3606c21bdee; __stripe_mid=64101180-a053-4a46-809e-8a6dbe511d6e8ba86c; yourAuthCookie=79B7A781ECB76A5F79DD0FF5091C3C510E1A6E447ED8AA38817A135E9E5B9F752A3F5684FBDB560B0A0F3DB7554EE137349CAD3A20B48CC67EE744CD24CFD09D0F15D86F866D82850899267DDF9BE3E4BE466F08E5A5DE7A115B0B1C7E4B8D453BB56105D116503D20F29DE0D97DDF10; ASP.NET_SessionId=qrt23v2sci4in1scklww32w5; __H2RequestVerification=zwFvoRQuBlzVvGfGz5bxU7IUJsSSmIBSfSMBhxSPencVrFW-si6vr3m3JMOJSQerWAx9xyZUhOlMI8fNLOLiJgoi2781; .AspNetCore.Antiforgery.diyiyZrQF0o=CfDJ8NLwEQ_xeMZEsNI_HDfPnYklyokYsBUfDuyBo8CUnowU3obn8CXTkjFCbyFB7akV3bESig-USJyXYfibWX85Ix-lytOMzyC5SScAArO8YHuXFJ7ZYPIVBGxfkTLbsc_QEj3VBeONFAyp-MnTDxtjxzY; __RequestVerificationToken=4g5ydaD4snPRNbB5PKlfKPPibc-G84y8NHCQBVjWqlnWnbVxVOWSVaSHGFmYZ612sNbDZ_MXCZ9HNh8es2SmCAHi42yfxSEVCJsDQda0DfY1; .ASPXAUTH=FA41B439D1300E8144C8857F3402D5F7A44335426BC3EB64CEDAFED26BEC088CB8F7F4A8FCDFF8C405B2C76683A73BA76AAFEBFE20F72ECA43C3612CDFD0D3B572CAB42D9FC54D07A36AEEBEB6EFA7C6C7350186443435F9539A1291C25D5192792567CBE112E9BCB094AA4E7E30D65FE6D6C988D11CFE2814E35D3FB6397BD11356408984B0A6AECB67F296D13B05F60F1AE75FBABB196FC2ADEFB814E634F9; .AspNetCore.Antiforgery.YsH_uo1ey8I=CfDJ8NLwEQ_xeMZEsNI_HDfPnYlfLU8m-5KVM8NxKev86RUnN_Pado9RKoU5OjJT1lXQxVcMkix31epBt6AWVYLc0eh8r9iotbmkwEMGZItyq9XXaRoQO7UPtvl76fO4vPMxKNwU-6umrD9f2JynEpcaecM; UMB-XSRF-TOKEN=sncFEQw4nZn6bAwhFKOXuUI80C3hDMjOh2ZxZ2dieqyUj8Mz_rsM6F3rTclDdjX8BEIKUGLjDoJnSAOZOifGTnJsZL7__YbIloJRDVT42jk69-IPuPGu78j2E3eGO5V2SGhiDn8AcKwRezOqBOO_0Q2; UMB-XSRF-V=y8wfOhkVfugP-NbMiG7gJFPnON2mNNDulA2IL1MTzB3eF3t6wwdfLhSwCgapfoYxPHe-ttXNaGpUIAX989Iq_3fshE4eb4Vt7TYhd-Wnhkk1; UMB_UCONTEXT_C=2022-05-03T13%3A03%3A24.8727758%2B00%3A00; __APRequestVerification=RIC9JP_mvE_74nCGeK3j9UZ9GsFKAl2O8RlnLBTQFJsCt-DBAu4pGdzvx9BD7ndAY0pG8CnQI_pRQXRYQePowVDgobI1; XSRF-TOKEN=sSYjK8cGhsdLaUZq9EL9IUscOwxwGqlRLnLCzphvr6DUuHaEeHNOI-BX9jmj33uPRn143ygJcxBKwEfSle6NF72SIbvsA-QPwozimw7O-8c1; XSRF-V=tOvNHfiSNJu84mlEYn8SIiKh3JIxoYl8tVbNl-wFzHfV1_a9sYfv2xqc3o9TSNeEj-6KKblC7_hw5GO1vAIeddgKpuQnAADrf34eQ5D1Yxc1; .AspNetCore.Identity.Application=CfDJ8Gi-NNaFoPhEu9EMad5NJngtB74o13uWIAV9tdcJ8NKM6PnnWAAwvlcA22L6IPLZbFg78Q1XY1YuZmM3fA7qFedhvWVeuobM0OHYgTxiDnFv9EeRaVcT8GsSI0iUuFVRTV8juBP8-QbME7eDKeSj63UxQVL0JgLUj_mJQd6_CYhO4STHN8Y-2cvolXrnRV2Z039W-StJ_26BQaWbI82MhoRHgHC6cfoKdsRiglP5y3frgLl9fKeBJOnSnDaYiTXLazPJXocpuAC0fp1UJ3N5h4QigUpaqKy8yH3CogAOg5nsF-pZrIuHSGGdx2IpxIO5fpJxCEoQ7sQy7tNLKpA2KP00e034E4_VKLzuwF7uBY82WktvwT_3l2e8axOVAb492GzzvvwLcq8z3jj_V1y_-qGuXTKeQFW5pF8zcT9woqcLbInKDq3kNMv4bvcB-UElGU_xEOCDvcurEz56WPiulVoQgPYmDVYqx1QyaQs_jAth_UlB7dVMj5hI3ZoRM-Vl5ghn03PqUNULIIu1r749Ej4jVCno8I9lnFmaVBK60jWFtD9apTyQAPuMYgOsOUA7bYlH26zFS7yfvdr7F48kDX0nhhDRMVT23PT2j9XC3UPlplLuKAbNP050Se599lUBt43JM2F-LabN1wE-fZJhPRT2TCsHihbaBP_M1GhPk_Z1T42pXaKInHWuxihhWgtiXEUi20YcaK2_iPU0iOdJ1lMU33_iZXg76b7HdMzZJ3X2jWq_mWx72YHLvayNre9kPIoE1elb7lVuNRNVAiHxaMM; .AspNet.ApplicationCookie=FRX3dQtcZ_6FcbQE47butaha7E5dPeBjP7Vrp8euqDmDd6509WI1fwdaUKPxsSGrJC_6QnN_QYzn5Fg3xOUdi0ZY0f2kOOSaM7GFR3upnVftAmyRkZJYq0sJFqP1ytnLMlhpQPFRPfAgE_17FNifvlaefhpUUYSub3dvHZWEUWAaAuHy63ytC2XKTcNR250NFp4rTjUBvWHb-j_9VZBfYdRT9d4A8sEGr57LdpYqNzsqiLt6WSsMcgqa_DUPcX5neSDDfT5Fv15NuDLEJoT7Is42fGdRcNeERq_VdFfC0nuNgsUb7jSBpYJLTIa7j0zXx2GozzcIYaF2mWcv4ecrwViFAM4; umb_installId=b22049d7-e01f-440b-8bdc-84e48c3f3003 Host: localhost:44361 Referer: https://localhost:44361/install?redir=true&url=https://localhost:44361/ TE: trailers User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:101.0) Gecko/20100101 Firefox/101.0 x-xsrf-token: sSYjK8cGhsdLaUZq9EL9IUscOwxwGqlRLnLCzphvr6DUuHaEeHNOI-BX9jmj33uPRn143ygJcxBKwEfSle6NF72SIbvsA-QPwozimw7O-8c1 origin: https://localhost:44361 sec-fetch-dest: empty sec-fetch-mode: cors sec-fetch-site: same-origin

  1. I tried to go to the site root and had the same error.
  2. I stopped the site. Rebuilt and reran it. This cleared the error and the site works as expected.

Environment: Windows 10, Visual Studio 2022 (up-to-date), SQL Express 2019

Hopefully that's of use.

Bruce

Expected result / actual result

No response

p-m-j commented 2 years ago

@Padbury ~I followed the repro steps twice but couldn't reproduce.~

Local sqlexpress != localdb

gotya, can repro.

p-m-j commented 2 years ago

Worth mentioning that we absolutely do want bug reports for release candidates so we can be as bug free as possible for the final 10.0.0 release.

p-m-j commented 2 years ago

Closed via https://github.com/umbraco/Umbraco-CMS/pull/12472 rc4 should land today, cheers for the report!