Plugin updates via mdeploy not triggering database upgrade

Plugin updates via mdeploy not triggering database upgrade

by Just H -
Number of replies: 3

Hi folks

Anyone run into an issue whereby updating a plugin via the UI doesn't trigger the database upgrade?

Just upgraded core to Moodle 2.8.12

Check available updates and when I click to install one it goes to the interim page (saying it will download and the warning etc.)

Click install

Throws me back to the notifications page rather than the database update page?

The plugin does actually get downloaded:

2016-07-10 00:25:12 === MDEPLOY EXECUTION START ===
2016-07-10 00:25:12 Successfully authorized using the passphrase file
2016-07-10 00:25:12 Plugin upgrade requested
2016-07-10 00:25:12 Downloading package https://moodle.org/plugins/download.php/10492/mod_bigbluebuttonbn_moodle31_2015080611.zip
2016-07-10 00:25:12 Using custom CA certificate /home/XXXXXX/moodledata/moodleorgca.crt
2016-07-10 00:25:13 Package downloaded into /home/XXXXXX/moodledata/mdeploy/var/c8698e12fc871b20e7c9c8e5d3b608c6.0.zip
2016-07-10 00:25:13 MD5 checksum ok
2016-07-10 00:25:13 Current plugin code location: /home/XXXXXX/public_html/mod/bigbluebuttonbn
2016-07-10 00:25:13 Moving the current code into archive: /home/XXXXXX/moodledata/mdeploy/archive/bigbluebuttonbn_1468074313.0
2016-07-10 00:25:13 Package successfully extracted
But my Moodle install doesn't appear to recognise it as having been downloaded:



but, on the server it IS actually the new version:




No error messages in the logs or when debugging is on full; been trying to figure it out for the past few hours (including checking permissions, purging cache numerous times and doing manual upload of plugins) to no avail and totally stumped.

Any pointers to tracking the issue down appreciated.

H

Average of ratings: -
In reply to Just H

Re: Plugin updates via mdeploy not triggering database upgrade

by Just H -

Hi folks, still pulling our hair out here with this issue - got 13 plugins needing updated.

Any pointers much appreciated.

In reply to Just H

Re: Plugin updates via mdeploy not triggering database upgrade

by Ken Task -
Picture of Particularly helpful Moodlers

So the plugins to be updated are downloaded and pass verification.   Then one is presented with the screen where an update to the DB should take place.   It's at that point the update to the plugin(s) fail.  Is that a description of what's happening?

Could be the DB user setup for the Moodle and Moodle DB doesn't have priv's it needs to finish the DB update step.

So, here's something to try:

Edit the config.php file of the site thusly:

// $CFG->dbuser    = 'moodleuser';
$CFG->dbuser    = 'SUPERuser';
// $CFG->dbpass    = 'moodleuserpassword';
$CFG->dbpass    = 'SUPERuserpassword';

The // comment out the lines for the normal/regular moodleuser and the normal/regular moodleuser password.

The active lines ... those without // in front would then be used.

Then save the config.php file.   No need to restart any services, just navigate to the updates.

If you have multiple plugins to update at once, depending upon which plugins, some push you to an update screen for selecting new options for the updated plugin.   Now I know at the bottom of that screen the recommendation is to update them all at once, but I've seen a combo of plugins to update get messed up at that point and the update doesn't finish.    I know there are quiet a few to update, but suggest updating one at a time (ignore updating all at once) to see which ones present you with additional configuration after update and make note of them (for the next time, you are aware of which behave like that).

If you are successful upgrading that way, consider checking into the priv's of the moodleuser on the moodle database and increase the allowances.

See http://dev.mysql.com/doc/refman/5.7/en/show-grants.html for how to on priv's.   Link might say 5.7 but think the grant command works the same way in older versions of MySQL.

Comment out the SUPERuser lines in the config.php file to get things 'back to normal'.   And once things are 'normal' you could remove those lines from config.php.

Also check the ownerships/permissions on moodledata/mdeploy  ... if on linux/CentOS/RH family:

drwxrwsrwx 5 apache apache 4096 Mar 16  2015 mdeploy

On a functioning server (ie, mdeploy works), one should see something like this in moodledata/mdeploy:

