locked
HELP::Cant upgrade from CRM2011 to CRM2013 : Violation of UNIQUE KEY constraint 'UQ_LocalizedLabelCheck'. Cannot insert duplicate key in object 'MetadataSchema.LocalizedLabel RRS feed

  • Question

  • 12:17:48|  Error| Installer Complete: OrganizationUpgrader - Error encountered
    12:17:48|  Error| Exception occured during Microsoft.Crm.Tools.Admin.OrganizationUpgrader: Error.ActionFailed Microsoft.Crm.Tools.Admin.UpgradeDatabaseAction
    InnerException:
    System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Data.SqlClient.SqlException: Violation of UNIQUE KEY constraint 'UQ_LocalizedLabelCheck'. Cannot insert duplicate key in object 'MetadataSchema.LocalizedLabel'. The duplicate key value is (03e779c7-44d1-496c-803b-20e0cd308a3c, Description, 1033, Jan  1 1900 12:00AM, 0).
    The statement has been terminated.
       at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
       at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
       at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
       at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds)
       at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
       at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)
       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       at Microsoft.Crm.CrmDbConnection.InternalExecuteWithRetry[TResult](Func`1 ExecuteMethod, IDbCommand command)
       at Microsoft.Crm.CrmDbConnection.InternalExecuteNonQuery(IDbCommand command, Boolean capturePerfTrace)
       at Microsoft.Crm.CrmDbConnection.ExecuteNonQuery(IDbCommand command, Boolean impersonate, Boolean capturePerfTrace)
       at Microsoft.Crm.Platform.MetadataBusinessEntities.DBCommandExecutor.ExecuteNonQuery(IDbCommand command, ISqlExecutionContext context)
       at Microsoft.Crm.Platform.SolutionAwareComponents.MPOCreateComponentInstanceAction.Execute(ISqlExecutionContext sqlContext)
       at Microsoft.Crm.Platform.SolutionAwareComponents.ComponentStateTransition.Execute(Int32 componentType, Guid objectId, Object operationParameter, BusinessComponentState currentState, ISqlExecutionContext context)
       at Microsoft.Crm.Platform.MetadataBusinessEntities.MetadataProcessObject.DoCreate(MetadataBusinessEntity metadataEntity, ISqlExecutionContext context)
       at Microsoft.Crm.Platform.MetadataBusinessEntities.MetadataProcessObject.Create(MetadataBusinessEntity metadataEntity, ISqlExecutionContext sqlContext)
       at Microsoft.Crm.Metadata.LocalizedLabelCreateAction.MetabaseOperation()
       at Microsoft.Crm.Metadata.MetadataHelper.ProcessQueue_metabaseActionsToExecute(CounterList listCounters)
       at Microsoft.Crm.Metadata.MetadataHelper.ProcessQueue()
       at Microsoft.Crm.Setup.DiffBuilder.Pass1(String metadataLocation, String languageCode)
       --- End of inner exception stack trace ---
       at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
       at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
       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.Install(Int32 languageCode, String configurationFilePath, Boolean upgradeDatabase)
       at Microsoft.Crm.Tools.Admin.InstallDatabaseAction.Do(IDictionary parameters)
       at Microsoft.Crm.Setup.Shared.CrmAction.ExecuteAction(CrmAction action, IDictionary parameters, Boolean undo)
    InnerException:
    System.Data.SqlClient.SqlException (0x80131904): Violation of UNIQUE KEY constraint 'UQ_LocalizedLabelCheck'. Cannot insert duplicate key in object 'MetadataSchema.LocalizedLabel'. The duplicate key value is (03e779c7-44d1-496c-803b-20e0cd308a3c, Description, 1033, Jan  1 1900 12:00AM, 0).
    The statement has been terminated.
       at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
       at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
       at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
       at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds)
       at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
       at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)
       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       at Microsoft.Crm.CrmDbConnection.InternalExecuteWithRetry[TResult](Func`1 ExecuteMethod, IDbCommand command)
       at Microsoft.Crm.CrmDbConnection.InternalExecuteNonQuery(IDbCommand command, Boolean capturePerfTrace)
       at Microsoft.Crm.CrmDbConnection.ExecuteNonQuery(IDbCommand command, Boolean impersonate, Boolean capturePerfTrace)
       at Microsoft.Crm.Platform.MetadataBusinessEntities.DBCommandExecutor.ExecuteNonQuery(IDbCommand command, ISqlExecutionContext context)
       at Microsoft.Crm.Platform.SolutionAwareComponents.MPOCreateComponentInstanceAction.Execute(ISqlExecutionContext sqlContext)
       at Microsoft.Crm.Platform.SolutionAwareComponents.ComponentStateTransition.Execute(Int32 componentType, Guid objectId, Object operationParameter, BusinessComponentState currentState, ISqlExecutionContext context)
       at Microsoft.Crm.Platform.MetadataBusinessEntities.MetadataProcessObject.DoCreate(MetadataBusinessEntity metadataEntity, ISqlExecutionContext context)
       at Microsoft.Crm.Platform.MetadataBusinessEntities.MetadataProcessObject.Create(MetadataBusinessEntity metadataEntity, ISqlExecutionContext sqlContext)
       at Microsoft.Crm.Metadata.LocalizedLabelCreateAction.MetabaseOperation()
       at Microsoft.Crm.Metadata.MetadataHelper.ProcessQueue_metabaseActionsToExecute(CounterList listCounters)
       at Microsoft.Crm.Metadata.MetadataHelper.ProcessQueue()
       at Microsoft.Crm.Setup.DiffBuilder.Pass1(String metadataLocation, String languageCode)
    ClientConnectionId:6d8c0076-4c9c-413b-ab41-3c04c577cd16
    Thursday, April 24, 2014 10:39 AM

