Web Installer upgrade to Stable 20.0.3 stuck in Maintenance Mode (and fixed it already)

(I don’t think this matters, but my server is running Ubuntu 18.04 LTS and I manage it with the VIrtualmin web-based GUI)

I generally use the web installer for all my Nextcloud upgrades except for the rare moments when things go wrong, then it’s good old php occ work on the command line.

Today I got to upgrade to 19.0.3 (I think) right before it let me upgrade to the Stable channel 20.0.3, and for the most part, things went very smoothly.

After looking at the end of the “Details” on the 20.0.3 web installers app upgrade phase, I saw my situation failed at the “Mail” app upgrade. I’d been here before so this time instead of searching all of my old activity on this forum &| GitHub, I just looked in my BASH History to see what commands I had run in the past that looked promising. I opened a terminal window, ssh'ed into the server as the admin for my virtual server running Nextcloud, and changed directories to the web servers base path.

I found these in my .bash_history file:

  • php occ integrity:check-core
  • php occ upgrade
  • php occ maintenance:mode --off

I probably only needed to do the latter two commands, but I was running commands as I found ones that looked helpful. I know some people probably don’t need to prepend the php to their occ commands, but I do. In fact, because my server has the PHP 8.0 on it, my commands needed to start with php7.4 occ to run.

After that, I still had some clicking work to do because a second wave of app upgrades needed to be done, and also a lot were in a disabled state, so there was that to do too.

I hope this might help somebody who gets stuck during their upgrade like me. The critical distinction is I failed during that automated app upgrade screen, not earlier during the Nextcloud version upgrade phase. (I had failures during that too but clicking that [Retry Upgrade] web button always gets through the timing issues.)

Oh, yeah, I also need to run this:
php7.4 occ db:add-missing-primary-keys,
but that was discovered on the Admin: Settings => Overview page.