After installing D8 and a subfolder, I received the message that the database was outdated.
After I did the database update, the site entered in maintenance mode.
How to solve this?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rogeriodec’s picture

Could anyone tell me how to skip the maintenance mode in D8?

Anonymous’s picture

You can toggle the maintenance mode in the form found on "/admin/config/development/maintenance".

dawehner’s picture

Interesting, there is code inside DbUpdateController::triggerBatch and DbUpdateController::batchFinished
to ensure that we go online afterwards.

This sounds like a bug, indeed, but I haven't manually tried it.

adrianpintilie’s picture

Assigned: Unassigned » adrianpintilie

I am able to replicate the issue with beta7 and minimal installation profile

adrianpintilie’s picture

I found the issue, writing the patch.

adrianpintilie’s picture

Status: Active » Needs review
FileSize
558 bytes

Updated the _SESSION variable so the unset from maintenance mode works. There is only one inconvenient left, the "Operation in maintenance mode" is set before and thus displayed at the end.

adrianpintilie’s picture

FileSize
994 bytes

Updated the patch to clear the Operation in maintenance mode message from the message queue.

The last submitted patch, 6: 2435135-6.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 7: 2435135-7.patch, failed testing.

Status: Needs work » Needs review

adrianpintilie queued 7: 2435135-7.patch for re-testing.

Status: Needs review » Needs work

The last submitted patch, 7: 2435135-7.patch, failed testing.

adrianpintilie’s picture

FileSize
988 bytes

Issue with spacing solved in the patch.

adrianpintilie’s picture

Status: Needs work » Needs review
FileSize
988 bytes

Spacing fixed.

Status: Needs review » Needs work

The last submitted patch, 13: 2435135-13.patch, failed testing.

adrianpintilie’s picture

Version: 8.0.0-beta6 » 8.0.x-dev
Component: database system » base system
Status: Needs work » Needs review
FileSize
988 bytes

Sent for retesting again. Found that the issue had bad settings in Component & Version.

Status: Needs review » Needs work

The last submitted patch, 15: 2435135-14.patch, failed testing.

adrianpintilie’s picture

Status: Needs work » Needs review
FileSize
970 bytes

Updated the patch to add a message that states operating in maintenance mode is finished (current state). In this way, the user doesn't see the message of the previous state.

Anonymous’s picture

Issue summary: View changes
FileSize
59.65 KB

I was able to reproduce this issue on 8.0.x with minimal install profile and then executing /update.php/.

I tested this manually. The patch fixes the issue by making the site operate in normal mode after the update. However, I get two contradictory messages: one that states that we are operating in maintenance mode, and one that states that we are operating in normal mode.

As for the patch:

+++ b/core/modules/system/src/Controller/DbUpdateController.php
@@ -631,6 +632,10 @@ public static function batchFinished($success, $results, $operations) {
+      //Updates the message queue.

This would need a space in the beginning of the sentence. However, I'm not sure if a comment is needed here. The drupal_set_message() is kind of self-explanatory.

I also looked at the test failure in #15, but I'm not sure how this patch would cause this.

Anonymous’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests

Also, since this is currently not detected by a test, we are missing coverage.

adrianpintilie’s picture

I tried removing the message list with type "status" but it failed on testing. I thought adding another message would solve the issue. Other ideas?

adrianpintilie’s picture

We can also leave the site in maintenance mode. At least they will control to get it online.

wuinfo - Bill Wu’s picture

Status: Needs work » Needs review
Issue tags: -Needs tests
FileSize
1.19 KB

Here is the test script. So, what I did on the test script is adding a maintenance status check at beginning and end of the database update. If it is not equal of those two statuses, throw an error.

Status: Needs review » Needs work

The last submitted patch, 22: maintenance_mode_after_database_update-2435135-22-test.patch, failed testing.

wuinfo - Bill Wu’s picture

Status: Needs work » Needs review

So, the test patch failed which means it is good. :)

pwolanin’s picture

I'd like to combine this test with my fix at #2538274: DbUpdateController has broken mainteneance mode logic, and update.php doesn't run due to aggregated JS assets since the actual issue I'm trying to solve requires maintenance mode to work right during updates

pwolanin’s picture

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Mile23’s picture

#2538274: DbUpdateController has broken mainteneance mode logic, and update.php doesn't run due to aggregated JS assets seems to add the test from #22 and is now passing, so I feel safe marking this issue as a duplicate.

Please re-open if this is not the case.