Installing and upgrading help

Plugin database upgrade problem

 
Picture of Mahmood Naderan
Plugin database upgrade problem
 
Hi, I tried to install a plugin, however, it gave me a message that some plugins have to be updated. By proceeding that, it finally says that the requested plugin version is lower than that installed on then system. It has been stuck in a loop and I can not get rig of the messages.

Please see the screen shots below. Any thought on that?




 
Average of ratings: -
Picture of Ken Task
Re: Plugin database upgrade problem
Particularly helpful Moodlers

What version of Moodle do you have?   Did you upgrade recently?   IF so, how did you upgrade?

You've got more than one problem ...

Think the moodle notifications has been part of core since 2.7 of Moodle .... that's why the questions above.   What you tried to install (don't know you tried that) is older than what's in core .. if your Moodle is higher than 2.7.x

Plagarism Plugin 'moss' missing from disk means there is a reference in the DB mdl_config_plugins table but the actual files are missing.   Remove the row in mdl_config_plugins table that references 'moss'.  That plugin not compat with moodle versions higher than 2.1

Also check the mdl_config_plugins table for the

There are updates available for some of your other plugins but it says 'plugin files not writable' ... translation .... ownerships/permissions of files/folders in moodlecode won't allow the web services user (which moodle runs under) to write to them.

On a CentOS 7 standalone ... not shared hosting ... that user is 'apache'.   On Ubuntu (ditto) that user is normally www-data.

The QuickMail plugin looks like it might go though ... what happens to Quickmail if you click install now?

Yes, you will be thrown back to where you are now ... but you could try the button at the bottom, me thinks, to ugrade the DB.  (or did you already try that?) and at least QuickMail will get installed/updated.

'spirit of sharing', Ken



 
Average of ratings: -
Picture of Mahmood Naderan
Re: Plugin database upgrade problem
 

>What version of Moodle do you have?

According to the version.php

$version  = 2016120501.10;

$release  = '3.2.1+ (Build: 20170303)';


>Did you upgrade recently?

No since 3.2.1


>Remove the row in mdl_config_plugins table that references 'moss'.

There is no such entry. Please see the first picture.


>what happens to Quickmail if you click install now?

It will say

Downloading block_quickmail ... OK
Validating block_quickmail ... OK
  [Warning] Target location already exists and will be removed [/var/www/html/courses/blocks/quickmail] 
    
 

Validation successful, installation can continue
After clicking on Continue, it returns to the main page as shown in the second picture.

Regardless of updating other plugins, The error message relates to downgrading the notifier and that is the problem.


I am trying to find a way to manually remove its entry from the database to get rid of the error. The annoying thing is that, I can see and navigate to other pages and stuck at this page.... Looking forward for any help





 
Average of ratings: -
Picture of Ken Task
Re: Plugin database upgrade problem
Particularly helpful Moodlers

Continue with the update/upgrade to QuickMail.   Get it updated/upgraded an off the list first.

Yes, it will throw you back to the update screen cause there is more to clean up.

You are using Webmin.   Good.  To edit the table data one has to click the 'View Data' first.

You can then page through until you see the references for 'moss' and delete **only those rows**.

The reason  it's saying 'missing' from disk is accurate ... in DB but the directory/files are missing.

The message outputs thang I've not experienced but it looks like version information is confused.  Check the version.php files of the plugin for the version numbers as well as version.php files other core modules .... can then use Webmin to set them to correct values.   One column in the screen checks the actual version checks what's in files against what is in the DB, I think.

You're gonna have to study that. ;)

'spirit of sharing', Ken

 
Average of ratings: -
Picture of Mahmood Naderan
Re: Plugin database upgrade problem
 

>You can then page through until you see the references for 'moss' and delete **only those rows**.

OK I did that. Please see the picture that there is no more MOSS complain. However, still upgrading the DB says the that error. I really don't know how to tell moodle to please ignore that plugin! That was my fault and please return to the normal screen!


