Running drush updb to upgrade drupal core or other modules, puts the site in maintenance mode. I recently faced an issue (probably an edge case) where the site was stuck in maintenance mode after running updb in a pipeline of a containerized infrastructure. Here is the sequence of events:
- Run drush updb -y
- Container terminated (system failure or unknown reason)
- Re-attempt at drush updb
- drupal returns "no updates were required" (this tells me that the step 1 may have completed the update in the background?"
- Site remains in maintenance mode.
- I manually bring the site back online.
After all this it looked like the update was successful.
How do I ensure the integrity of the system when this happens without restoring a backup and running the updates again? When running subsequent drush updb that says "no updates required" does this guarantee the previous updates were successful.
drush state:set system.maintenance_mode 0
to disable maintenance mode. When you've run drush updb there must have been some output of which updates exactly are going to be run and you should also see the output of the last hook that was run before it failed. Do you remember the hook name and have you looked at what it was supposed to be doing and checked that it has done it? I'd also assume that the registry of performed updates will only be updated if an update was run successfully til the end. But that's just an assumption.