locked
Update Organization from rollup 8 to rollup 13 fails -- TargetInvocationException RRS feed

  • Question

  • I am attempting to update an organization on rollup 8 (5.0.9690.2243) to update rollup 13. The CRM Server itself was upgraded to rollup 13 and all other orgs on the server successfully upgraded. I get the below error when I try to manually invoke the upgrade in the Deployment Manager for this problem org:

    The log file is below.  The key part of the log is the ArgumentException, "item with the same key has already been added". Looking at the context of the stack trace it looks like it is trying to load optionsets as part of Processing the metadata, but that doesn't help me narrow it down to something I can control. Any ideas? 

    This article is close, but has a different inner exception and stack trace, and a resolution based on those inner details: http://nerdsknowbest.blogspot.ca/2013/03/resolution-errors-after-installing.html

    This article is also close, but again, a different inner exception and stack trace: http://a33ik.blogspot.ca/2013/05/error-after-applying-update-rollup-1213.html

    14:41:31|   Info| Installer Start: OrganizationDatabaseHotFixer.Install: operation DatabaseHotFix

    14:41:31|   Info| Executing Install action: Microsoft.Crm.Tools.Admin.InstallDatabaseUpdatesAction

    14:41:31|   Info| Applying slipstream dbUpdates to organization.  Id=b66af16b-9ee9-e211-9ed7-00155d016b26, UniqueName=<theorgname>.

    14:41:57|   Info| UpdateRevisionForAllOrgs(install = True): revision = 1992.

    14:41:57|   Info| UpdateRevision(): orgId = b66af16b-9ee9-e211-9ed7-00155d016b26, newRevision = 1992, install = True.

    14:41:57|   Info| Database updates were successfully applied for orgId = b66af16b-9ee9-e211-9ed7-00155d016b26.

    14:41:57|   Info| Applying latest dbUpdates to organization.  Id=b66af16b-9ee9-e211-9ed7-00155d016b26, UniqueName=<theorgname>.

    14:44:39|   Info| CrmAction execution time; InstallDatabaseUpdatesAction; 00:03:07.4181698

    14:44:39|  Error| Installer Complete: OrganizationDatabaseHotFixer - Error encountered

    14:44:39|  Error| Exception occured during Microsoft.Crm.Tools.Admin.OrganizationDatabaseHotFixer: Action Microsoft.Crm.Tools.Admin.InstallDatabaseUpdatesAction failed.

    InnerException:

    System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: An item with the same key has already been added.

       at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)

       at Microsoft.Crm.Metadata.PreloadedOptionSetMetadataDataProvider.LoadNormalOptions(IPreloadedMetadataInitializationContext context, Boolean initializeEnumOptionProvider)

       at Microsoft.Crm.Metadata.PreloadedMetadataCacheDataProvider.InitializeOptionSets(IPreloadedMetadataInitializationContext context, LoadMasks masks, IOrganizationContext organizationContext)

       at Microsoft.Crm.Metadata.PreloadedMetadataCacheDataProvider.Initialize(IOrganizationContext organizationContext, MetadataContainer container, LoadMasks masks)

       at Microsoft.Crm.Metadata.DynamicMetadataCacheLoader.CreateMetadataCacheDataProvider(MetadataContainer container, IOrganizationContext context, LoadMasks masks, CounterList counter)

       at Microsoft.Crm.Metadata.DynamicMetadataCacheLoader.BuildMetadataCacheFromMetadataContainer(MetadataContainer container, LoadMasks masks, IOrganizationContext context, CounterList counter)

       at Microsoft.Crm.Metadata.DynamicMetadataCacheLoader.LoadCacheFromDatabaseInternal(LoadMasks masks, CrmDbConnection connection, CrmTransaction transaction, IOrganizationContext context, CounterList counter)

       at Microsoft.Crm.Metadata.DynamicMetadataCacheLoader.LoadCacheFromDatabase(LoadMasks masks, IOrganizationContext context, CounterList counter)

       at Microsoft.Crm.Metadata.DynamicMetadataCacheFactory.LoadMetadataCache(LoadMethod method, CacheType type, IOrganizationContext context)

       at Microsoft.Crm.Metadata.MetadataCache.LoadCache(IOrganizationContext context, Boolean fileOnlyIfExists)

       at Microsoft.Crm.Metadata.MetadataCache.GetInstance(IOrganizationContext context)

       at Microsoft.Crm.BusinessEntities.ExecutionContext.ProcessDependencies(FlushCacheOption option, CreateNewCollectorOption createOption)

       at Microsoft.Crm.BusinessEntities.ExecutionContext.OnEndRequest()

       at Microsoft.Crm.Setup.MetadataPatchService.ProcessMetadataDiffFile(String targetRevision)

       --- End of inner exception stack trace ---

       at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)

       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)

       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

       at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)

       at Microsoft.Crm.Setup.Database.DllMethodAction.Execute(Guid organizationId)

       at Microsoft.Crm.Setup.Database.DatabaseInstaller.ExecuteReleases(ReleaseInfo releaseInfo, Boolean isInstall)

       at Microsoft.Crm.Setup.Database.DatabaseInstaller.Install(Int32 languageCode, String configurationFilePath, Boolean upgradeDatabase, Boolean isInstall)

       at Microsoft.Crm.Setup.Database.DatabaseInstaller.InstallUpdate(String configurationFilePath, Boolean upgradeDatabase)

       at Microsoft.Crm.Setup.Common.Update.DBUpdateDatabaseInstaller.ApplyDBUpdates(Guid orgId)

       at Microsoft.Crm.Tools.Admin.InstallDatabaseUpdatesAction.ApplyDBUpdatesInternal(Guid orgId, String orgUniqueName, String releaseFilePath, Boolean ignoreErrors)

       at Microsoft.Crm.Tools.Admin.InstallDatabaseUpdatesAction.ApplyDBUpdates(Guid orgId, String orgUniqueName, OrganizationOperationType operationType)

       at Microsoft.Crm.Tools.Admin.InstallDatabaseUpdatesAction.Do(IDictionary parameters)

       at Microsoft.Crm.Setup.Common.CrmAction.ExecuteAction(CrmAction action, IDictionary parameters, Boolean undo)

    InnerException:

    System.ArgumentException: An item with the same key has already been added.

       at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)

       at Microsoft.Crm.Metadata.PreloadedOptionSetMetadataDataProvider.LoadNormalOptions(IPreloadedMetadataInitializationContext context, Boolean initializeEnumOptionProvider)

       at Microsoft.Crm.Metadata.PreloadedMetadataCacheDataProvider.InitializeOptionSets(IPreloadedMetadataInitializationContext context, LoadMasks masks, IOrganizationContext organizationContext)

       at Microsoft.Crm.Metadata.PreloadedMetadataCacheDataProvider.Initialize(IOrganizationContext organizationContext, MetadataContainer container, LoadMasks masks)

       at Microsoft.Crm.Metadata.DynamicMetadataCacheLoader.CreateMetadataCacheDataProvider(MetadataContainer container, IOrganizationContext context, LoadMasks masks, CounterList counter)

       at Microsoft.Crm.Metadata.DynamicMetadataCacheLoader.BuildMetadataCacheFromMetadataContainer(MetadataContainer container, LoadMasks masks, IOrganizationContext context, CounterList counter)

       at Microsoft.Crm.Metadata.DynamicMetadataCacheLoader.LoadCacheFromDatabaseInternal(LoadMasks masks, CrmDbConnection connection, CrmTransaction transaction, IOrganizationContext context, CounterList counter)

       at Microsoft.Crm.Metadata.DynamicMetadataCacheLoader.LoadCacheFromDatabase(LoadMasks masks, IOrganizationContext context, CounterList counter)

       at Microsoft.Crm.Metadata.DynamicMetadataCacheFactory.LoadMetadataCache(LoadMethod method, CacheType type, IOrganizationContext context)

       at Microsoft.Crm.Metadata.MetadataCache.LoadCache(IOrganizationContext context, Boolean fileOnlyIfExists)

       at Microsoft.Crm.Metadata.MetadataCache.GetInstance(IOrganizationContext context)

       at Microsoft.Crm.BusinessEntities.ExecutionContext.ProcessDependencies(FlushCacheOption option, CreateNewCollectorOption createOption)

       at Microsoft.Crm.BusinessEntities.ExecutionContext.OnEndRequest()

       at Microsoft.Crm.Setup.MetadataPatchService.ProcessMetadataDiffFile(String targetRevision)

     

    14:44:39|   Info| Setting organization state.  New state = Failed

    14:44:39|  Error| Update Organization with Id=b66af16b-9ee9-e211-9ed7-00155d016b26 failed with Exception:

    System.Exception: Action Microsoft.Crm.Tools.Admin.InstallDatabaseUpdatesAction failed. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: An item with the same key has already been added.

       at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)

       at Microsoft.Crm.Metadata.PreloadedOptionSetMetadataDataProvider.LoadNormalOptions(IPreloadedMetadataInitializationContext context, Boolean initializeEnumOptionProvider)

       at Microsoft.Crm.Metadata.PreloadedMetadataCacheDataProvider.InitializeOptionSets(IPreloadedMetadataInitializationContext context, LoadMasks masks, IOrganizationContext organizationContext)

       at Microsoft.Crm.Metadata.PreloadedMetadataCacheDataProvider.Initialize(IOrganizationContext organizationContext, MetadataContainer container, LoadMasks masks)

       at Microsoft.Crm.Metadata.DynamicMetadataCacheLoader.CreateMetadataCacheDataProvider(MetadataContainer container, IOrganizationContext context, LoadMasks masks, CounterList counter)

       at Microsoft.Crm.Metadata.DynamicMetadataCacheLoader.BuildMetadataCacheFromMetadataContainer(MetadataContainer container, LoadMasks masks, IOrganizationContext context, CounterList counter)

       at Microsoft.Crm.Metadata.DynamicMetadataCacheLoader.LoadCacheFromDatabaseInternal(LoadMasks masks, CrmDbConnection connection, CrmTransaction transaction, IOrganizationContext context, CounterList counter)

       at Microsoft.Crm.Metadata.DynamicMetadataCacheLoader.LoadCacheFromDatabase(LoadMasks masks, IOrganizationContext context, CounterList counter)

       at Microsoft.Crm.Metadata.DynamicMetadataCacheFactory.LoadMetadataCache(LoadMethod method, CacheType type, IOrganizationContext context)

       at Microsoft.Crm.Metadata.MetadataCache.LoadCache(IOrganizationContext context, Boolean fileOnlyIfExists)

       at Microsoft.Crm.Metadata.MetadataCache.GetInstance(IOrganizationContext context)

       at Microsoft.Crm.BusinessEntities.ExecutionContext.ProcessDependencies(FlushCacheOption option, CreateNewCollectorOption createOption)

       at Microsoft.Crm.BusinessEntities.ExecutionContext.OnEndRequest()

       at Microsoft.Crm.Setup.MetadataPatchService.ProcessMetadataDiffFile(String targetRevision)

       --- End of inner exception stack trace ---

       at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)

       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)

       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

       at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)

       at Microsoft.Crm.Setup.Database.DllMethodAction.Execute(Guid organizationId)

       at Microsoft.Crm.Setup.Database.DatabaseInstaller.ExecuteReleases(ReleaseInfo releaseInfo, Boolean isInstall)

       at Microsoft.Crm.Setup.Database.DatabaseInstaller.Install(Int32 languageCode, String configurationFilePath, Boolean upgradeDatabase, Boolean isInstall)

       at Microsoft.Crm.Setup.Database.DatabaseInstaller.InstallUpdate(String configurationFilePath, Boolean upgradeDatabase)

       at Microsoft.Crm.Setup.Common.Update.DBUpdateDatabaseInstaller.ApplyDBUpdates(Guid orgId)

       at Microsoft.Crm.Tools.Admin.InstallDatabaseUpdatesAction.ApplyDBUpdatesInternal(Guid orgId, String orgUniqueName, String releaseFilePath, Boolean ignoreErrors)

       at Microsoft.Crm.Tools.Admin.InstallDatabaseUpdatesAction.ApplyDBUpdates(Guid orgId, String orgUniqueName, OrganizationOperationType operationType)

       at Microsoft.Crm.Tools.Admin.InstallDatabaseUpdatesAction.Do(IDictionary parameters)

       at Microsoft.Crm.Setup.Common.CrmAction.ExecuteAction(CrmAction action, IDictionary parameters, Boolean undo)

       --- End of inner exception stack trace ---

       at Microsoft.Crm.Setup.Common.CrmAction.ExecuteAction(CrmAction action, IDictionary parameters, Boolean undo)

       at Microsoft.Crm.Setup.Common.Installer.Install(IDictionary stateSaver)

       at Microsoft.Crm.Tools.Admin.OrganizationOperation.Install(IDictionary stateSaver)

       at Microsoft.Crm.Tools.Admin.OrganizationOperation.Execute()

       at Microsoft.Crm.Tools.Admin.OrganizationDatabaseHotFixer.Execute()

       at Microsoft.Crm.Tools.Admin.ApplyDatabaseHotFixInstaller.ApplyDatabaseHotFix(IApplyDatabaseHotFixInfo applyDatabaseHotFixInfo)

    14:44:40|   Info| GetDBUpdateRevisionThresholdForServer(): Threshold = 3448.



    • Edited by BenPatterson Friday, July 12, 2013 1:23 PM add related links
    Friday, July 12, 2013 1:19 PM

All replies

  • Hi Ben,

    May I ask if you have managed to resolve this issue somehow? I get the same error when patching from Rollup 8 to Rollup 17. It would be useful to know how to get around this...

    We have tried may thing suggested by various articles (errors with slightly different stack trace), but nothing worked. Any advice would be appreciated.


    Vit


    • Edited by V-Tec G Thursday, September 4, 2014 8:18 AM
    Wednesday, September 3, 2014 3:39 PM
  • This looks llike a known issue, please check following KB and run the resolution:

    http://support.microsoft.com/kb/2808349

    Tuesday, September 16, 2014 5:34 AM
  • Hi Wilson,

    We have found and applied the query form this KB previously, but it did not help in this case. We have opened a support case with Microsoft.


    Vit Galandak

    Tuesday, September 16, 2014 6:52 AM