Skip to main content

Notifications

Power Apps - Microsoft Dataverse
Suggested answer

Upgrade managed solution fails

Like (1) ShareShare
ReportReport
Posted on 12 Sep 2024 12:33:05 by 10
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:
  • FLMike Profile Picture
    FLMike 27,286 on 20 Sep 2024 at 05:48:21
    Upgrade managed solution fails
    Hey
     
    Are you still stuck on this.. I dont do this often and not for free, but ever so often, I like to try.
     
    We can do a remote Teams meeting and I can help you if you are still stuck.
  • SG-12091223-0 Profile Picture
    SG-12091223-0 10 on 19 Sep 2024 at 12:13:48
    Upgrade managed solution fails
    Still havnt figured it out.
     
    I have the same security role in unmanaged solution Data and Organization. Now Solution Data for that role has "solution layer" dependency on Organization.
    I've tried to remove the security role all togheter on both solutions. In Organization i cannot remove it because of Data is using it. In Data i cannot remove it because i get the same original error. I've removed connection references. I've removed Data Flows that was part of the solution. Nothing seems to fix it ,o I'm still stuck - any suggestions?
     
    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.
  • SG-12091223-0 Profile Picture
    SG-12091223-0 10 on 17 Sep 2024 at 06:19:32
    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 10 on 17 Sep 2024 at 05:57:58
    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 10 on 13 Sep 2024 at 08:19:03
    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 27,286 on 12 Sep 2024 at 16:21:17
    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,526 on 12 Sep 2024 at 13:35:43
    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?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Kickstarter Events…

Register for Microsoft Kickstarter Events…

Tuesday Tip #12 Start your Super User…

Welcome to a brand new series, Tuesday Tips…

Tuesday Tip #13 Writing Effective Answers…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 144,769

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,466

Leaderboard

Featured topics

Loading started