Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Pedro Mendes 53 posts 258 karma points
    Aug 12, 2023 @ 01:24
    Pedro Mendes
    0

    Umbraco v11 middleware boot failed turned into v12 error while starting application

    Hey there all

    My Umbraco v11 started to throw "boot failed" errors regarding middleware and I, after spending too many hours searching for the cause of the problem, updated it to v12.1.0 hoping it would somehow solve the issue.

    Well, it didn't xD It is even worse. What was a Boot fail has now turned into an error prior to Umbraco boot.

    I'll paste all the exception here knowing it's quite lengthy so I apologize in advance 😅

    I hope someone has been through this because I'm at a loss here.

    Thank you!


    System.AggregateException: Some services are not able to be constructed (Error while validating the service descriptor 'ServiceType: Umbraco.Cms.Persistence.EFCore.Migrations.IMigrationProvider Lifetime: Singleton ImplementationType: Umbraco.Cms.Persistence.EFCore.SqlServer.SqlServerMigrationProvider': Unable to resolve service for type 'Microsoft.EntityFrameworkCore.IDbContextFactory1[Umbraco.Cms.Persistence.EFCore.UmbracoDbContext]' while attempting to activate 'Umbraco.Cms.Persistence.EFCore.SqlServer.SqlServerMigrationProvider'.) (Error while validating the service descriptor 'ServiceType: Umbraco.Cms.Persistence.EFCore.Migrations.IMigrationProvider Lifetime: Singleton ImplementationType: Umbraco.Cms.Persistence.EFCore.Sqlite.SqliteMigrationProvider': Unable to resolve service for type 'Microsoft.EntityFrameworkCore.IDbContextFactory1[Umbraco.Cms.Persistence.EFCore.UmbracoDbContext]' while attempting to activate 'Umbraco.Cms.Persistence.EFCore.Sqlite.SqliteMigrationProvider'.) (Error while validating the service descriptor 'ServiceType: Umbraco.Cms.Infrastructure.Migrations.IEFCoreMigrationExecutor Lifetime: Singleton ImplementationType: Umbraco.Cms.Persistence.EFCore.EfCoreMigrationExecutor': Unable to resolve service for type 'Microsoft.EntityFrameworkCore.IDbContextFactory1[Umbraco.Cms.Persistence.EFCore.UmbracoDbContext]' while attempting to activate 'Umbraco.Cms.Persistence.EFCore.SqlServer.SqlServerMigrationProvider'.) (Error while validating the service descriptor 'ServiceType: Umbraco.Cms.Core.Events.INotificationAsyncHandler1[Umbraco.Cms.Infrastructure.Migrations.Notifications.DatabaseSchemaAndDataCreatedNotification] Lifetime: Transient ImplementationType: Umbraco.Cms.Persistence.EFCore.Composition.EFCoreCreateTablesNotificationHandler': Unable to resolve service for type 'Microsoft.EntityFrameworkCore.IDbContextFactory1[Umbraco.Cms.Persistence.EFCore.UmbracoDbContext]' while attempting to activate 'Umbraco.Cms.Persistence.EFCore.SqlServer.SqlServerMigrationProvider'.) (Error while validating the service descriptor 'ServiceType: Umbraco.Cms.Core.Events.INotificationAsyncHandler1[Umbraco.Cms.Core.Notifications.UnattendedInstallNotification] Lifetime: Transient ImplementationType: Umbraco.Cms.Persistence.EFCore.Composition.EFCoreCreateTablesNotificationHandler': Unable to resolve service for type 'Microsoft.EntityFrameworkCore.IDbContextFactory1[Umbraco.Cms.Persistence.EFCore.UmbracoDbContext]' while attempting to activate 'Umbraco.Cms.Persistence.EFCore.SqlServer.SqlServerMigrationProvider'.) ---> System.InvalidOperationException: Error while validating the service descriptor 'ServiceType: Umbraco.Cms.Persistence.EFCore.Migrations.IMigrationProvider Lifetime: Singleton ImplementationType: Umbraco.Cms.Persistence.EFCore.SqlServer.SqlServerMigrationProvider': Unable to resolve service for type 'Microsoft.EntityFrameworkCore.IDbContextFactory1[Umbraco.Cms.Persistence.EFCore.UmbracoDbContext]' while attempting to activate 'Umbraco.Cms.Persistence.EFCore.SqlServer.SqlServerMigrationProvider'. ---> System.InvalidOperationException: Unable to resolve service for type 'Microsoft.EntityFrameworkCore.IDbContextFactory1[Umbraco.Cms.Persistence.EFCore.UmbracoDbContext]' while attempting to activate 'Umbraco.Cms.Persistence.EFCore.SqlServer.SqlServerMigrationProvider'. at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateArgumentCallSites(Type implementationType, CallSiteChain callSiteChain, ParameterInfo[] parameters, Boolean throwIfCallSiteNotFound) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateConstructorCallSite(ResultCache lifetime, Type serviceType, Type implementationType, CallSiteChain callSiteChain) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.TryCreateExact(ServiceDescriptor descriptor, Type serviceType, CallSiteChain callSiteChain, Int32 slot) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.GetCallSite(ServiceDescriptor serviceDescriptor, CallSiteChain callSiteChain) at Microsoft.Extensions.DependencyInjection.ServiceProvider.ValidateService(ServiceDescriptor descriptor) --- End of inner exception stack trace --- at Microsoft.Extensions.DependencyInjection.ServiceProvider.ValidateService(ServiceDescriptor descriptor) at Microsoft.Extensions.DependencyInjection.ServiceProvider..ctor(ICollection1 serviceDescriptors, ServiceProviderOptions options) --- End of inner exception stack trace --- at Microsoft.Extensions.DependencyInjection.ServiceProvider..ctor(ICollection1 serviceDescriptors, ServiceProviderOptions options) at Microsoft.Extensions.DependencyInjection.ServiceCollectionContainerBuilderExtensions.BuildServiceProvider(IServiceCollection services, ServiceProviderOptions options) at Microsoft.Extensions.Hosting.HostBuilder.InitializeServiceProvider() at Microsoft.Extensions.Hosting.HostBuilder.Build() at Umbraco.Cms.Web.Common.Hosting.UmbracoHostBuilderDecorator.Build() at Beachcam.Web.Program.Main(String[] args) in C:\Development\8i\NewBeachcam\Beachcam.Web\Program.cs:line 6 ---> (Inner Exception #1) System.InvalidOperationException: Error while validating the service descriptor 'ServiceType: Umbraco.Cms.Persistence.EFCore.Migrations.IMigrationProvider Lifetime: Singleton ImplementationType: Umbraco.Cms.Persistence.EFCore.Sqlite.SqliteMigrationProvider': Unable to resolve service for type 'Microsoft.EntityFrameworkCore.IDbContextFactory1[Umbraco.Cms.Persistence.EFCore.UmbracoDbContext]' while attempting to activate 'Umbraco.Cms.Persistence.EFCore.Sqlite.SqliteMigrationProvider'. ---> System.InvalidOperationException: Unable to resolve service for type 'Microsoft.EntityFrameworkCore.IDbContextFactory1[Umbraco.Cms.Persistence.EFCore.UmbracoDbContext]' while attempting to activate 'Umbraco.Cms.Persistence.EFCore.Sqlite.SqliteMigrationProvider'. at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateArgumentCallSites(Type implementationType, CallSiteChain callSiteChain, ParameterInfo[] parameters, Boolean throwIfCallSiteNotFound) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateConstructorCallSite(ResultCache lifetime, Type serviceType, Type implementationType, CallSiteChain callSiteChain) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.TryCreateExact(ServiceDescriptor descriptor, Type serviceType, CallSiteChain callSiteChain, Int32 slot) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.GetCallSite(ServiceDescriptor serviceDescriptor, CallSiteChain callSiteChain) at Microsoft.Extensions.DependencyInjection.ServiceProvider.ValidateService(ServiceDescriptor descriptor) --- End of inner exception stack trace --- at Microsoft.Extensions.DependencyInjection.ServiceProvider.ValidateService(ServiceDescriptor descriptor) at Microsoft.Extensions.DependencyInjection.ServiceProvider..ctor(ICollection1 serviceDescriptors, ServiceProviderOptions options)<---

    ---> (Inner Exception #2) System.InvalidOperationException: Error while validating the service descriptor 'ServiceType: Umbraco.Cms.Infrastructure.Migrations.IEFCoreMigrationExecutor Lifetime: Singleton ImplementationType: Umbraco.Cms.Persistence.EFCore.EfCoreMigrationExecutor': Unable to resolve service for type 'Microsoft.EntityFrameworkCore.IDbContextFactory1[Umbraco.Cms.Persistence.EFCore.UmbracoDbContext]' while attempting to activate 'Umbraco.Cms.Persistence.EFCore.SqlServer.SqlServerMigrationProvider'. ---> System.InvalidOperationException: Unable to resolve service for type 'Microsoft.EntityFrameworkCore.IDbContextFactory1[Umbraco.Cms.Persistence.EFCore.UmbracoDbContext]' while attempting to activate 'Umbraco.Cms.Persistence.EFCore.SqlServer.SqlServerMigrationProvider'. at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateArgumentCallSites(Type implementationType, CallSiteChain callSiteChain, ParameterInfo[] parameters, Boolean throwIfCallSiteNotFound) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateConstructorCallSite(ResultCache lifetime, Type serviceType, Type implementationType, CallSiteChain callSiteChain) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.TryCreateExact(ServiceDescriptor descriptor, Type serviceType, CallSiteChain callSiteChain, Int32 slot) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.TryCreateEnumerable(Type serviceType, CallSiteChain callSiteChain) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateCallSite(Type serviceType, CallSiteChain callSiteChain) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.GetCallSite(Type serviceType, CallSiteChain callSiteChain) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateArgumentCallSites(Type implementationType, CallSiteChain callSiteChain, ParameterInfo[] parameters, Boolean throwIfCallSiteNotFound) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateConstructorCallSite(ResultCache lifetime, Type serviceType, Type implementationType, CallSiteChain callSiteChain) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.TryCreateExact(ServiceDescriptor descriptor, Type serviceType, CallSiteChain callSiteChain, Int32 slot) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.GetCallSite(ServiceDescriptor serviceDescriptor, CallSiteChain callSiteChain) at Microsoft.Extensions.DependencyInjection.ServiceProvider.ValidateService(ServiceDescriptor descriptor) --- End of inner exception stack trace --- at Microsoft.Extensions.DependencyInjection.ServiceProvider.ValidateService(ServiceDescriptor descriptor) at Microsoft.Extensions.DependencyInjection.ServiceProvider..ctor(ICollection`1 serviceDescriptors, ServiceProviderOptions options)<---

    ---> (Inner Exception #3) System.InvalidOperationException: Error while validating the service descriptor 'ServiceType: Umbraco.Cms.Core.Events.INotificationAsyncHandler1[Umbraco.Cms.Infrastructure.Migrations.Notifications.DatabaseSchemaAndDataCreatedNotification] Lifetime: Transient ImplementationType: Umbraco.Cms.Persistence.EFCore.Composition.EFCoreCreateTablesNotificationHandler': Unable to resolve service for type 'Microsoft.EntityFrameworkCore.IDbContextFactory1[Umbraco.Cms.Persistence.EFCore.UmbracoDbContext]' while attempting to activate 'Umbraco.Cms.Persistence.EFCore.SqlServer.SqlServerMigrationProvider'. ---> System.InvalidOperationException: Unable to resolve service for type 'Microsoft.EntityFrameworkCore.IDbContextFactory1[Umbraco.Cms.Persistence.EFCore.UmbracoDbContext]' while attempting to activate 'Umbraco.Cms.Persistence.EFCore.SqlServer.SqlServerMigrationProvider'. at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateArgumentCallSites(Type implementationType, CallSiteChain callSiteChain, ParameterInfo[] parameters, Boolean throwIfCallSiteNotFound) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateConstructorCallSite(ResultCache lifetime, Type serviceType, Type implementationType, CallSiteChain callSiteChain) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.TryCreateExact(ServiceDescriptor descriptor, Type serviceType, CallSiteChain callSiteChain, Int32 slot) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.TryCreateEnumerable(Type serviceType, CallSiteChain callSiteChain) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateCallSite(Type serviceType, CallSiteChain callSiteChain) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.GetCallSite(Type serviceType, CallSiteChain callSiteChain) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateArgumentCallSites(Type implementationType, CallSiteChain callSiteChain, ParameterInfo[] parameters, Boolean throwIfCallSiteNotFound) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateConstructorCallSite(ResultCache lifetime, Type serviceType, Type implementationType, CallSiteChain callSiteChain) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.TryCreateExact(ServiceDescriptor descriptor, Type serviceType, CallSiteChain callSiteChain, Int32 slot) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateCallSite(Type serviceType, CallSiteChain callSiteChain) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.GetCallSite(Type serviceType, CallSiteChain callSiteChain) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateArgumentCallSites(Type implementationType, CallSiteChain callSiteChain, ParameterInfo[] parameters, Boolean throwIfCallSiteNotFound) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateConstructorCallSite(ResultCache lifetime, Type serviceType, Type implementationType, CallSiteChain callSiteChain) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.TryCreateExact(ServiceDescriptor descriptor, Type serviceType, CallSiteChain callSiteChain, Int32 slot) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.GetCallSite(ServiceDescriptor serviceDescriptor, CallSiteChain callSiteChain) at Microsoft.Extensions.DependencyInjection.ServiceProvider.ValidateService(ServiceDescriptor descriptor) --- End of inner exception stack trace --- at Microsoft.Extensions.DependencyInjection.ServiceProvider.ValidateService(ServiceDescriptor descriptor) at Microsoft.Extensions.DependencyInjection.ServiceProvider..ctor(ICollection1 serviceDescriptors, ServiceProviderOptions options)<---

    ---> (Inner Exception #4) System.InvalidOperationException: Error while validating the service descriptor 'ServiceType: Umbraco.Cms.Core.Events.INotificationAsyncHandler1[Umbraco.Cms.Core.Notifications.UnattendedInstallNotification] Lifetime: Transient ImplementationType: Umbraco.Cms.Persistence.EFCore.Composition.EFCoreCreateTablesNotificationHandler': Unable to resolve service for type 'Microsoft.EntityFrameworkCore.IDbContextFactory1[Umbraco.Cms.Persistence.EFCore.UmbracoDbContext]' while attempting to activate 'Umbraco.Cms.Persistence.EFCore.SqlServer.SqlServerMigrationProvider'. ---> System.InvalidOperationException: Unable to resolve service for type 'Microsoft.EntityFrameworkCore.IDbContextFactory1[Umbraco.Cms.Persistence.EFCore.UmbracoDbContext]' while attempting to activate 'Umbraco.Cms.Persistence.EFCore.SqlServer.SqlServerMigrationProvider'. at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateArgumentCallSites(Type implementationType, CallSiteChain callSiteChain, ParameterInfo[] parameters, Boolean throwIfCallSiteNotFound) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateConstructorCallSite(ResultCache lifetime, Type serviceType, Type implementationType, CallSiteChain callSiteChain) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.TryCreateExact(ServiceDescriptor descriptor, Type serviceType, CallSiteChain callSiteChain, Int32 slot) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.TryCreateEnumerable(Type serviceType, CallSiteChain callSiteChain) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateCallSite(Type serviceType, CallSiteChain callSiteChain) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.GetCallSite(Type serviceType, CallSiteChain callSiteChain) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateArgumentCallSites(Type implementationType, CallSiteChain callSiteChain, ParameterInfo[] parameters, Boolean throwIfCallSiteNotFound) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateConstructorCallSite(ResultCache lifetime, Type serviceType, Type implementationType, CallSiteChain callSiteChain) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.TryCreateExact(ServiceDescriptor descriptor, Type serviceType, CallSiteChain callSiteChain, Int32 slot) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateCallSite(Type serviceType, CallSiteChain callSiteChain) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.GetCallSite(Type serviceType, CallSiteChain callSiteChain) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateArgumentCallSites(Type implementationType, CallSiteChain callSiteChain, ParameterInfo[] parameters, Boolean throwIfCallSiteNotFound) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateConstructorCallSite(ResultCache lifetime, Type serviceType, Type implementationType, CallSiteChain callSiteChain) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.TryCreateExact(ServiceDescriptor descriptor, Type serviceType, CallSiteChain callSiteChain, Int32 slot) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.GetCallSite(ServiceDescriptor serviceDescriptor, CallSiteChain callSiteChain) at Microsoft.Extensions.DependencyInjection.ServiceProvider.ValidateService(ServiceDescriptor descriptor) --- End of inner exception stack trace --- at Microsoft.Extensions.DependencyInjection.ServiceProvider.ValidateService(ServiceDescriptor descriptor) at Microsoft.Extensions.DependencyInjection.ServiceProvider..ctor(ICollection1 serviceDescriptors, ServiceProviderOptions options)<---

  • Pedro Mendes 53 posts 258 karma points
    Aug 12, 2023 @ 17:50
    Pedro Mendes
    0

    After some trial and error, I noticed v12.0.0 is ok so I'm sticking to it for now..

    Don't know what I can do to reproduce this issue.. I'm afraid to be stuck with v12.0.0 forever :(

  • Pedro Mendes 53 posts 258 karma points
    Aug 12, 2023 @ 18:13
    Pedro Mendes
    0

    Ok, I was able to update Umbraco to v12.0.1 and everything worked.

    When I updated to v12.1.0, "An error occurred while starting the application" like in the first post appeared again.

    Has anyone successfully updated to Umbraco 12.1.0?

  • Pedro Mendes 53 posts 258 karma points
    Aug 12, 2023 @ 18:22
    Pedro Mendes
    100

    I managed to cross by this issue which had exactly my problem (I have no idea why it didn't show up when googling).

    The issue is .AddDeliveryApi()is missing in Startup.ConfigureServices

    I went from:

    public void ConfigureServices(IServiceCollection services)
    {
       (...)
    
      services.AddUmbraco(_env, _config)
              .AddBackOffice()
              .AddWebsite()
              .AddComposers()
              .AddCustomNotifications()
              .Build();
     }
    

    to:

    public void ConfigureServices(IServiceCollection services)
    {
       (...)
    
      services.AddUmbraco(_env, _config)
              .AddBackOffice()
              .AddWebsite()
              .AddDeliveryApi()
              .AddComposers()
              .AddCustomNotifications()
              .Build();
     }
    

    (add .AddDeliveryApi() right after .AddWebsite() and all is well now.

Please Sign in or register to post replies

Write your reply to:

Draft