Updater stuck in loop - how to force a rerun of upgrade

See latest post…

I have run into a road block with a update from the beta 10 to beta 11.
I started the upgrade from the GUI…all looked great until the DB upgrade.
I get the frustrating message: "Update needed. Please use the command line updater because you have a big instance."
System is now stuck at this message.

I have attempted to run the update from CMD line, ssh in as the user the site runs under and as root.
Executing this command: "php occ upgrade"
Either way I receive this fatal error:
PHP Fatal error: Class ‘PDO’ not found in …/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php on line 172

Executing just “php occ” I get same message.
Anyway to get past this?

Are you in the root of your installation?

/var/www/html/nextcloud or something similar.

Yes. I made sure that was the current directory.
What looks to be happening is the centos 7 config (running Plesk Onyx server) for the user account running the site does not have the proper DB module support when in the bash session. Maybe due to the way Plesk creates and supports the site.

I have done gui based upgrades before on this same setup and my setup is not a “big” instance
by any means. :slight_smile:

What triggers the nextcloud upgrade to think it needs to be run in console?
Must be something the upgrade tags in the config directory.
If there is a flag or setting in a config I can change to let the upgrade run from the gui would probably fix this.

Well I gave up on the command line version and am trying to work with the GUI updater with this Plesk Onyx setup.

I have tried various steps to get the updater script to use the latest version (did work) and been successful in the script finding the latest copy but every time I run this script using the “secret” password method the script returns the new update is available…but returns that it is complete “before” I can even click “continue update”. Then of course I get the annoying “have a big instance” message when clicking continue…no joy.

How can I reset the upgrade script to force it to rerun the steps?

Initializing
Current version is 10.0.3.
Update to Nextcloud 11.0.1 available. (channel: “beta”)
Following file will be downloaded automatically: https://download.nextcloud.com/server/releases/nextcloud-11.0.1.zip
Continue update
Check for expected files
Check for write permissions
Enable maintenance mode
Create backup
Downloading
Extracting
Replace entry points
Delete old files
Move new files in place
Keep maintenance mode active?
Done

Well back to trusty command line…

I executed updater.phar and this looks to have reset the setup
ssh into host as apache user that runs the site.
Change directory to the /updater dir.
Ran php updater.phar and took the defaults and system is back to ver 10.0.3 beta. (go figure) :slight_smile:

Trying update now to 11.0.1 now.

Well back to square one. :cry:
Part of issue on this setup when running in ssh shell the default php version for the bash session is 5.4.16

This is what happens when trying to run occ upgrade:

Should the “occ upgrade” command be executed? [Y/n]
This version of Nextcloud requires at least PHP 5.6.0
You are currently running 5.4.16. Please update your PHP version.

Looking now to get the default bash php version to 5.6.0
The requirement of 5.6 is what is blowing this up.
What plesk sets the php version to in the web site profile does not match what the ssh user get on bash login.

I have figured out the fix for this:

  1. If your using plesk assign your site users to allow ssh bash login
  2. Login with ssh and confirm your the home dir for the account by running:
    cd ~
  3. Add support of php 5.6 by running the following: (confirm the path exists first)
    echo ‘PATH=/opt/plesk/php/5.6/bin:$PATH’ >> .bashrc && source .bashrc
  4. cd to your updater path
    cd updater
  5. run updater.phar:
    php updater.phar

When updater gets to the OCC step it will now execute and whola - 11.0.1 is setup!