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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dnotes created an issue. See original summary.

dnotes’s picture

Here'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.

dnotes’s picture

Priority: Major » Normal
Issue summary: View changes

Actually 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.

dnotes’s picture

OK, 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.

joseph.olstad’s picture

Project: File Entity (fieldable files) » D7 Media

There 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.

joseph.olstad’s picture

joseph.olstad’s picture

@dnotes , see my comment #5 , I'm a little nervous about putting your patch in, but it seems like the right thing to do.

dasginganinja’s picture

@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.

  • joseph.olstad committed 49f2c85 on 7.x-3.x authored by dnotes
    Issue #2871153 by dnotes: Upgrade from 1.x breaks at update_7203 with...
joseph.olstad’s picture

Status: Needs review » Fixed
joseph.olstad’s picture

really trying to avoid support requests for 7.x-1.x upgrades

joseph.olstad’s picture

Version: 7.x-2.x-dev » 7.x-3.x-dev
joseph.olstad’s picture

Version: 7.x-3.x-dev » 7.x-2.x-dev
Status: Fixed » Needs review
Issue tags: +minor version target

its in 7.x-3.x but not 7.x-2.x

joseph.olstad’s picture

Assigned: Unassigned » joseph.olstad

  • joseph.olstad committed 49f2c85 on 7.x-2.x authored by dnotes
    Issue #2871153 by dnotes: Upgrade from 1.x breaks at update_7203 with...
joseph.olstad’s picture

Status: Needs review » Fixed

This was just merged into 7.x-2.x and is included in release 7.x-2.6

joseph.olstad’s picture

Issue tags: -minor version target

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.