Try our conversational search powered by Generative AI!

Initialization exception: Meta field already exists



Few days ago we updated EPiServer together with EPiServer Commerce. We also have EPiServer Commerce Manager nuget installed in EPiServer CMS.

From time to time when cms application starts the exeption is thrown. When I refresh the page everything is working - so it's looks like an initialization exception.

We are using CMS and Commerce since EPiServer 6R2, so it could be some obsolete web.config setting that should be changed or removed. Do you have any idea what could it be?

Meta field already exists.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: Mediachase.BusinessFoundation.Data.Meta.Management.MetaFieldAlreadyExistsException: Meta field already exists.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

Below is exception and stack trace:

[MetaFieldAlreadyExistsException: Meta field already exists.]
Mediachase.BusinessFoundation.Data.Meta.Management.MetaClass.CreateMetaField(String Name, String FriendlyName, String TypeName, Boolean IsNullable, String DefaultValue, AttributeCollection Attributes) +1077
Mediachase.BusinessFoundation.Data.Meta.Management.MetaFieldBuilder.CreateText(String name, String friendlyName, Boolean isNullable, Int32 maxLength, Boolean isUnique) +352
Mediachase.Commerce.Customers.Plugins.AutoInstallMetaDataModule.InstallUserId(String connectionString) +227
Mediachase.Commerce.Customers.Plugins.AutoInstallMetaDataModule.Execute(BusinessContext context) +261
Mediachase.BusinessFoundation.Data.Business.BusinessManager.ExecutePlugins(EventPipeLineStage eventPipeLineStage) +113
Mediachase.BusinessFoundation.Data.Business.BusinessManager.Execute(Request request) +271
Mediachase.Commerce.Customers.CustomerContext.InnerGetContactByUserId(String userId) +317
EPiServer.Framework.Cache.HttpRuntimeCache.ReadThrough(String key, Func`1 readValue, Func`1 evictionPolicy) +83
Mediachase.Commerce.Extensions.ObjectInstanceCacheExtensions.ReadThrough(IObjectInstanceCache cache, Boolean useCache, String cacheKey, IEnumerable`1 masterKeys, TimeSpan duration, Func`1 load) +229
Mediachase.Commerce.Extensions.ObjectInstanceCacheExtensions.ReadThrough(IObjectInstanceCache cache, String cacheKey, IEnumerable`1 masterKeys, TimeSpan duration, Func`1 load) +109
Mediachase.Commerce.Customers.CustomersCache.ReadThrough(String key, IEnumerable`1 masterKeys, TimeSpan timeout, Func`1 load) +336
Mediachase.Commerce.Customers.CustomerContext.ExecuteThroughCache(String key, TimeSpan timeout, Func`1 load) +78
Mediachase.Commerce.Security.PrincipalExtensions.GetCustomerContact(IPrincipal principal) +247
Mediachase.Commerce.Security.PrincipalExtensions.GetContactId(IPrincipal principal) +197
Mediachase.Commerce.Core.Modules.BusinessFoundationInitializeModule.context_AuthorizeRequest(Object sender, EventArgs e) +31
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +92
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +165

Aug 10, 2015 12:23


I can confirm this happens sometimes. We're still tracking it, but my impression is it's annoying but harmless. It might be the order of initializations messes up, but after you refresh it it run well and no visible effect is shown.



Aug 11, 2015 7:27


Thanks for your answer.

And do you know if someone already reported this as a bug? Then I could check the status in change log.

Aug 11, 2015 8:53

I'm having this problem too. Has anyone been able to find the cause?

Oct 21, 2015 14:22


We're working on this bug and it seems to be caused by a race condition. Fortunately It only happens during site initialization and will disappear after refreshing the site.

A fix might be available in upcoming releases of Commerce9.



Oct 21, 2015 15:48

The bug is now fixed and will be released in next release of Commerce (Possibly 9.2)



Oct 27, 2015 18:46

And now it's released:




Nov 10, 2015 14:06
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.