Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Craig100 1136 posts 2523 karma points c-trib
    Nov 02, 2018 @ 14:10
    Craig100
    0

    The database failed to upgrade, key constraint violation.

    Upgrading a site from 7.0.4 to 7.12.3 I'm stuck at the 7.6.13 to 7.10.5 stage. The upgrade screen gives the following error which I can't fathom.

    The database failed to upgrade. ERROR: The database configuration failed with the following message: Violation of PRIMARY KEY constraint 'PK_userGroup2App'. Cannot insert duplicate key in object 'dbo.umbracoUserGroup2App'. The duplicate key value is (1, content).

    I've looked into the DB and can't see anything to do with userGroup2App. However, I note that it also doesn't have an umbracoUserLogins table, but I don't know if that's significant or not.

    I should also point out that these are manual upgrades, from the zip files, not NuGet. I didn't run into this issue with the site's staging DB which was upgraded via NuGet. Just wondering if the upgrade scripts are slightly different.

    Any pointers or advice would be appreciated.

    Thnx

  • Craig100 1136 posts 2523 karma points c-trib
    Nov 21, 2018 @ 18:30
    Craig100
    0

    I gave up with the upgrade and did a blank 7.12.4 build and imported everything as I couldn't get any advice on getting over the issue.

    Weeks later, now taking a separate, much larger site through the upgrade process from 7.6.3 to 7.12.4 and guess what? At 7.10.5 I get exactly the same issue. I'm beginning to think there's either an issue with the DB update script or there's a vital step I've missed out. I did 7.6.3 to 7.6.13 ok but 7.6.13 to 7.10.5 breaks.

    dbo.umbracoUserGroup2App' doesn't exist in the DB at this point so how it can identify something as a duplicate in it is beyond me.

    Does anyone have any advice that might lead me to a solution?

    Thnx

    Craig

  • Craig100 1136 posts 2523 karma points c-trib
    Nov 22, 2018 @ 14:34
    Craig100
    1

    Started the upgrade process again, this time taking smaller steps iaw this link:https://codeshare.co.uk/blog/how-to-upgrade-umbraco-safely/. 7.6.3 to 7.6.13 went well. 7.6.13 to 7.7.13 gave the same error at the point of DB upgrade:-

    "The database failed to upgrade. ERROR: The database configuration failed with the following message: Violation of PRIMARY KEY constraint 'PKuserGroup2App'. Cannot insert duplicate key in object 'dbo.umbracoUserGroup2App'. The duplicate key value is (3, content). The statement has been terminated. Please check log file for additional information (can be found in '/AppData/Logs/UmbracoTraceLog.txt')"

    Any advice would be appreciated.

    Craig

  • Craig100 1136 posts 2523 karma points c-trib
    Nov 22, 2018 @ 15:49
    Craig100
    101

    Following on a hint from Paul Seal, using SQL on the umbracoUser table we set all userTypes to 1 and re-ran the update. This time it went through. It should be noted that all users end up with a new Section Migrated Access Group assigned to them. One per user. I've been deleting them all and assigning users to proper groups. I hope to add a note to the Documentation to point this wrinkle out as it's cost me a hell of a lot of time over the past 2 weeks ;)

Please Sign in or register to post replies

Write your reply to:

Draft