sad

>The message outputs thang I've not experienced but it looks like version information is confused.  Check the version.php files of the plugin for the version numbers as well as version.php files other core modules .... can then use Webmin to set them to correct values.   One column in the screen checks the actual version checks what's in files against what is in the DB, I think.

Excuse me, I didn't fully understand that. Would you please tell me the steps?



UPDATE: What happens if I delete the message_airnotifier entry from the database with the same procedure I did for moss? Will that remove the upgrade db page?



 
Average of ratings: -
Picture of Ken Task
Re: Plugin database upgrade problem
Particularly helpful Moodlers

What version of Moodle do you have - with build date?

That can be seen in moodlecode/version.php via command line:

cd /path/to/moodlecode/

fgrep '$release' version.php

While the suggestion to update the entire moodle probably needs to be done, the directions given assume you are on Linux Ubutnu.

So let's find out ... @Mahmood ... what is your operating system?

uname -an as root user

Update entire Moodle?   Well, at this point, since the op (Mahmood) has obviously tried to update a core plugin manually some how, am wondering where else op may have attempted to tweak things, etc. manually and it's just not been discovered yet.

For that reason, maybe a more surgical approach is needed ... but that depends upon the server op and response to the following question:

Do you have a backup of the code when the site didn't have this problem?

IF so, un-archive that backup (assuming it's a zip file or a tar) in some other location on the server .... let's say in a 'test' directory.

So 'test' dir would have all the moodle code (folders and files) in it.   Check 'test' version.php file like above to make sure it's a backup of the current code you have.

Then ...

cd /path/to/real/moodlecode/message/output/

mv airnotifier .airnotifier (we are hiding the airnotifier directory from apache's view ... the 'dot' in front of the directory does that).

Then we **copy** the airnotifier directory from  our backup extraction which is in /test/message/output/ to the active moodle code.

cd /test/message/output/

cp -rp airnotifier /path/to/real/moodlecode/message/output/

cd /path/to/real/moodlecode/message/output/airnotifier/

Check it's version:

fgrep 'plugin' version.php

Check the owership/permissions with ls -l

Owner should be the same as all the other directories/files in your moodle code ... might be www-data ... might be apache ... might be ????

Now hit the site again and let's see if we're close.

'spirit of sharing', Ken



 
Average of ratings: -
Picture of Ken Task
Re: Plugin database upgrade problem
Particularly helpful Moodlers

Follow up ... just so we're clear ...

I would NOT attempt an *upgrade* to 3.3 due to database requirements which OP may NOT be prepared to deal with at this point.

OP might need to consider *updating* current version 3.2.1 to the highest 3.2.5 but OP would have to follow the directions on how to update.   And, we've not seen the full screen of what needs updating.   Do see there is a theme ... academi ... which does have a compat version for 3.2.x right now.

Ref: https://docs.moodle.org/32/en/Upgrading

while it says 'upgrading' OP is really 'updating' the 3.2.1 to the highest 3.2.5.

And, OP may not re-call/remember, but, like I said before, OP may have attempted tweaks etc. else where in the same fashion as was done for airnotifier.   Sometimes a little knowledge makes one dangerous to one's self ... been there ... done that! :\

So after this is fixed, strongly suggest:

1. make a full site backup .... code + database a minimum. (make that a habit before updating anything).

2. Run the environment check (iupdate the component) in current version to plan a strategy for upgrading to 3.3.  Predict there will be warnings about DB - which OP will have to research on how to on OP's platform.

One other (optional) ... clone your production site to a sandbox .... the sandbox is your playground.  I'd also consider using git with the sandbox as git makes it much easier to either update or upgrade.

'spirit of sharing', Ken


 
Average of ratings: -
Picture of Mahmood Naderan
Re: Plugin database upgrade problem
 

OK I managed to solve that. According to that page, for the plugin, I see


current version 2016120500

new version 2014012805


And it can not downgrade from 2016 to 2014. I opened the version.php of the plugin via message/output/airnotifier/version.php and changed


$plugin->version    = 2014012805;           // The current plugin version (Date: YYYYMMDDXX).

to

$plugin->version    = 2016122900;

Something above 2016120500. Then I continue to upgrade the db and it says successfully updated the plugin! and then I removed the plugin safely via the administration menu.

Thanks for all suggestions.

 
Average of ratings: -
Picture of Ken Task
Re: Plugin database upgrade problem
Particularly helpful Moodlers

Glad to hear you've cleared/sorted out the issue, but what of using the core plugin in the future if deleted?

'spirit of sharing', Ken

 
Average of ratings: -
Picture of Mahmood Naderan
Re: Plugin database upgrade problem
 

Sorry I didn't understand....

I just remove the plugin via the plugin manager and I didn't remove the core notifier.

 
Average of ratings: -
Picture of Ken Task
Re: Plugin database upgrade problem
Particularly helpful Moodlers

Go to your Site Admin menu -> Plugins -> Message Outputs -> Manage

Do you see mobile listed there?

Just checking ... ;)

'spirit of sharing', Ken

 
Average of ratings: -
Picture of Mahmood Naderan
Re: Plugin database upgrade problem
 

Yes, I see that and it is said to be not configured. As I open the settings, I see


Airnotifier URL: OUR_COURSE_URL

Airnotifier port: It is 80 but he says that the default port is 443

Mobile app name: com.moodle.moodlemobile

Airnotifier app name: commoodlemoodlemobile

Airnotifier access key: EMPTY


Are these correct? So, why I don't receive forum post notifications via the mobile app?

 
Average of ratings: -
Picture of Ken Task
Re: Plugin database upgrade problem
Particularly helpful Moodlers

I would think there needs to be an access key ... not empty.   So no, it's not configured to work.   Plus think webservices has to be enabled and one protocol active.

Is there a link to request an airnotifier key on that form?

Since you edited version numbers to get by the plugins page I wonder if yours won't appear to have a *false* bug.   The actual files are for a newer version of airnotifier not your version of Moodle.   So if you have issues, suggest you will have to fix it properly and acquire the code for your version of Moodle (see previous suggestion as to how to do that).

'spirit of sharing', Ken


 
Average of ratings: -
Picture of Mahmood Naderan
Re: Plugin database upgrade problem
 
OK. I will upgrade the moodle to the latest version first and then continue as a new topic. Thanks by now...
 
Average of ratings: -
Picture of Ken Task
Re: Plugin database upgrade problem
Particularly helpful Moodlers

Be sure to check server environment from the Site Admin menu for compatibility.  Update the component first.    You might have some database things to tweak/change.

'spirit of sharing', Ken

 
Average of ratings: -
Picture of Rinky Verma
Re: Plugin database upgrade problem
 

Hi Ken,


I am in the middle of upgrade where it listed all the plugins to be upgraded. Now I can not go back from this screen and there is no link to upgrade plugins while upgrade.


What should i do?

Shoudl I continue and update database and later go to plugins menu to upgrade them??

 
Average of ratings: -
peter svec
Re: Plugin database upgrade problem
 

Did you delete everything in your www-root and make a fresh copy of the new version?  

 
Average of ratings: -
Picture of Mahmood Naderan
Re: Plugin database upgrade problem
 
I doubt because, we retrieve the courses from the previous version. How can I check if an old config from the previous version exists in the new version?
 
Average of ratings: -
peter svec
Re: Plugin database upgrade problem
 

The courses are in database and in moodledata directory. It is safe to delete source code of Moodle and replace it with new version. Please follow instructions for upgrading moodle to new version.

You should

  • backup your www-data and www-root
  • backup your database
  • delete www-data
  • copy source code of new version
  • perform upgrade

Current version of Moodle is 3.3.2+ (Build: 20170928)

peter

 
Average of ratings: -