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.41k stars 2.66k forks source link

V13 RC: Installing throws an error if using SQLite as the DB #15090

Closed warrenbuckley closed 9 months ago

warrenbuckley commented 10 months ago

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

13.0.0-rc1

Bug summary

I am going through the normal installer flow running from my local machine via the command line (kestrel) running on Windows 11 and get an error after the database steps try to install.

Specifics

Error in installer flow image

Logs (During install) UmbracoTraceLog.HACKMAKEDO.20231101.json

And a subsequent run with dotnet run I get the following error no such table: umbracoOpenIddictApplications

[14:59:04 INF] Acquiring MainDom.
[14:59:04 INF] Acquired MainDom.
[14:59:05 WRN] Database NuCache was serialized using 0. Currently configured NuCache serializer MessagePack. Rebuilding Nucache
[14:59:05 INF] Rebuilding NuCache database with MessagePack serializer [Timing a6890f4]
[14:59:05 INF] Completed. (154ms) [Timing a6890f4]
[14:59:05 WRN] No last synced Id found, this generally means this is a new server/install. A cold boot will be triggered.
[Unhandled exception. 14:59:05 ERR] Unhandled exception in AppDomain (terminating).
Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 1: 'no such table: umbracoOpenIddictApplications'.Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 1: 'no such table: umbracoOpenIddictApplications'.
   at Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db)
   at Microsoft.Data.Sqlite.SqliteCommand.PrepareAndEnumerateStatements()+MoveNext()
   at Microsoft.Data.Sqlite.SqliteCommand.GetStatements()+MoveNext()
   at Microsoft.Data.Sqlite.SqliteDataReader.NextResult()
   at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
   at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)
   at Microsoft.Data.Sqlite.SqliteCommand.ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.InitializeReaderAsync(AsyncEnumerator enumerator, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.MoveNextAsync()
   at Microsoft.EntityFrameworkCore.Query.ShapedQueryCompilingExpressionVisitor.SingleOrDefaultAsync[TSource](IAsyncEnumerable`1 asyncEnumerable, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Query.ShapedQueryCompilingExpressionVisitor.SingleOrDefaultAsync[TSource](IAsyncEnumerable`1 asyncEnumerable, CancellationToken cancellationToken)
   at OpenIddict.EntityFrameworkCore.OpenIddictEntityFrameworkCoreApplicationStore`5.FindByClientIdAsync(String identifier, CancellationToken cancellationToken)   at OpenIddict.Core.OpenIddictApplicationCache`1.<>c__DisplayClass6_0.<<FindByClientIdAsync>g__ExecuteAsync|0>d.MoveNext()
--- End of stack trace from previous location ---
   at OpenIddict.Core.OpenIddictApplicationManager`1.FindByClientIdAsync(String identifier, CancellationToken cancellationToken)
   at OpenIddict.Core.OpenIddictApplicationManager`1.OpenIddict.Abstractions.IOpenIddictApplicationManager.FindByClientIdAsync(String identifier, CancellationToken cancellationToken)
   at Umbraco.Cms.Infrastructure.Security.OpenIdDictApplicationManagerBase.Delete(String identifier, CancellationToken cancellationToken)
   at Umbraco.Cms.Api.Delivery.Security.MemberApplicationManager.DeleteMemberApplicationAsync(CancellationToken cancellationToken)
   at Umbraco.Cms.Api.Delivery.Handlers.InitializeMemberApplicationNotificationHandler.HandleAsync(UmbracoApplicationStartingNotification notification, CancellationToken cancellationToken)
   at Umbraco.Cms.Core.Events.INotificationAsyncHandler`1.HandleAsync(IEnumerable`1 notifications, CancellationToken cancellationToken)
   at Umbraco.Cms.Core.Events.EventAggregator.PublishCoreAsync[TNotification](IEnumerable`1 allHandlers, IEnumerable`1 notifications, CancellationToken cancellationToken)
   at Umbraco.Cms.Core.Events.NotificationAsyncHandlerWrapperImpl`1.HandleAsync[TNotification,TNotificationHandler](IEnumerable`1 notifications, CancellationToken cancellationToken, ServiceFactory serviceFactory, Func`4 publish)
   at Umbraco.Cms.Core.Events.EventAggregator.PublishNotificationsAsync[TNotification,TNotificationHandler](IEnumerable`1 notifications, CancellationToken cancellationToken)
   at Umbraco.Cms.Core.Events.EventAggregator.PublishAsync[TNotification,TNotificationHandler](IEnumerable`1 notifications, CancellationToken cancellationToken)   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.StartAsync(CancellationToken cancellationToken)
   at Umbraco.Extensions.WebApplicationExtensions.BootUmbracoAsync(WebApplication app)
   at Program.<Main>$(String[] args) in D:\Code\HackMakeDo\UmbracoV13Playground\Program.cs:line 12
   at Program.<Main>(String[] args)

   at Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db)
   at Microsoft.Data.Sqlite.SqliteCommand.PrepareAndEnumerateStatements()+MoveNext()
   at Microsoft.Data.Sqlite.SqliteCommand.GetStatements()+MoveNext()
   at Microsoft.Data.Sqlite.SqliteDataReader.NextResult()
   at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
   at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)
   at Microsoft.Data.Sqlite.SqliteCommand.ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.InitializeReaderAsync(AsyncEnumerator enumerator, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.MoveNextAsync()
   at Microsoft.EntityFrameworkCore.Query.ShapedQueryCompilingExpressionVisitor.SingleOrDefaultAsync[TSource](IAsyncEnumerable`1 asyncEnumerable, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Query.ShapedQueryCompilingExpressionVisitor.SingleOrDefaultAsync[TSource](IAsyncEnumerable`1 asyncEnumerable, CancellationToken cancellationToken)
   at OpenIddict.EntityFrameworkCore.OpenIddictEntityFrameworkCoreApplicationStore`5.FindByClientIdAsync(String identifier, CancellationToken cancellationToken)   at OpenIddict.Core.OpenIddictApplicationCache`1.<>c__DisplayClass6_0.<<FindByClientIdAsync>g__ExecuteAsync|0>d.MoveNext()
--- End of stack trace from previous location ---
   at OpenIddict.Core.OpenIddictApplicationManager`1.FindByClientIdAsync(String identifier, CancellationToken cancellationToken)
   at OpenIddict.Core.OpenIddictApplicationManager`1.OpenIddict.Abstractions.IOpenIddictApplicationManager.FindByClientIdAsync(String identifier, CancellationToken cancellationToken)
   at Umbraco.Cms.Infrastructure.Security.OpenIdDictApplicationManagerBase.Delete(String identifier, CancellationToken cancellationToken)
   at Umbraco.Cms.Api.Delivery.Security.MemberApplicationManager.DeleteMemberApplicationAsync(CancellationToken cancellationToken)
   at Umbraco.Cms.Api.Delivery.Handlers.InitializeMemberApplicationNotificationHandler.HandleAsync(UmbracoApplicationStartingNotification notification, CancellationToken cancellationToken)
   at Umbraco.Cms.Core.Events.INotificationAsyncHandler`1.HandleAsync(IEnumerable`1 notifications, CancellationToken cancellationToken)
   at Umbraco.Cms.Core.Events.EventAggregator.PublishCoreAsync[TNotification](IEnumerable`1 allHandlers, IEnumerable`1 notifications, CancellationToken cancellationToken)
   at Umbraco.Cms.Core.Events.NotificationAsyncHandlerWrapperImpl`1.HandleAsync[TNotification,TNotificationHandler](IEnumerable`1 notifications, CancellationToken cancellationToken, ServiceFactory serviceFactory, Func`4 publish)
   at Umbraco.Cms.Core.Events.EventAggregator.PublishNotificationsAsync[TNotification,TNotificationHandler](IEnumerable`1 notifications, CancellationToken cancellationToken)
   at Umbraco.Cms.Core.Events.EventAggregator.PublishAsync[TNotification,TNotificationHandler](IEnumerable`1 notifications, CancellationToken cancellationToken)   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.StartAsync(CancellationToken cancellationToken)
   at Umbraco.Extensions.WebApplicationExtensions.BootUmbracoAsync(WebApplication app)
   at Program.<Main>$(String[] args) in D:\Code\HackMakeDo\UmbracoV13Playground\Program.cs:line 12
   at Program.<Main>(String[] args)

dotnet --list-sdks image

7.0.310 [C:\Program Files\dotnet\sdk]
7.0.403 [C:\Program Files\dotnet\sdk]
8.0.100-rc.2.23502.2 [C:\Program Files\dotnet\sdk]

Steps to reproduce

Expected result / actual result

No response


This item has been added to our backlog AB#35142

kjac commented 10 months ago

Hi @warrenbuckley,

Thanks for reaching out πŸ‘

I can't really reproduce this πŸ˜• the exact same steps work fine on my machine. No KABOOM here. I even tried RC1 and RC2 of .NET8 (definitively because I am so thorough, not at all becourse I had RC1 installed when I first ran the test 🀦).

From what I can read in the attached logfile, everything runs fine until EF Core tries to run its migrations. Then... KABOOM. I wonder why that does not happen on my end.

Can you reproduce this error?

kjac commented 10 months ago

Update: @enkelmedia also ran into this (#15125). Still can't reproduce it myself. I will make sure the whole team makes an attempt at a fresh install from the templates early next week, in the hope that someone can reproduce.

warrenbuckley commented 10 months ago

@kjac I have not been able to reproduce the error and I would check to see if @enkelmedia still can, as after a reboot of my machine it all worked fine.

@KevinJump also had the same issue but prompted me to do a reboot as his issue went away and so did mine after that. https://discord.com/channels/869656431308189746/1169295860325158963

Kenn, I wonder if a Windows patch or VS or .NET update was out that day as well that needed to be applied perhaps, as super odd just after a reboot it all got fixed up.

kjac commented 10 months ago

@warrenbuckley thanks for the update. I have been wondering the same ... I just don't feel comfortable with things magically fixing themselves πŸ€” on the other hand, we we can't reproduce this after rebooting - well, then we can't.

I'm still going to make sure the team has a go at this. If the reboot theory sticks, they shouldn't be able to reproduce either 😝

enkelmedia commented 10 months ago

I just restarted my computer and tried again - did not solve the problem.

One or more errors occurred. (One or more errors occurred. (Cannot access a disposed object. Object name: 'IServiceProvider'.))

See the log for full details (logs can typically be found in the umbraco\Logs folder).
{
  "@t": "2023-11-06T09:09:10.6062842Z",
  "@mt": "An error occurred during installation step {Step}",
  "@l": "Error",
  "@x": "System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.\r\n ---> System.AggregateException: One or more errors occurred. (One or more errors occurred. (Cannot access a disposed object.\r\nObject name: 'IServiceProvider'.))\r\n ---> System.AggregateException: One or more errors occurred. (Cannot access a disposed object.\r\nObject name: 'IServiceProvider'.)\r\n ---> System.ObjectDisposedException: Cannot access a disposed object.\r\nObject name: 'IServiceProvider'.\r\n   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ThrowHelper.ThrowObjectDisposedException()\r\n   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)\r\n   at Microsoft.EntityFrameworkCore.Infrastructure.Internal.InfrastructureExtensions.GetService(IInfrastructure`1 accessor, Type serviceType)\r\n   at Microsoft.EntityFrameworkCore.Infrastructure.Internal.InfrastructureExtensions.GetService[TService](IInfrastructure`1 accessor)\r\n   at Microsoft.EntityFrameworkCore.Infrastructure.AccessorExtensions.GetService[TService](IInfrastructure`1 accessor)\r\n   at Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade.get_Dependencies()\r\n   at Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade.get_CurrentTransaction()\r\n   at Umbraco.Cms.Persistence.EFCore.Sqlite.SqliteMigrationProvider.MigrateAllAsync()\r\n   at Umbraco.Cms.Persistence.EFCore.EfCoreMigrationExecutor.ExecuteAllMigrationsAsync()\r\n   at Umbraco.Cms.Persistence.EFCore.Composition.EFCoreCreateTablesNotificationHandler.HandleAsync()\r\n   at Umbraco.Cms.Persistence.EFCore.Composition.EFCoreCreateTablesNotificationHandler.HandleAsync(DatabaseSchemaAndDataCreatedNotification notification, CancellationToken cancellationToken)\r\n   at Umbraco.Cms.Core.Events.INotificationAsyncHandler`1.HandleAsync(IEnumerable`1 notifications, CancellationToken cancellationToken)\r\n   at Umbraco.Cms.Core.Events.EventAggregator.PublishCoreAsync[TNotification](IEnumerable`1 allHandlers, IEnumerable`1 notifications, CancellationToken cancellationToken)\r\n   at Umbraco.Cms.Core.Events.NotificationAsyncHandlerWrapperImpl`1.HandleAsync[TNotification,TNotificationHandler](IEnumerable`1 notifications, CancellationToken cancellationToken, ServiceFactory serviceFactory, Func`4 publish)\r\n   at Umbraco.Cms.Core.Events.EventAggregator.PublishNotificationsAsync[TNotification,TNotificationHandler](IEnumerable`1 notifications, CancellationToken cancellationToken)\r\n   --- End of inner exception stack trace ---\r\n   at System.Threading.Tasks.Task.WaitAllCore(Task[] tasks, Int32 millisecondsTimeout, CancellationToken cancellationToken)\r\n   at System.Threading.Tasks.Task.WaitAll(Task[] tasks)\r\n   at Umbraco.Cms.Core.Events.EventAggregator.Publish[TNotification,TNotificationHandler](IEnumerable`1 notifications)\r\n   at Umbraco.Cms.Core.Events.ScopedNotificationPublisher`1.PublishScopedNotifications(IList`1 notifications)\r\n   at Umbraco.Cms.Core.Events.ScopedNotificationPublisher`1.ScopeExit(Boolean completed)\r\n   at Umbraco.Cms.Core.Scoping.CoreScope.HandleScopedNotifications()\r\n   at Umbraco.Cms.Infrastructure.Scoping.Scope.TryFinally(Action[] actions)\r\n   --- End of inner exception stack trace ---\r\n   at Umbraco.Cms.Infrastructure.Scoping.Scope.TryFinally(Action[] actions)\r\n   at Umbraco.Cms.Infrastructure.Scoping.Scope.RobustExit(Boolean completed, Boolean onException)\r\n   at Umbraco.Cms.Infrastructure.Scoping.Scope.DisposeLastScope()\r\n   at Umbraco.Cms.Infrastructure.Scoping.Scope.Dispose()\r\n   at Umbraco.Cms.Infrastructure.Migrations.Install.DatabaseBuilder.CreateSchemaAndData()\r\n   at Umbraco.Cms.Infrastructure.Install.InstallSteps.DatabaseInstallStep.ExecuteAsync(Object model)\r\n   at InvokeStub_InstallSetupStep`1.ExecuteAsync(Object, Span`1)\r\n   at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)\r\n   --- End of inner exception stack trace ---\r\n   at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)\r\n   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)\r\n   at Umbraco.Cms.Web.BackOffice.Install.InstallApiController.ExecuteStepAsync(InstallSetupStep step, Object instruction)\r\n   at Umbraco.Cms.Web.BackOffice.Install.InstallApiController.PostPerformInstall(InstallInstructions installModel)",
  "Step": "DatabaseInstall",
  "SourceContext": "Umbraco.Cms.Web.BackOffice.Install.InstallApiController",
  "ActionId": "80b4a6f4-9def-4971-a548-c575ceff10f3",
  "ActionName": "Umbraco.Cms.Web.BackOffice.Install.InstallApiController.PostPerformInstall (Umbraco.Web.BackOffice)",
  "RequestId": "0HMUUKVVV23BI:00000005",
  "RequestPath": "/install/api/PostPerformInstall",
  "ConnectionId": "0HMUUKVVV23BI",
  "ProcessId": 24532,
  "ProcessName": "MyUmb13Test",
  "ThreadId": 6,
  "ApplicationId": "ecec7485f57c871a2250d4a648dc9f59b5898ac2",
  "MachineName": "EM-FRACTAL",
  "Log4NetLevel": "ERROR",
  "HttpRequestId": "41c454f4-2d21-4a06-8d36-50bdc7a91d59",
  "HttpRequestNumber": 1,
  "HttpSessionId": "2c7eb55a-eae6-4f0f-2c64-40e72babb339"
}

After stopping the site and doing dotnet run again i get this error

Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 1: 'no such table: umbracoOpenIddictApplications'.
   at Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db)
   at Microsoft.Data.Sqlite.SqliteCommand.PrepareAndEnumerateStatements()+MoveNext()
   at Microsoft.Data.Sqlite.SqliteCommand.GetStatements()+MoveNext()
   at Microsoft.Data.Sqlite.SqliteDataReader.NextResult()
   at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
   at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)
   at Microsoft.Data.Sqlite.SqliteCommand.ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.InitializeReaderAsync(AsyncEnumerator enumerator, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.MoveNextAsync()
   at Microsoft.EntityFrameworkCore.Query.ShapedQueryCompilingExpressionVisitor.SingleOrDefaultAsync[TSource](IAsyncEnumerable`1 asyncEnumerable, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Query.ShapedQueryCompilingExpressionVisitor.SingleOrDefaultAsync[TSource](IAsyncEnumerable`1 asyncEnumerable, CancellationToken cancellationToken)
   at OpenIddict.EntityFrameworkCore.OpenIddictEntityFrameworkCoreApplicationStore`5.FindByClientIdAsync(String identifier, CancellationToken cancellationToken)
   at OpenIddict.Core.OpenIddictApplicationCache`1.<>c__DisplayClass6_0.<<FindByClientIdAsync>g__ExecuteAsync|0>d.MoveNext()

SDK: 8.0.100-rc.2.23502.2 Platform: Windows 11 Pro Db: SQLite

warrenbuckley commented 10 months ago

That is weird as myself and Kevin it just went away?! @enkelmedia a suggestion try, is to clear your nuget cache and see if any pending updates from Visual Studio or Windows updates would be what I would try myself next.

dotnet nuget locals all --clear

For OS Comparison if that is of any help/use

Edition Windows 11 Pro
Version 22H2
Installed on    β€Ž21/β€Ž06/β€Ž2023
OS build    22621.2506
Experience  Windows Feature Experience Pack 1000.22677.1000.0
enkelmedia commented 10 months ago

FYI: I just made a clean install of 12.3.1 using SQLite and got the same error.

@kjac Update here, same issue on the officially released 12.3.1 version. I have the same error both on my computer at home and at the office. Both Windows 11 Pro. Intel.

@warrenbuckley I'll get back with the details.

EDIT:

Downgraded to 12.2.0 and installed without problems.

Edition Windows 11 Pro
Version 22H2
Installed on    β€Ž2023-β€Ž01-β€Ž27
OS build    22621.2428
Experience  Windows Feature Experience Pack 1000.22674.1000.0

I'll see if an OS upgrade solve the issue.

Edit2:

Still no luck.

Updated Visual Studio to latest versions:

17.7.1
Preview 17.8.0 Preview 7.0

And the OS:

Edition Windows 11 Pro
Version 23H2
Installed on    β€Ž2023-β€Ž01-β€Ž27
OS build    22631.2428
Experience  Windows Feature Experience Pack 1000.22674.1000.0

Edit3: Looking closer at the logs.

Might be something with the EF Core-implementation? Looks like the connection-string change makes the UmbracoDbContext dispose, next after this comes the error.

image

One or more errors occurred. (One or more errors occurred. (Cannot access a disposed object. Object name: 'IServiceProvider'.))

Edit4: Also tried:

dotnet nuget locals all --clear

Still the same error during install.

dan-hammond commented 10 months ago

The same is happening for me on a Mac with a fresh 12.3.1 project, as well as my existing projects I updated from 12.2.0 to 12.3.1.

kjac commented 10 months ago

Thanks @dan-hammond ... we're investigating, gotta get to the bottom of this.

Migaroez commented 10 months ago

hey @enkelmedia I have been trying to reproduce this all morning to no avail, could you send me your full log files from the failed install? sge@umbraco.dk

KevinJump commented 10 months ago

Hi @Migaroez

I've sent you a couple of logs from just now, one with debugging on.

I would say i can currently get the RC1 install to fail around 80% of the time.

enkelmedia commented 10 months ago

@Migaroez I've sent you logs for both Umbraco 12.3.1 and 13.0.0-rc2 where I have these issues. The last version that worked was 12.2.0.

Eaglef90 commented 10 months ago

I appear to behing this issue as well though I am nto 100% sure if I am on SQLLite right now, reaching out to my host to confirm. For me the upgrade works fine on my local development machine, which connects to the DB on my staging environment but if I publish to staing or production those environemtns will break. Here is the erro I was able to dig up

:\HostingSpaces\ffinfoco\ffinfo.com_1J3tkwT0\wwwroot' hit unexpected managed exception, exception code = '0xe0434352'. First 30KB characters of captured stdout and stderr logs:
Unhandled exception. System.ObjectDisposedException: Cannot access a disposed context instance. A common cause of this error is disposing a context instance that was resolved from dependency injection and then later trying to use the same context instance elsewhere in your application. This may occur if you are calling 'Dispose' on the context instance, or wrapping it in a using statement. If you are using dependency injection, you should let the dependency injection container take care of disposing context instances.
Object name: 'UmbracoDbContext'.
   at Microsoft.EntityFrameworkCore.DbContext.CheckDisposed()
   at Microsoft.EntityFrameworkCore.DbContext.Microsoft.EntityFrameworkCore.Internal.IDbSetCache.GetOrAddSet(IDbSetSource source, Type type)
   at Microsoft.EntityFrameworkCore.DbContext.Set[TEntity]()
   at OpenIddict.EntityFrameworkCore.OpenIddictEntityFrameworkCoreApplicationStore5.get_Applications()
   at OpenIddict.EntityFrameworkCore.OpenIddictEntityFrameworkCoreApplicationStore5.FindByClientIdAsync(String identifier, CancellationToken cancellationToken)
   at OpenIddict.Core.OpenIddictApplicationCache1.<>c__DisplayClass6_0.<<FindByClientIdAsync>g__ExecuteAsync|0>d.MoveNext()
--- End of stack trace from previous location ---
   at OpenIddict.Core.OpenIddictApplicationManager1.FindByClientIdAsync(String identifier, CancellationToken cancellationToken)
   at OpenIddict.Core.OpenIddictApplicationManager`1.OpenIddict.Abstractions.IOpenIddictApplicationManager.FindByClientIdAsync(String identifier, CancellationToken cancellationToken)
   at Umbraco.Cms.Infrastructure.Security.OpenIdDictApplicationManagerBase.Delete(String identifier, CancellationToken cancellationToken)
   at
Umbraco.Cms.Api.Delivery.Security.MemberApplicationManager.DeleteMemberApplicationAsync(CancellationToken cancellationToken)
   at Umbraco.Cms.Api.Delivery.Handlers.InitializeMemberApplicationNotificationHandler.HandleAsync(UmbracoApplicationStartingNotification notification, CancellationToken cancellationToken)
   at Umbraco.Cms.Core.Events.INotificationAsyncHandler1.HandleAsync(IEnumerable1 notifications, CancellationToken cancellationToken)
   at Umbraco.Cms.Core.Events.EventAggregator.PublishCoreAsync[TNotification](IEnumerable1 allHandlers, IEnumerable1 notifications, CancellationToken cancellationToken)
   at Umbraco.Cms.Core.Events.NotificationAsyncHandlerWrapperImpl1.HandleAsync[TNotification,TNotificationHandler](IEnumerable1 notifications, CancellationToken cancellationToken, ServiceFactory serviceFactory, Func4 publish)
   at Umbraco.Cms.Core.Events.EventAggregator.PublishNotificationsAsync[TNotification,TNotificationHandler](IEnumerable1 notifications, CancellationToken cancellationToken)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)
   at FFInfo.Program.Main(String[] args) in D:\FFInfo.com Web Site\Program.cs:line 6

I am not good with debuggin but I am willing to give an umbraco dev access to my github and staging environment for testing and debuging.

Just heard back and I am using SQL Server 2019 as a backend DB. So not sure if this is the same problem as those reporting on SQLlite or not.

Migaroez commented 10 months ago

Hey @Eaglef90, this seems to be a similar but not the same issue (i think), they both have to do with Disposed objects that shouldn't be disposed. But the objects are different and you are talking about an upgrade.

They might have the same root cause though. Just to be safe, could you tell me the exact from and to version you are using in the upgrade process?

Migaroez commented 10 months ago

@KevinJump Are you able to reproduce this on the release/13.0 branch?

Eaglef90 commented 10 months ago

@Migaroez I am going from 12.2.0 to 12.3.0

Migaroez commented 10 months ago

@Eaglef90 Could you send me full log files from when the upgrade starts?

Migaroez commented 10 months ago

@KevinJump Sanity check time, could you run the following powershell command in a failing test-project/bin/debug/net8.0 folder? and share the results?

Get-ChildItem -Filter Umbraco.*.dll | Select-Object -ExpandProperty VersionInfo | Format-Table -AutoSize

KevinJump commented 10 months ago

Sure . (haven't had time to test against the branch yet)

Get-ChildItem -Filter Umbraco.*.dll | Select-Object -ExpandProperty VersionInfo | Format-Table -AutoSize

ProductVersion     FileVersion FileName
--------------     ----------- --------
13.0.0-rc1+890da5f 13.0.0.55   C:\Source\Testing\Umbraco\13\SqlLiteTest8\bin\Debug\net8.0\Umbraco.Cms.Api.Common.dll
13.0.0-rc1+890da5f 13.0.0.55   C:\Source\Testing\Umbraco\13\SqlLiteTest8\bin\Debug\net8.0\Umbraco.Cms.Api.Delivery.dll
13.0.0-rc1+890da5f 13.0.0.55   C:\Source\Testing\Umbraco\13\SqlLiteTest8\bin\Debug\net8.0\Umbraco.Cms.Imaging.ImageSharp.dll
13.0.0-rc1+890da5f 13.0.0.55   C:\Source\Testing\Umbraco\13\SqlLiteTest8\bin\Debug\net8.0\Umbraco.Cms.Persistence.EFCore.dll
13.0.0-rc1+890da5f 13.0.0.55   C:\Source\Testing\Umbraco\13\SqlLiteTest8\bin\Debug\net8.0\Umbraco.Cms.Persistence.EFCore.Sqlite.dll
13.0.0-rc1+890da5f 13.0.0.55   C:\Source\Testing\Umbraco\13\SqlLiteTest8\bin\Debug\net8.0\Umbraco.Cms.Persistence.EFCore.SqlServer.dll
13.0.0-rc1+890da5f 13.0.0.55   C:\Source\Testing\Umbraco\13\SqlLiteTest8\bin\Debug\net8.0\Umbraco.Cms.Persistence.Sqlite.dll
13.0.0-rc1+890da5f 13.0.0.55   C:\Source\Testing\Umbraco\13\SqlLiteTest8\bin\Debug\net8.0\Umbraco.Cms.Persistence.SqlServer.dll
13.0.0-rc1+890da5f 13.0.0.55   C:\Source\Testing\Umbraco\13\SqlLiteTest8\bin\Debug\net8.0\Umbraco.Cms.StaticAssets.dll
13.0.0-rc1+890da5f 13.0.0.55   C:\Source\Testing\Umbraco\13\SqlLiteTest8\bin\Debug\net8.0\Umbraco.Core.dll
13.0.0-rc1+890da5f 13.0.0.55   C:\Source\Testing\Umbraco\13\SqlLiteTest8\bin\Debug\net8.0\Umbraco.Examine.Lucene.dll
13.0.0-rc1+890da5f 13.0.0.55   C:\Source\Testing\Umbraco\13\SqlLiteTest8\bin\Debug\net8.0\Umbraco.Infrastructure.dll
13.0.0-rc1+890da5f 13.0.0.55   C:\Source\Testing\Umbraco\13\SqlLiteTest8\bin\Debug\net8.0\Umbraco.PublishedCache.NuCache.dll
13.0.0-rc1+890da5f 13.0.0.55   C:\Source\Testing\Umbraco\13\SqlLiteTest8\bin\Debug\net8.0\Umbraco.Web.BackOffice.dll
13.0.0-rc1+890da5f 13.0.0.55   C:\Source\Testing\Umbraco\13\SqlLiteTest8\bin\Debug\net8.0\Umbraco.Web.Common.dll
13.0.0-rc1+890da5f 13.0.0.55   C:\Source\Testing\Umbraco\13\SqlLiteTest8\bin\Debug\net8.0\Umbraco.Web.Website.dll
KevinJump commented 10 months ago

Hi,

for info just did a clean dotnet nuget locals -c all and built a new site. and it doesn't happen the list is also now diffrent.

Get-ChildItem -Filter Umbraco.*.dll | Select-Object -ExpandProperty VersionInfo | Format-Table -AutoSize

ProductVersion     FileVersion FileName
--------------     ----------- --------
13.0.0-rc1+890da5f 13.0.0.55   C:\Source\Testing\Umbraco\13\SqlLiteTest10\bin\Debug\net8.0\Umbraco.Cms.Api.Common.dll
13.0.0-rc1+06d6109 13.0.0.64   C:\Source\Testing\Umbraco\13\SqlLiteTest10\bin\Debug\net8.0\Umbraco.Cms.Api.Delivery.dll
13.0.0-rc1+06d6109 13.0.0.64   C:\Source\Testing\Umbraco\13\SqlLiteTest10\bin\Debug\net8.0\Umbraco.Cms.Imaging.ImageSharp.dll
13.0.0-rc1+06d6109 13.0.0.64   C:\Source\Testing\Umbraco\13\SqlLiteTest10\bin\Debug\net8.0\Umbraco.Cms.Persistence.EFCore.dll
13.0.0-rc1+06d6109 13.0.0.64   C:\Source\Testing\Umbraco\13\SqlLiteTest10\bin\Debug\net8.0\Umbraco.Cms.Persistence.EFCore.Sqlite.dll
13.0.0-rc1+06d6109 13.0.0.64   C:\Source\Testing\Umbraco\13\SqlLiteTest10\bin\Debug\net8.0\Umbraco.Cms.Persistence.EFCore.SqlServer.dll
13.0.0-rc1+06d6109 13.0.0.64   C:\Source\Testing\Umbraco\13\SqlLiteTest10\bin\Debug\net8.0\Umbraco.Cms.Persistence.Sqlite.dll
13.0.0-rc1+06d6109 13.0.0.64   C:\Source\Testing\Umbraco\13\SqlLiteTest10\bin\Debug\net8.0\Umbraco.Cms.Persistence.SqlServer.dll
13.0.0-rc1+06d6109 13.0.0.64   C:\Source\Testing\Umbraco\13\SqlLiteTest10\bin\Debug\net8.0\Umbraco.Cms.StaticAssets.dll
13.0.0-rc1+06d6109 13.0.0.64   C:\Source\Testing\Umbraco\13\SqlLiteTest10\bin\Debug\net8.0\Umbraco.Core.dll
13.0.0-rc1+06d6109 13.0.0.64   C:\Source\Testing\Umbraco\13\SqlLiteTest10\bin\Debug\net8.0\Umbraco.Examine.Lucene.dll
13.0.0-rc1+06d6109 13.0.0.64   C:\Source\Testing\Umbraco\13\SqlLiteTest10\bin\Debug\net8.0\Umbraco.Infrastructure.dll
13.0.0-rc1+06d6109 13.0.0.64   C:\Source\Testing\Umbraco\13\SqlLiteTest10\bin\Debug\net8.0\Umbraco.PublishedCache.NuCache.dll
13.0.0-rc1+06d6109 13.0.0.64   C:\Source\Testing\Umbraco\13\SqlLiteTest10\bin\Debug\net8.0\Umbraco.Web.BackOffice.dll
13.0.0-rc1+06d6109 13.0.0.64   C:\Source\Testing\Umbraco\13\SqlLiteTest10\bin\Debug\net8.0\Umbraco.Web.Common.dll
13.0.0-rc1+06d6109 13.0.0.64   C:\Source\Testing\Umbraco\13\SqlLiteTest10\bin\Debug\net8.0\Umbraco.Web.Website.dll

i do have the preview nuget feed in my list of sources, so maybe i got the rc1 from there first time ? might not conclusive though, because i've had it build sometimes and fail others ? before this.

Migaroez commented 10 months ago

Mine are all 13.0.0.55 every time and I can still not reproduce it.

KevinJump commented 10 months ago

Reproduced it again. :( dll list is the same as the second one

Eaglef90 commented 10 months ago

@Eaglef90 Could you send me full log files from when the upgrade starts?

I would love to but I am not very smart when it comes to these things and have no idea how to get this data for you.

Migaroez commented 10 months ago

@KevinJump what os+version are you running? when the projects fail?

KevinJump commented 10 months ago
Edition Windows 11 Pro
Version 23H2
Installed on    β€Ž05/β€Ž10/β€Ž2022
OS build    22631.2428
Experience  Windows Feature Experience Pack 1000.22674.1000.0

64-bit

Migaroez commented 10 months ago
Edition   Windows 11 Pro
Version   23H2
Installed on  β€Ž05/β€Ž10/β€Ž2022
OS build  22631.2428
Experience    Windows Feature Experience Pack 1000.22674.1000.0

64-bit

And if possible, can you give me the hotfix list returned by cmd => systeminfo.exe

KevinJump commented 10 months ago

Sure..

Hotfix(s):                 7 Hotfix(s) Installed.
                           [01]: KB5030651
                           [02]: KB5032007
                           [03]: KB5012170
                           [04]: KB5027397
                           [05]: KB5032190
                           [06]: KB5031592
                           [07]: KB5032393
kjac commented 9 months ago

We finally tracked this one down. PR to fix it in #15410

Eaglef90 commented 9 months ago

With an apparent fix found and v13 set to come out in a few days do we know if this will be included in the final release or will we have to wait for a patch version?

bergmania commented 9 months ago

It will be part of 13.0.0 and is part of 12.3.4

marcloveUSN commented 8 months ago

Still not part of 13 :(

bergmania commented 8 months ago

Hi @marcloveUSN..

The PR is part of 13.0.0, so if you experience exactly the same issue, it must be something else underlying. And in that case, please create a new issue.

Also please ensure you do not have any custom code/ packages that requests a EF Core context, before a connection string is set.

enkelmedia commented 8 months ago

For reference: I had no problem installing 13 on the machine where I had this issue.

marcloveUSN commented 8 months ago

@bergmania Will open a new issue. Got a feeling this may be to do with the new ability to add a Weight to package migrations in V13.

creativesuspects commented 8 months ago

I'm still seeing this issue on 13.0.3.

[14:37:50 INF] New table umbracoWebhookRequest was created
[14:37:50 INF] Database configuration status: <p>Installation completed!</p>
[14:37:50 WRN] Connection string changed, disposing context
[14:37:50 ERR] Installation step DatabaseInstall failed.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.AggregateException: One or more errors occurred. (One or more errors occurred. (Cannot access a disposed context instance. A common cause of this error is disposing a context instance that was resolved from dependency injection and then later trying to use the same context instance elsewhere in your application. This may occur if you are calling 'Dispose' on the context instance, or wrapping it in a using statement. If you are using dependency injection, you should let the dependency injection container take care of disposing context instances.
Object name: 'UmbracoDbContext'.))
 ---> System.AggregateException: One or more errors occurred. (Cannot access a disposed context instance. A common cause of this error is disposing a context instance that was resolved from dependency injection and then later trying to use the same context instance elsewhere in your application. This may occur if you are calling 'Dispose' on the context instance, or wrapping it in a using statement. If you are using dependency injection, you should let the dependency injection container take care of disposing context instances.
Object name: 'UmbracoDbContext'.)
 ---> System.ObjectDisposedException: Cannot access a disposed context instance. A common cause of this error is disposing a context instance that was resolved from dependency injection and then later trying to use the same context instance elsewhere in your application. This may occur if you are calling 'Dispose' on the context instance, or wrapping it in a using statement. If you are using dependency injection, you should let the dependency injection container take care of disposing context instances.
Object name: 'UmbracoDbContext'.
   at Microsoft.EntityFrameworkCore.DbContext.CheckDisposed()
   at Microsoft.EntityFrameworkCore.DbContext.get_Database()
   at Umbraco.Cms.Persistence.EFCore.Sqlite.SqliteMigrationProvider.MigrateAllAsync()
   at Umbraco.Cms.Persistence.EFCore.EfCoreMigrationExecutor.ExecuteAllMigrationsAsync()
   at Umbraco.Cms.Persistence.EFCore.Composition.EFCoreCreateTablesNotificationHandler.HandleAsync()
   at Umbraco.Cms.Persistence.EFCore.Composition.EFCoreCreateTablesNotificationHandler.HandleAsync(DatabaseSchemaAndDataCreatedNotification notification, CancellationToken cancellationToken)
   at Umbraco.Cms.Core.Events.INotificationAsyncHandler`1.HandleAsync(IEnumerable`1 notifications, CancellationToken cancellationToken)
   at Umbraco.Cms.Core.Events.EventAggregator.PublishCoreAsync[TNotification](IEnumerable`1 allHandlers, IEnumerable`1 notifications, CancellationToken cancellationToken)
   at Umbraco.Cms.Core.Events.NotificationAsyncHandlerWrapperImpl`1.HandleAsync[TNotification,TNotificationHandler](IEnumerable`1 notifications, CancellationToken cancellationToken, ServiceFactory serviceFactory, Func`4 publish)
   at Umbraco.Cms.Core.Events.EventAggregator.PublishNotificationsAsync[TNotification,TNotificationHandler](IEnumerable`1 notifications, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.WaitAllCore(Task[] tasks, Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.WaitAll(Task[] tasks)
   at Umbraco.Cms.Core.Events.EventAggregator.Publish[TNotification,TNotificationHandler](IEnumerable`1 notifications)
   at Umbraco.Cms.Core.Events.ScopedNotificationPublisher`1.PublishScopedNotifications(IList`1 notifications)
   at Umbraco.Cms.Core.Events.ScopedNotificationPublisher`1.ScopeExit(Boolean completed)
   at Umbraco.Cms.Core.Scoping.CoreScope.HandleScopedNotifications()
   at Umbraco.Cms.Infrastructure.Scoping.Scope.TryFinally(Action[] actions)
   --- End of inner exception stack trace ---
   at Umbraco.Cms.Infrastructure.Scoping.Scope.TryFinally(Action[] actions)
   at Umbraco.Cms.Infrastructure.Scoping.Scope.RobustExit(Boolean completed, Boolean onException)
   at Umbraco.Cms.Infrastructure.Scoping.Scope.DisposeLastScope()
   at Umbraco.Cms.Infrastructure.Scoping.Scope.Dispose()
   at Umbraco.Cms.Infrastructure.Migrations.Install.DatabaseBuilder.CreateSchemaAndData()
   at Umbraco.Cms.Infrastructure.Install.InstallSteps.DatabaseInstallStep.ExecuteAsync(Object model)
   at InvokeStub_InstallSetupStep`1.ExecuteAsync(Object, Span`1)
   at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   --- End of inner exception stack trace ---
   at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at Umbraco.Cms.Web.BackOffice.Install.InstallApiController.ExecuteStepAsync(InstallSetupStep step, Object instruction)
   at Umbraco.Cms.Web.BackOffice.Install.InstallApiController.PostPerformInstall(InstallInstructions installModel)

@marcloveUSN Did you already open a new issue?

bergmania commented 8 months ago

@creativesuspects is this on a plain new project?

It can definitely still happen, if you start up a EF Core context before there is a connection string, this will happen. Ensure non of you code do that when in install mode (and there do not exist a connection string).

What happened in the original bug, was that OpenIddict somewhere in a constructor started a EFCore context. So when a specific service was injected into one of our constructor, a EF core context was created. Instead we now request that service when needed. (https://github.com/umbraco/Umbraco-CMS/commit/d752853d8955a92b527550a82e340c4986a5b817#diff-66cee26fd3ce34df24f24410e528403b5b91d48d7e74f82c879dcd3a9bba5a09)

creativesuspects commented 8 months ago

@bergmania This was on a clean 13.0.3 install without any custom code:

dotnet new install Umbraco.Templates::13.0.3
dotnet new umbraco -n Umbraco.Cms.13x
cd .\Umbraco.Cms.13x\
dotnet build
dotnet run

I open the site and fill out the 'Install Umbraco' screen, hit the 'Install' button and then I get the same error message as the OP.

When I delete the erroneous SQLite database, remove the connection string from appsettings and enable the unattended install (with the same details) the installation process completes without any issues.

I don't know if it helps, but you can download the project below. The zip also contains the erroneous database and logs from immediately after the failed install and a single attempt to load the site afterwards.

https://www.dropbox.com/scl/fi/5vg2cr1zp3xhj2e9oo8ia/Umbraco.Cms.13x.zip?rlkey=2mmixn1prn5ml6e8ud5irhlib&dl=0

bergmania commented 8 months ago

Hmm.. Seems like another bug yes. Wonder if it would solve it, if DatabaseSchemaAndDataCreatedNotification was published as a cancelable notification, and thereby execute faster.

It seems again like a timing issue, that only his very few,

creativesuspects commented 8 months ago

Not sure if it helps, but I didn't run into this issue when installing into a SQL Server database.

niekvanderreest commented 7 months ago

Hi,

I'm running into "Connection string changed, disposing context" warnings after upgrading a project from umbraco 11.5 to 12.3.6, i don't see any errors and functionality seems to be what is was, but the warnings occur running an async task on and efCoreScopeProvider scope.

The project has Hangfire running on the umbraco database, the warnings occur while running a Hangfire job

image

Any idea if this is related, i would like to know the impact before pushing my upgrade to live (project is hosted on Umbraco Cloud)

bergmania commented 7 months ago

Hi @niekvanderreest

Sounds like your hangfire is booting too early? Please ensure it do not start, before a connection string is set.

As long as you have a connectionstring in your appsettings/environment varable, there should be no risk related to this.

smarshallsay commented 7 months ago

I get this on 13.0.3 if using SQLite, SQL Server is fine.

To reproduce I delete umbraco folder, delete connectionstrings from config and load webpage to initialise Umbraco install.

enkelmedia commented 7 months ago

I've also got this error now when running Umbraco.Web.UI in the source repository from this commit 860acd7ba18f0d8f8015932bb5c676c0341ec480. The error was shown just after the database-options screen in the setup.

image

After that, I restart the site and get:

An error occurred while starting the application.
SqliteException: SQLite Error 1: 'no such table: umbracoOpenIddictApplications'.
Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(int rc, sqlite3 db)

SqliteException: SQLite Error 1: 'no such table: umbracoOpenIddictApplications'.
Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(int rc, sqlite3 db)
Microsoft.Data.Sqlite.SqliteCommand.PrepareAndEnumerateStatements()+MoveNext()
Microsoft.Data.Sqlite.SqliteCommand.GetStatements()+MoveNext()
Microsoft.Data.Sqlite.SqliteDataReader.NextResult()
Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
Microsoft.Data.Sqlite.SqliteCommand.ExecuteReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)
Microsoft.Data.Sqlite.SqliteCommand.ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)
Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable<T>+AsyncEnumerator.InitializeReaderAsync(AsyncEnumerator enumerator, CancellationToken cancellationToken)
Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable<T>+AsyncEnumerator.MoveNextAsync()
System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable<TResult>+ConfiguredValueTaskAwaiter.GetResult()
Microsoft.EntityFrameworkCore.Query.ShapedQueryCompilingExpressionVisitor.SingleOrDefaultAsync<TSource>(IAsyncEnumerable<TSource> asyncEnumerable, CancellationToken cancellationToken)
Microsoft.EntityFrameworkCore.Query.ShapedQueryCompilingExpressionVisitor.SingleOrDefaultAsync<TSource>(IAsyncEnumerable<TSource> asyncEnumerable, CancellationToken cancellationToken)
OpenIddict.EntityFrameworkCore.OpenIddictEntityFrameworkCoreApplicationStore<TApplication, TAuthorization, TToken, TContext, TKey>.FindByClientIdAsync(string identifier, CancellationToken cancellationToken)
System.Threading.Tasks.ValueTask<TResult>.get_Result()

Here is how to reproduce the error:

https://github.com/umbraco/Umbraco-CMS/assets/1782524/1771f3d8-d4ca-49b0-956e-3a3bc82d8c0d

bergmania commented 7 months ago

Hi @enkelmedia.

Thanks for the video, and nice you can reproduce in our codebase. Obviously I can't as it seems to be a timing issue. What I do not really understand is, how your code just executed UmbracoDbContext.ConfigureOptions and bypassed the check string.IsNullOrWhiteSpace(connectionStrings.ConnectionString), and then afterwards call the OnChange om the OptionsMonitor. I'll have to look into the options monitor to understand.