Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V9 Error when trying to add extra languages in the back office #11365

Closed
Aaen opened this issue Oct 13, 2021 · 4 comments
Closed

V9 Error when trying to add extra languages in the back office #11365

Aaen opened this issue Oct 13, 2021 · 4 comments
Labels

Comments

@Aaen
Copy link
Contributor

Aaen commented Oct 13, 2021

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

This is on Umbraco 9.0.1

Bug summary

When you wnt to add more than the default language in the backoffice you get an error and no dropdown list to choose from

Specifics

So the issue is when you are in settings -- > Languages -- > Add Language
I have tried in both Safri and Chrome on a Macbook Pro - the project was created on Umbraco Cloud

Steps to reproduce

  1. Set up a Umbraco 9 project
  2. Go to Settings
  3. Go to languages
  4. Add a new language

Then you will see the error at the bottom of the page and the dropdown with all languages are also gone

In the log, we get the following error

System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'IServiceProvider'.
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ThrowHelper.ThrowObjectDisposedException()
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)
at Umbraco.Cms.Core.Events.ServiceFactoryExtensions.GetInstances[T](ServiceFactory factory)
at Umbraco.Cms.Core.Events.NotificationHandlerWrapperImpl1.Handle(INotification notification, ServiceFactory serviceFactory, Action2 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.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.Server.IIS.Core.IISHttpContextOfT`1.ProcessRequestAsync()

Expected result / actual result

I would expect that I could add more languages so you can work with the variants as we introduced in Umbraco 8
https://our.umbraco.com/Documentation/Fundamentals/Backoffice/Variants/

So you don´t need to create a root node for each language you have

@Aaen Aaen added the type/bug label Oct 13, 2021
@patrickdemooij9
Copy link
Contributor

Just tested this on an environment that we have on the latest Umbraco version (9.0.1), but I can't reproduce it. Maybe it's an Umbraco cloud issue?

@DavidVonAmri
Copy link

DavidVonAmri commented Oct 15, 2021

This issue originates from when I was trying out Umbraco Cloud (9.0.1) on trial, so yeah this might be a Cloud thingy.

@codekenjin
Copy link

I downloaded the source from https://umbraco.com/products/umbraco-cms/how-to-download-umbraco/ and running on Visual Studio 2019 today.

This happened while I was following the tutorial here https://our.umbraco.com/documentation/Tutorials/Creating-Basic-Site/Adding-Language-Variants/. When I was trying [step 3 Click Add Language], errors occurred:

Received an error from the server
An error occurred
An item with the same key has already been added. Key: pa

Exception Details
System.ArgumentException, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e: An item with the same key has already been added. Key: pa
Stacktrace
at System.Collections.Generic.Dictionary2.TryInsert(TKey key, TValue value, InsertionBehavior behavior) at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable1 source, Func2 keySelector, Func2 elementSelector, IEqualityComparer1 comparer) at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable1 source, Func2 keySelector, Func2 elementSelector)
at Umbraco.Cms.Web.BackOffice.Controllers.LanguageController.GetAllCultures()
at lambda_method488(Closure , Object , Object[] )
at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync()
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync()
--- End of stack trace from previous location ---
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)

@nul800sebastiaan
Copy link
Member

Fixed for 9.0.2 in #11441
For more info read the related issue: #11427

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants