Error: An item with the same key has already been added. Key: NewsletterStudio.TransactionalEmailPicker
We get the following error in the Umbraco logging:
System.AggregateException: One or more errors occurred. (An item with the same key has already been added. Key: NewsletterStudio.TransactionalEmailPicker)\r\n ---> System.ArgumentException: An item with the same key has already been added. Key: NewsletterStudio.TransactionalEmailPicker\r\n at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)\r\n at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)\r\n at System.Linq.Enumerable.ToDictionary[TSource,TKey](IEnumerable`1 source, Func`2 keySelector, IEqualityComparer`1 comparer)\r\n at System.Linq.Enumerable.ToDictionary[TSource,TKey](IEnumerable`1 source, Func`2 keySelector)\r\n at Umbraco.Cms.Infrastructure.Migrations.PreMigration.DataTypeSplitDataCollector.Handle(UmbracoApplicationStartedNotification notification)\r\n at Umbraco.Cms.Core.Events.INotificationHandler`1.Handle(IEnumerable`1 notifications)\r\n at Umbraco.Cms.Core.Events.NotificationHandlerWrapperImpl`1.<>c__DisplayClass0_0`2.<Handle>b__2(IEnumerable`1 handlerNotifications)\r\n at Umbraco.Cms.Core.Events.EventAggregator.PublishCore[TNotification](IEnumerable`1 allHandlers, IEnumerable`1 notifications)\r\n at Umbraco.Cms.Core.Events.NotificationHandlerWrapperImpl`1.Handle[TNotification,TNotificationHandler](IEnumerable`1 notifications, ServiceFactory serviceFactory, Action`2 publish)\r\n at Umbraco.Cms.Core.Events.EventAggregator.PublishNotifications[TNotification,TNotificationHandler](IEnumerable`1 notifications)\r\n at Umbraco.Cms.Core.Events.EventAggregator.Publish[TNotification,TNotificationHandler](IEnumerable`1 notifications)\r\n at Umbraco.Cms.Core.Events.EventAggregator.Publish[TNotification](TNotification notification)\r\n at Umbraco.Cms.Infrastructure.Runtime.CoreRuntime.<StartAsync>b__22_1()\r\n at System.Threading.CancellationToken.<>c.<Register>b__12_0(Object obj)\r\n at System.Threading.CancellationTokenSource.Invoke(Delegate d, Object state, CancellationTokenSource source)\r\n at System.Threading.CancellationTokenSource.CallbackNode.<>c.<ExecuteCallback>b__9_0(Object s)\r\n at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n--- End of stack trace from previous location ---\r\n at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n at System.Threading.CancellationTokenSource.CallbackNode.ExecuteCallback()\r\n at System.Threading.CancellationTokenSource.ExecuteCallbackHandlers(Boolean throwOnFirstException)\r\n --- End of inner exception stack trace ---\r\n at System.Threading.CancellationTokenSource.ExecuteCallbackHandlers(Boolean throwOnFirstException)\r\n at System.Threading.CancellationTokenSource.NotifyCancellation(Boolean throwOnFirstException)\r\n at System.Threading.CancellationTokenSource.Cancel(Boolean throwOnFirstException)\r\n at Microsoft.Extensions.Hosting.Internal.ApplicationLifetime.ExecuteHandlers(CancellationTokenSource cancel)\r\n at Microsoft.Extensions.Hosting.Internal.ApplicationLifetime.NotifyStarted()
If upgrading Umbraco is not an option right now, you can just add a composer that disable the feature that introduced the issue
[Disable(typeof(DataTypeSplitDataCollectorComposer))]
public class SiteComposer : IComposer
{
public void Compose(IUmbracoBuilder builder)
{
}
}
Important If you want to upgrade to Umbraco 14 in the future, you will have to upgrade to Umbraco 13.2.1 first and remove the work around. See the Github issue for details.
Hi Markus, we upgraded yesterday and after checking the logs the error wasn't there anymore. So the upgrade solved the issue!
Thank you very much! #H5YR
Error: An item with the same key has already been added. Key: NewsletterStudio.TransactionalEmailPicker
We get the following error in the Umbraco logging:
How to fix this?
Running Umbraco 13.1.1 - NewsletterStudio 13.0.4
Hi!
This is a bug in Umbraco, that seems to be solved in 13.2.1, however there is a work around that you can apply,
Please read more about this here: https://github.com/umbraco/Umbraco-CMS/issues/15872
If upgrading Umbraco is not an option right now, you can just add a composer that disable the feature that introduced the issue
Important If you want to upgrade to Umbraco 14 in the future, you will have to upgrade to Umbraco 13.2.1 first and remove the work around. See the Github issue for details.
Let me know if you have any further issues!
Cheers!
// Markus
Thank you, we will upgrade Umbraco. Thanks for your quick reaction.
Hi!
Great!
It would be great if you could confirm that the Umbraco upgrade solves this issue, would you mind updating me here in the thread?
Cheers!
// Markus
Hi Markus, we upgraded yesterday and after checking the logs the error wasn't there anymore. So the upgrade solved the issue! Thank you very much! #H5YR
Great news!
Thanks for letting me know! Really appreciated!
Just let me know if you have any other questions or feedback!
Cheers!
// Markus
is working on a reply...