It seems that when I upgrade from 12.2.0 to 12.3.0 via NuGet my site will break when I publish to stating or production, but it works fine on my local dev. I get the following info
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.
If I downgrade from 12.3.0 back to 12.2.0 and redeploy my staging/production sites work fine. I can then make no changes at all exepct to upgrade back to 12.3.0 and it will once again break with this error. Why is 12.3 breaking my site?
Matthew Alexandros
OP
— 11/06/2023 4:28 PM
:\HostingSpaces\ffinfoco\ffinfo.com1J3tkwT0\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.SetTEntity
at OpenIddict.EntityFrameworkCore.OpenIddictEntityFrameworkCoreApplicationStore5.getApplications()
at OpenIddict.EntityFrameworkCore.OpenIddictEntityFrameworkCoreApplicationStore5.FindByClientIdAsync(String identifier, CancellationToken cancellationToken)
at OpenIddict.Core.OpenIddictApplicationCache1.<>cDisplayClass6_0.<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 asked about this almost a week ago in the discord but have not gotten any help so hoping I might get some better visibility here.
If there is some place more eyes on to umbraco support people please let me know.
Error upgrading to 12.3.0 from 12.2.0
It seems that when I upgrade from 12.2.0 to 12.3.0 via NuGet my site will break when I publish to stating or production, but it works fine on my local dev. I get the following info
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.
If I downgrade from 12.3.0 back to 12.2.0 and redeploy my staging/production sites work fine. I can then make no changes at all exepct to upgrade back to 12.3.0 and it will once again break with this error. Why is 12.3 breaking my site? Matthew Alexandros OP — 11/06/2023 4:28 PM :\HostingSpaces\ffinfoco\ffinfo.com1J3tkwT0\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.SetTEntity at OpenIddict.EntityFrameworkCore.OpenIddictEntityFrameworkCoreApplicationStore5.getApplications() at OpenIddict.EntityFrameworkCore.OpenIddictEntityFrameworkCoreApplicationStore5.FindByClientIdAsync(String identifier, CancellationToken cancellationToken) at OpenIddict.Core.OpenIddictApplicationCache1.<>cDisplayClass6_0.<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 asked about this almost a week ago in the discord but have not gotten any help so hoping I might get some better visibility here.
If there is some place more eyes on to umbraco support people please let me know.
is working on a reply...