if process to install a module encounters an unrelated missing module in the system, the system is left unstable

Created on 20 March 2019, over 5 years ago
Updated 8 June 2023, over 1 year ago

This came up in #3029107: Drush updb doesn't work with latest version of Lightning Media. but it seems to me this is a general problem.

Over on that issue, we have a hook_update_N() that is installing a new module.

On my system, I happened to have a missing module, a completely unrelated custom module I'd built in a sandbox branch, installed, and then switched branches without uninstalling (oops!).

The update hook crashed with 'The module foo does not exist.'

The site was then left in an unstable state: the new module that hook_update_N() wanted to enable was enabled, but its install configuration was missing.

🐛 Bug report
Status

Active

Version

11.0 🔥

Component
Extension 

Last updated 9 days ago

No maintainer
Created by

🇬🇧United Kingdom joachim

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇨🇦Canada jodavidson

    This seems like a situation that should be handled in the custom hook. If something goes wrong during the update/install process that process should be rolled back. Ie, the module that is being installed should then be uninstalled. Unless I'm missing something.

Production build 0.71.5 2024