web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Upgrade managed soluti...
Power Apps
Unanswered

Upgrade managed solution fails

(1) ShareShare
ReportReport
Posted on 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.
 
I have the same question (0)
  • MichaelFP Profile Picture
    1,847 Super User 2025 Season 2 on at
    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?
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,335 Super User 2025 Season 2 on at
    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.
     
  • SG-12091223-0 Profile Picture
    10 on at
    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.
  • SG-12091223-0 Profile Picture
    10 on at
    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
    10 on at
    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
    10 on at
    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.
  • Michael E. Gernaey Profile Picture
    53,335 Super User 2025 Season 2 on at
    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.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard