Skip to main content

Notifications

Power Platform Community / Forums / Microsoft Dataverse / Upgrade managed soluti...
Microsoft Dataverse
Suggested answer

Upgrade managed solution fails

Posted on by 8
We are having a problem with upgrading a managed solution (from our unmanged sandbox solution) and get a strange error message that might point to some crm stuff that I don't really understand. 
An update works fine but wont delete obsolete components so we would like to move to the upgrade functionality.
 
See error:
Solution "Data" failed to import: ImportAsHolding failed with exception :Import failed: The DELETE statement conflicted with the REFERENCE constraint "entitykeyattribute_attribute". The conflict occurred in database "db_crmcoreemea_20230227_09340928_318c", table "MetadataSchema.EntityKeyAttribute", column 'AttributeId'. The statement has been terminated.
What I can tell is the deployment fails on some database specific error (not dataverse error but SQL Server error) but I'm not sure what to check for here. I don't have direct access to the database mentioned in the error message.
 
What is the issue and how do I resolve it?
 
UPDATE 2024-0913:
I've deleted 3 connection references that was not in use. After deleting number two I now recieve below error. Deleting number 3 didnt change the error.
 
Solution "Data" failed to import: ImportAsHolding failed with exception :Unexpected exception.
I've attached the whole Log file: Data_import (3).xml.
 
Categories:
  • SG-12091223-0 Profile Picture
    SG-12091223-0 8 on at
    Upgrade managed solution fails
    Ahh I just re-read your post:
    "someone in that environment or in another solution took a dependency on what you have in the solution you want to upgrade.
     
    You would need to find out by either looking at each Table etc to see what depedencies exist AGAINST them. Then remove that."
     
    Doh - I need to look outside my solution. Got it!
  • SG-12091223-0 Profile Picture
    SG-12091223-0 8 on at
    Upgrade managed solution fails
    So I havn't found the root cause. I've deleted different connection referencies. I have removed a dependency to an item not in the solution that actually caused a medium warning in solution checker. But this hasn't fixed the issue.
     
    So im planning to remove objects one by one to find out in what component the issue is laying. But how should I approache this without deleting the whole solution. could patching be an option? - if the patch afterwards can be discarded I have the original solution intact - or is there another better way to test these things without deleting the solution.
  • SG-12091223-0 Profile Picture
    SG-12091223-0 8 on at
    Upgrade managed solution fails
    To FLMike:
    Yes we had virtual tables but we had several issues with the use of them so we discarded them all together and changed to "normal" table with import. I will see if I can find some "left overs" from that, that I havn't removed from the solution.
    Nu sure what you mean by seconday key constraints - but if you mean anything else but the Id constraints then yes - almost all tables has "business key" constrants. Just cannot see from the error where I should look for which business key that should be the issue?
     
    To MichaelFP:
    Yes I have removed two keys from a table and created a new instead to replace them. But isnt the issue related to relations between two tables somehow?
    I belive I only have custom tables in the solution but I will see if something else is there that I didn't expect to be there.
     
    I will let you know my findings.
  • Suggested answer
    FLMike Profile Picture
    FLMike 23,258 on at
    Upgrade managed solution fails
    So to clarify,
     
    DataVerse is a SQL Server, so SQL errors are DataVerse errors.
     
    someone in that environment or in another solution took a dependency on what you have in the solution you want to upgrade.
     
    You would need to find out by either looking at each Table etc to see what depedencies exist AGAINST them. Then remove that.
     
    You cannot simply change your style of upgrading/updating because that dependency will block you no matter what.
     
    Do you have any Virtual Tables? Do you have any Secondary Key Constraints etc.
     
    Its there.. just need to find it.
     
  • MichaelFP Profile Picture
    MichaelFP 1,063 on at
    Upgrade managed solution fails
    Do you have any keys removed on your tables?
     
    Which is the tables that are you importing in your solution. Is Only custom or System tables?

Helpful resources

Quick Links

Welcome to the Power Platform…

We are thrilled to unveil the newly-launched Power Platform Communities!…

Community Update Sept 16…

Power Platform Community Update…

Welcome to the new Power Platform Community!…

We are excited to announce our new Copilot Cookbook Gallery in the Community…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 140,719

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,355

Leaderboard

Featured topics