Cannot insert duplicate key row in object

Yesterday when I was trying to import a solution I was getting this error:

Cannot insert duplicate key row in object ‘MetadataSchema.AttributeLookupValue’ with unique index ‘NDX_AttrLookupValAttrIdEntityIdCompState’. The duplicate key value is (3343d9f8-8b3b-45de-881f-4501a34e29de, 8, 0, fd140aae-4df4-11dd-bd17-0019b9312238, Jan 1 1900 12:00AM) the statement has been terminated.

After some digging and doing some queries on SQL, I was able to identify the field that was giving me the problem. Some search on the web and I found these posts that helped me:

  • In this one it helped on querying the DB in SQL to know the field:
  • In this post, it also says a way to remove the duplicate key row, but it is specific to that case, make sure to have a backup and perform this operation in an isolated environment.
    https://community.dynamics.com/crm/b/crmpowerobjects/archive/2014/02/24/duplicate-key-row-error-during-upgrade-to-crm-2013

  • In this post I found a way to go around the problem but not solving it:
  • Comment (or remove) the field that is giving the error in the solution and then zips it again and import.
    https://www.gittprogram.com/question/847161_errorcode-0x80044150-cannot-insert-duplicate-key-row-in-object-importing-solution-failed-after-upgrade-to-2011.html

    Removing the field from the solution allowed completing the import.

    Hope this helps!

    Advertisements

    Leave a Reply

    Fill in your details below or click an icon to log in:

    WordPress.com Logo

    You are commenting using your WordPress.com account. Log Out / Change )

    Twitter picture

    You are commenting using your Twitter account. Log Out / Change )

    Facebook photo

    You are commenting using your Facebook account. Log Out / Change )

    Google+ photo

    You are commenting using your Google+ account. Log Out / Change )

    Connecting to %s