Answers

  • It was some Currency translation Solved by this Query:

    SELECT TOP 1000 [LocalizedLabelId]

          ,[LocalizedLabelRowId]

          ,[LanguageId]

          ,[ObjectId]

          ,[ObjectColumnName]

          ,[Label]

          ,[VersionNumber]

          ,[LabelTypeCode]

          ,[SolutionId]

          ,[SupportingSolutionId]

          ,[ComponentState]

          ,[OverwriteTime]

          ,[IsManaged]

      FROM [DATABASENAME_MSCRM].[MetadataSchema].[LocalizedLabel]

      where ObjectId =' '03e779c7-44d1-496c-803b-20e0cd308a3c'

    delete

    FROM [DATABASENAME_MSCRM].[MetadataSchema].[LocalizedLabel]

      where ObjectId ='03e779c7-44d1-496c-803b-20e0cd308a3c'

    • Marked as answer by iCRM Friday, April 25, 2014 12:10 PM
    Friday, April 25, 2014 12:10 PM

All replies

  • check for triggers in DB and delete them..

    gruss Daniel Ovadia MBSS - Microsoft Dynamics CRM MCNPS

    Thursday, April 24, 2014 11:19 AM
  • Hi Daniel,

    How? and is this supported way to solve this issue?

    Thursday, April 24, 2014 2:49 PM
  • Hi iCRM iCRM

    check what is the id 03e779c7-44d1-496c-803b-20e0cd308a3c in your DB

    with this article: http://vyaskn.tripod.com/search_all_columns_in_all_tables.htm

    When you run the upgrade process please use sql profiler trace.

    What kind of upgrade? Provide more details


    gruss Daniel Ovadia MBSS - Microsoft Dynamics CRM MCNPS

    Thursday, April 24, 2014 9:24 PM
  • It was some Currency translation Solved by this Query:

    SELECT TOP 1000 [LocalizedLabelId]

          ,[LocalizedLabelRowId]

          ,[LanguageId]

          ,[ObjectId]

          ,[ObjectColumnName]

          ,[Label]

          ,[VersionNumber]

          ,[LabelTypeCode]

          ,[SolutionId]

          ,[SupportingSolutionId]

          ,[ComponentState]

          ,[OverwriteTime]

          ,[IsManaged]

      FROM [DATABASENAME_MSCRM].[MetadataSchema].[LocalizedLabel]

      where ObjectId =' '03e779c7-44d1-496c-803b-20e0cd308a3c'

    delete

    FROM [DATABASENAME_MSCRM].[MetadataSchema].[LocalizedLabel]

      where ObjectId ='03e779c7-44d1-496c-803b-20e0cd308a3c'

    • Marked as answer by iCRM Friday, April 25, 2014 12:10 PM
    Friday, April 25, 2014 12:10 PM