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

Startup error after configuring blob storage #14452

Closed cadehymer closed 1 year ago

cadehymer commented 1 year ago

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

12.0.0-rc4

Bug summary

On a clean install of 12.0.0-rc4, after adding configuration for Azure blob storage, application throws an error during startup.

Specifics

An error occurred while starting the application. TypeLoadException: Method 'ExecuteQuery' in type 'Umbraco.Cms.Api.Delivery.Services.ApiContentQueryService' from assembly 'Umbraco.Cms.Api.Delivery, Version=12.0.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation. Unknown location

ReflectionTypeLoadException: Could not load all types from "Umbraco.Cms.Api.Delivery, Version=12.0.0.0, Culture=neutral, PublicKeyToken=null" due to LoaderExceptions, skipping: . System.TypeLoadException on Umbraco.Cms.Api.Delivery.Services.ApiContentQueryService: Method 'ExecuteQuery' in type 'Umbraco.Cms.Api.Delivery.Services.ApiContentQueryService' from assembly 'Umbraco.Cms.Api.Delivery, Version=12.0.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.

Method 'ExecuteQuery' in type 'Umbraco.Cms.Api.Delivery.Services.ApiContentQueryService' from assembly 'Umbraco.Cms.Api.Delivery, Version=12.0.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation. Umbraco.Cms.Core.Composing.TypeFinder.GetTypesWithFormattedException(Assembly a)

Loader Exceptions: Method 'ExecuteQuery' in type 'Umbraco.Cms.Api.Delivery.Services.ApiContentQueryService' from assembly 'Umbraco.Cms.Api.Delivery, Version=12.0.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation. TypeLoadException: Method 'ExecuteQuery' in type 'Umbraco.Cms.Api.Delivery.Services.ApiContentQueryService' from assembly 'Umbraco.Cms.Api.Delivery, Version=12.0.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.

Show raw exception details ReflectionTypeLoadException: Could not load all types from "Umbraco.Cms.Api.Delivery, Version=12.0.0.0, Culture=neutral, PublicKeyToken=null" due to LoaderExceptions, skipping: . System.TypeLoadException on Umbraco.Cms.Api.Delivery.Services.ApiContentQueryService: Method 'ExecuteQuery' in type 'Umbraco.Cms.Api.Delivery.Services.ApiContentQueryService' from assembly 'Umbraco.Cms.Api.Delivery, Version=12.0.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation. Method 'ExecuteQuery' in type 'Umbraco.Cms.Api.Delivery.Services.ApiContentQueryService' from assembly 'Umbraco.Cms.Api.Delivery, Version=12.0.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation. Umbraco.Cms.Core.Composing.TypeFinder.GetTypesWithFormattedException(Assembly a) Umbraco.Cms.Core.Composing.TypeFinder.GetClassesWithBaseType(Type baseType, IEnumerable assemblies, bool onlyConcreteClasses, Func<Type, bool> additionalFilter) Umbraco.Cms.Core.Composing.TypeFinder.FindClassesOfType(Type assignTypeFrom, IEnumerable assemblies, bool onlyConcreteClasses) Umbraco.Extensions.TypeFinderExtensions.FindClassesOfType(ITypeFinder typeFinder, IEnumerable assemblies, bool onlyConcreteClasses) Umbraco.Cms.Core.Composing.TypeLoader+<>cDisplayClass21_0.b0() Umbraco.Cms.Core.Composing.TypeLoader.GetTypesInternalLocked(Type baseType, Type attributeType, Func<IEnumerable> finder, string action, bool cache) Umbraco.Cms.Core.Composing.TypeLoader.GetTypesInternal(Type baseType, Type attributeType, Func<IEnumerable> finder, string action, bool cache) Umbraco.Cms.Core.Composing.TypeLoader.GetTypes(bool cache, IEnumerable specificAssemblies) Umbraco.Cms.Core.DependencyInjection.UmbracoBuilderExtensions.AddAllCoreCollectionBuilders(IUmbracoBuilder builder) Umbraco.Cms.Core.DependencyInjection.UmbracoBuilder.AddCoreServices() Umbraco.Cms.Core.DependencyInjection.UmbracoBuilder..ctor(IServiceCollection services, IConfiguration config, TypeLoader typeLoader, ILoggerFactory loggerFactory, IProfiler profiler, AppCaches appCaches, IHostingEnvironment hostingEnvironment) Umbraco.Extensions.UmbracoBuilderExtensions.AddUmbraco(IServiceCollection services, IWebHostEnvironment webHostEnvironment, IConfiguration config) ICO.Web.Startup.ConfigureServices(IServiceCollection services) in Startup.cs + services.AddUmbraco(_env, _config) System.RuntimeMethodHandle.InvokeMethod(object target, Void* arguments, Signature sig, bool isConstructor) System.Reflection.MethodInvoker.Invoke(object obj, IntPtr args, BindingFlags invokeAttr) System.Reflection.RuntimeMethodInfo.Invoke(object obj, BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture) Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.InvokeCore(object instance, IServiceCollection services) Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.UseStartup(Type startupType, HostBuilderContext context, IServiceCollection services, object instance) Microsoft.AspNetCore.Hosting.GenericWebHostBuilder+<>cDisplayClass14_0.b0(HostBuilderContext context, IServiceCollection services) Microsoft.Extensions.Hosting.HostBuilder.InitializeServiceProvider() Microsoft.Extensions.Hosting.HostBuilder.Build() Umbraco.Cms.Web.Common.Hosting.UmbracoHostBuilderDecorator.Build() ICO.Web.Program.Main(string[] args) in Program.cs + => CreateHostBuilder(args)

Show raw exception details .NET 7.0.7 X64 v7.0.0.0 | Microsoft.AspNetCore.Hosting version 7.0.5+d47e49e9c1e173ac90821f7e89cc38e710274241 | Microsoft Windows 10.0.19045 | Need help?

Steps to reproduce

Create a new vanilla project as described here. Setup blob storage as described here. Run the project.

Expected result / actual result

No response

github-actions[bot] commented 1 year ago

Hi there @cadehymer!

Firstly, a big thank you for raising this issue. Every piece of feedback we receive helps us to make Umbraco better.

We really appreciate your patience while we wait for our team to have a look at this but we wanted to let you know that we see this and share with you the plan for what comes next.

We wish we could work with everyone directly and assess your issue immediately but we're in the fortunate position of having lots of contributions to work with and only a few humans who are able to do it. We are making progress though and in the meantime, we will keep you in the loop and let you know when we have any questions.

Thanks, from your friendly Umbraco GitHub bot :robot: :slightly_smiling_face:

kjac commented 1 year ago

Hi @cadehymer,

Thanks for reaching out 👏

I can't really reproduce this. But if you're following the docs for the storage providers exactly to the point, I do suspect you might have a version conflict.

You must install the latest RC versions of Umbraco.StorageProviders.AzureBlob and Umbraco.StorageProviders.AzureBlob.ImageSharp to test them with Umbraco 12.0.0-rc4. At the time of writing, you need:

dotnet add package Umbraco.StorageProviders.AzureBlob --version 12.0.0-rc3
dotnet add package Umbraco.StorageProviders.AzureBlob.ImageSharp --version 12.0.0-rc3

As mentioned I can't reproduce this so I'm going to close it as a non-issue. If you keep experiencing problems with the storage providers, please don't hesitate to reopen the issue with additional steps to reproduce 😄