Problem/Motivation

Reported by @cilefen.

>  [notice] Update started: editoria11y_update_9012
>  [error]  'view' entity with ID 'ed11y_action' already exists. 
>  [error]  Update failed: editoria11y_update_9012 

There is a potential `drush updb` vs `drush ci` order of operations problem, because the 2->3 update hook assumes it will see 2.x config. Updating local, committing that config, then running updb on prod confuses the update hook, whereas updating in production and then running config-import tries to restore un-updated config.

This only affects certain tooling workflows.

Fix will be to modify update hook 9012 to detect intermediate states and disambiguate, and to document the process.

Comments

itmaybejj created an issue. See original summary.

itmaybejj’s picture

Issue summary: View changes

  • itmaybejj committed 4e1d5dd8 on 3.0.x-dev
    fix: #3591113 v2 to v3 update hook conflicts with some configuration...
itmaybejj’s picture

Status: Active » Needs review
ryan-l-robinson’s picture

I am also encountering this issue

itmaybejj’s picture

If you're up for testing the dev branch, I'd love to know if it solves the problem.

I'm planning to do some more testing on the staged code and then tag a release this week.

ryan-l-robinson’s picture

I turned your commit into a branch and deployed it to a dev server. I am still getting a "Table 'ed11y_page' already exists." except now it is related to hook 9010 instead of 9012.

itmaybejj’s picture

The table? Now that's unexpected.

Is this dev server plain v2 or did it previously have the failed update applied?

  • itmaybejj committed eb60ec04 on 3.0.x-dev
    fix: #3591113: Make update 9010 and 9011 idempotent.
    
itmaybejj’s picture

That commit should handle situations where a failed migration needs to re-run (drops and regenerates ed11y_page table if it is in the DB when 9010 runs).

ryan-l-robinson’s picture

StatusFileSize
new3.36 KB

Latest version deployed to dev for me without any other visible errors. I attached it as a patch in case that is helpful to anybody else.

My scenario included copying back my production database, which is on editoria11y v2, to dev first, so that I could replicate what it would be like when it goes out to production. Then the CI/CD deployment process deploys the updated code, then config-import, then updb.

  • itmaybejj committed 45d2cfab on 3.0.x
    fix: #3591113 order of operations on update hooks and config import and...

  • itmaybejj committed 45d2cfab on 3.0.x-dev
    fix: #3591113 order of operations on update hooks and config import and...
itmaybejj’s picture

Status: Needs review » Fixed

OK I tagged 3.0.4 with the fixes.

Contact me if you want a year of CSA for helping test.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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