drwxrwsrwx 24 apache apache  4096 Jul 11 06:47 archive
drwxrwsrwx  2 apache apache  4096 Jul 11 06:47 auth
-rw-rw-rw-  1 apache apache 16931 Jul 11 06:47 mdeploy.log
drwxrwsrwx  2 apache apache  4096 Jul 11 06:47 var

The mdeploy.log will give info on the progress of all that have been updated ... looks like this obscured example:

2016-07-11 06:47:27 === MDEPLOY EXECUTION START ===
2016-07-11 06:47:27 Successfully authorized using the passphrase file
2016-07-11 06:47:27 Plugin upgrade requested
2016-07-11 06:47:27 Downloading package https://moodle.org/plugins/download.php/11077/repository_coursefilearea_moodle30_2016041801.zip
2016-07-11 06:47:27 Using operating system CA certificates.
2016-07-11 06:47:28 Package downloaded into /xx/xx/moodle28data/mdeploy/var/40c70d016e450a7f2733f70fd6813082.0.zip
2016-07-11 06:47:28 MD5 checksum ok
2016-07-11 06:47:28 Current plugin code location: /xx/xx/xx/moodle28/repository/coursefilearea
2016-07-11 06:47:28 Moving the current code into archive: /xx/xx/moodle28data/mdeploy/archive/coursefilearea_1468237648.0
2016-07-11 06:47:28 Package successfully extracted
2016-07-11 06:47:38 === MDEPLOY EXECUTION START ===
2016-07-11 06:47:38 Successfully authorized using the passphrase file
2016-07-11 06:47:38 Plugin upgrade requested
2016-07-11 06:47:38 Downloading package https://moodle.org/plugins/download.php/11530/filter_generico_moodle31_2016061200.zip
2016-07-11 06:47:38 Using operating system CA certificates.
2016-07-11 06:47:38 Package downloaded into /xx/xx/moodle28data/mdeploy/var/387c19a882e297f5438f2f2bce92aa26.0.zip
2016-07-11 06:47:38 MD5 checksum ok
2016-07-11 06:47:38 Current plugin code location: /xx/xx/xx/moodle28/filter/generico
2016-07-11 06:47:38 Moving the current code into archive: /xx/xx/moodle28data/mdeploy/archive/generico_1468237658.0
2016-07-11 06:47:38 Package successfully extracted

The other piece to this that might be giving you grief has to do with an http server (yours) talking to an https (moodles) server.

To assist with that issue one can put at moodleorgca.crt file at the root of your data directory.

https://docs.moodle.org/24/en/SSL_certificate_for_moodle.org

'spirit of sharing', Ken


In reply to Ken Task

Re: Plugin updates via mdeploy not triggering database upgrade

by Just H -

Hello again Ken and thanks for popping in smile

 Just need to knock over another job then I'll try a few of your suggestions but to clarify on a couple of points on initial read: 

----

So the plugins to be updated are downloaded and pass verification. Then one is presented with the screen where an update to the DB should take place. It's at that point the update to the plugin(s) fail. Is that a description of what's happening?

Yes, but to clarify, our install is actually skipping the screen where the button to update the DB is located and going straight back to the notifications page and therefore no DB update can be manually triggered.

----

Could be the DB user setup for the Moodle and Moodle DB doesn't have priv's it needs to finish the DB update step.

Will check and try your suggestion but we have been using mdeploy successfully (until now of course) basically since it was introduced so can't see why it would suddenly be a privilege issue.

----

Re your points about trying one at a time and new settings. Yep, tried all 13 individually and no go, the extra settings pages show up, if relevant, after the database upgrade which we're not hitting at the moment.

----

Re mdeploy log, yep, it's same as the image I posted in the OP and it confirms mdeploy is doing it's job.

----

Re http talking to https, yep, as per the mdeploy log in my OP we're using a downloaded cert (had to when mdeploy was implemented, but while trying to figure this out have tried  using just the OS certs - which worked too but have put the downloded cert back since that try at troubleshooting). 

----


At the moment I'm leaning towards a conflict somewhere and have removed a bunch of plugins but still no go so far. With no errors I can find in any type of logs it's shooting in the dark. I was hoping maybe someone had come across the same issue before and had some way of tracking the error down but it's looking like a slow case of elimination unfortunately.

Thanks again, I'll be back after trying a couple of things you advised.

H