Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem:
When upgrading from a site on 7.x-1.x, the upgrade throws an error at update_7203 because of a duplicate primary key entry into the role_permission table. This breaks automated updates with systems like Aegir. I now believe this is happening because media_update_7200 adds the file_entity module permissions, and it could run before file_entity_update_7203.
Proposed Solution:
A more aggressive hook_update_dependencies for media module, so that 7200 does not get run before file_entity is up to 7207.
Comment | File | Size | Author |
---|---|---|---|
#4 | upgrade-from-1.x-breaks-at-update-7203-2871153-4-D7.patch | 503 bytes | dnotes |
Comments
Comment #2
dnotes CreditAttribution: dnotes commentedHere's a patch. I've set this at major since the 1.x branch of media has been marked as unsupported owing to undisclosed critical security vulnerabilities, and we should expect 30,000+ sites to want to upgrade very soon.
Comment #3
dnotes CreditAttribution: dnotes commentedActually it's really weird that this is happening at all because the install hook shouldn't get run on upgrade! I've been up too long... -but nonetheless the patch fixes the problem! Stranger and stranger.
Comment #4
dnotes CreditAttribution: dnotes commentedOK, clearly I'm not at my best today... but, I now think this is because of update hooks not running in the same order, and should be fixed in media module. I'm going to try the attached patch.
Comment #5
joseph.olstadThere was a ticket like this that was closed recently , the recent patch by dnotes looks reasonable however it appears that not everyone is experiencing this issue, I'm hesitent to commit this solution to the media module until more review because I'm worried that making this change might break the upgrade path for others, and I'm not sure if the others are less numerous than the ones reporting this. It seems as if many are having success upgrading. I've tried to repeat /reproduce this issue, it seems a bit evasive as I cannot reproduce.
Comment #6
joseph.olstadfor those experiencing this issue, refer to this comment at the parent issue, and the media 1.x to 2.x/3.x instructions here
Comment #7
joseph.olstad@dnotes , see my comment #5 , I'm a little nervous about putting your patch in, but it seems like the right thing to do.
Comment #8
dasginganinja@joseph.olstad, I just upgraded a multisite with the patch in #4. When running the upgrade procedure #2082037: Document Upgrade Path from Media 1.x to Media 2.x/3.x on the multisite five (5) of the websites gave the "duplicate primary key". After restoring the multisite databases/files I applied this patch to media-7.x-2.3 and re-ran the upgrade procedure. All sites upgraded just fine and there were no more notices about duplicate keys. After testing the sites everything appears to work as it was before.
Comment #10
joseph.olstadComment #11
joseph.olstadreally trying to avoid support requests for 7.x-1.x upgrades
Comment #12
joseph.olstadComment #13
joseph.olstadits in 7.x-3.x but not 7.x-2.x
Comment #14
joseph.olstadComment #16
joseph.olstadThis was just merged into 7.x-2.x and is included in release 7.x-2.6
Comment #17
joseph.olstad