Stuck on Plugins check

Stuck on Plugins check

by Timothy Linn -
Number of replies: 13

I know nothing about the inner workings of Moodle, databases, php, and the like. In trying to install a simple plugin, it seems I have locked us out of the admin controls. After validation of the newly uploaded plugin, I was greeted with a page that had 27 errors, mostly indicating "to be deleted" but also "missing from disk" and one other plugin that needed to be upgraded. I chose to upgrade the one plugin that gave me the option and that seems to have been a mistake. When I clicked the Upgrade Moodle Database button, the process appears to have gotten stuck on the updated Questionnaire plugin. I canceled the installation of the new plugin but there appears to be no way to back out of upgrading the Questionnaire plugin with its "to be upgraded" status.

I have no idea how to do anything with SQL databases or anything similar. I don't know the version of Moodle because I can't get out of this screen to check. I'm hoping there is something simple that I can do to get back to where I started. I do know the location of the plugin (mods\questionnaire) and see a directory labeled "backup" if that is helpful.

Attachment mod_questionnaire error.JPG
Attachment plugins check.JPG
Average of ratings: -
In reply to Timothy Linn

Re: Stuck on Plugins check

by Ken Task -
Picture of Particularly helpful Moodlers

Not a Windows person .... but it appears your server is (the hint was \ characters for directories).

That being the case ... some questions:

what is version of Moodle?  2.9.1?  Found in version.php file where one sees the config.php script.   In older versions of Moodle, one could install a plugin that was for a version higher than what one is running for core.

Reason asked ... in your screen shot, some themes, like formal_white indicate with a very old moodle, or themes were never properly removed/fixed.

As far as the other error screens ... did you click the 'more information about this error' link?   Where did it take you?

Also, could be the DB user in config.php for your database for Moodle doesn't have privileges enough to change structure of the tables for questionaire ... which leads to other questions ... like what DB flavor is your site using?   (found in config.php) and to top it off, what web server are you running?  (Apache/IIS/Other).

Those old themes, by the way, go back to 1.9 of moodle and they had issues when one made an upgrade from 1.9.x to 2.2.x if I recall correctly.   Even if the plugins check screen says 'to be deleted' they never were and only by removing rows in the mdl_config_plugins table for those themes (a bunch of rows) could one finally get those removed from a confused plugins check/plugins update/installation screen.

Hope you started with a site backup ... zip of code directory, zip of moodledata, and a DB dump of the DB for the moodle.

Hoping a real 'Windows expert' steps in here and can give you specifics.

'SoS', Ken


Average of ratings: Useful (1)
In reply to Ken Task

Re: Stuck on Plugins check

by Timothy Linn -

Thanks for taking the time to respond, Ken. No, I did not back anything up before I tried to update the Questionnaire plugin. I'm a video editor which, sadly, makes me the closest thing to an IT guy in our organization right now. The person who set up our system left without warning. Yes, we are running Windows Server 2012. The fact that it is still v2012 tells you what you need to know about how he kept things up. I'm not surprised to read that things are not configured as they should be.

Following your instructions, version.php indicates version 20180517, release 3.5.1+

I did click the "more information about this error" link and got a message that basically apologized for not being able to give me more information about the error. Apparently, it is a generic code.

Following your instructions, I see this information in config.php:

$CFG->dbtype    = 'mysql';
$CFG->dbhost    = 'localhost';
$CFG->dbname    = 'distlearn_moodle';
$CFG->dbuser    = 'root';

I believe we use IIS.



In reply to Timothy Linn

Re: Stuck on Plugins check

by Jane Bell -

I am interested in an 'expert' advice too as I have the same problem

In reply to Jane Bell

Re: Stuck on Plugins check

by Ken Task -
Picture of Particularly helpful Moodlers

Same 'exact' problem? Really?

Then suggest you do what Tim did ... he must have turned on debugging which you can do via copying lines from config-dist.php (section 7 debugging) to the active config.php file to see what else Moodle might be reporting as issues.

Tim also took some screen shots to share back here.   Suggest you do the same so the Windows 'experts' will have info to be able to give specific responses.

Also share back your version of Moodle and web server info please.

Leon ... where are you? ;)

'SoS', Ken


In reply to Ken Task

Re: Stuck on Plugins check

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

Ken: Apologies, my side of the planet was in darkness but I'm awake now! smile

For Timothy and hopefully Jane too:

This turns out to be a known issue: CONTRIB-4914.

When you upgrade Moodle one is supposed to upgrade any additional plugins too. But here you're upgrading from Questionnaire version 2007120101, which looks Moodle 1.8 era, to version 2018050109 for Moodle 3.3/3.4/3.5.

Because version 2007120101 is so old Questionnaire is trying to run old upgrade steps which uses a function removed after Moodle 2.2: database_manager::change_field_enum(). Because it's not in Moodle 3.5 you get this error. Whereas if the plugins had been upgraded when Moodle was upgraded then this step would have been done in, say, Moodle and wouldn't be a problem now.

Hopefully you can resolve this by changing line 46 of mod/questionnaire/db/upgrade.php from:

        $dbman->change_field_enum($table, $field);

to:

        $dbman->drop_enum_from_field($table, $field);

Timothy: Moodle 3.5.1 is way behind the latest update for that version, 3.5.16. It sounds like you're aware that the site needs some attention.

Average of ratings: Useful (1)
In reply to Leon Stringer

Re: Stuck on Plugins check

by Timothy Linn -
Hi Leon,

Thank you for your help. Much appreciated. I found the text in line 46 and made the change. I see this same phrase appear repeatedly in the lines that follow. Is it just line 46 that needs to be changed? I'll paste in what I'm seeing below.

Also, I'm guessing that the errors showing up as "To be deleted" will take care of themselves. What about the plugins listed as "Missing from disk!" Do I ignore those too?

Attachment change_field_enum capture.JPG
In reply to Timothy Linn

Re: Stuck on Plugins check

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

Yes, my mistake, please change change_field_enum() wherever it appears.

"To be deleted": They should get removed automatically as you say.

"Missing from disk!": Don't worry about these if there have been no other changes (such as Moodle version upgrade, server migration). These are plugins which had been installed but are no longer present in the Moodle source code folder. Presumably they were removed before you started looking after the site. Ideally these could be deleted from Moodle (from the Plugins Overiew page) at some point.

Average of ratings: Useful (1)
In reply to Leon Stringer

Re: Stuck on Plugins check

by Timothy Linn -
Thanks, Leon. I made the suggested changes but ended up in the same place. Additional thoughts? Can I delete the mod/questionnaire directory entirely in Windows and re-install from scratch? (The idea would be that I will get another "Missing from disk!" error which can be ignored.) Or would this delete a link between the questionnaires in our courses and the plugin that wouldn't be restored after a reinstall?
Attachment drop_enum capture.JPG
In reply to Timothy Linn

Re: Stuck on Plugins check

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

Apologies again. It turns out that both change_field_enum() and drop_enum_from_field() were removed from Moodle long ago.

If you uninstall the Questionnaire plugin then if you do have any questionnaire data that would be deleted too.

I'll try to come up with a way forward.

Average of ratings: Useful (1)
In reply to Leon Stringer

Re: Stuck on Plugins check

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

Do you know how to run MySQL queries? There's a command line client that comes with MySQL, or you may have a GUI (MySQL Workbench) or phpMyAdmin. I'm suggesting the following:

  1. Back up the Moodle database.
  2. Make the database modifications from the attached file, questionnaire_enum.sql. This makes the changes to the ENUM type that the plugin is trying to do. In whichever client you use, switch to the Moodle database (for example: USE moodle if the Moodle database is called `moodle` and you're using the command line client). Then paste those statements.
  3. Modify mod/questionnaire/db/upgrade.php and comment out every line that tries to make these changes by placing // at the start of the line. That's every line that contains "_enum", 21 lines.

I tested it on a Moodle 1.9 to 2.2 and it appeared to work.

I realise this is a cumbersome workaround but I can't think of any other approach.

Average of ratings: Useful (1)
In reply to Leon Stringer

Re: Stuck on Plugins check

by Timothy Linn -

I'm really grateful for your willingness to help, Leon, and for the time you put into finding a solution. That said, I don't know anything about MySQL queries or even something as simple as backing up the Moodle database. I could figure out the latter but I think we've reached the point where I'm completely out of my depth. Let me ask about a couple of other approaches:

Going back to the idea of deleting the mod/Questionnaire directory in Windows, I'm understanding you to say that we lose all our questionnaires. Aside from that rather significant downside, will deleting this directory allow me to get me back to the admin console and out of being stuck at the plugins check page?

Also, it does appear that I have a backup that would allow me to return Moodle to the state before I tried to upgrade this plugin and got stranded. But does that really help me? I'm *still* in a situation where I can never add or upgrade any plugins because that would inevitably put me back in a situation where I had to upgrade the Questionnaire plugin before I could move forward with anything else. I suppose if there was export functionality, I could export the questionnaires, delete the plugin, and then re-import the questionnaires. But I'm speculating about the existence of that functionality.

In reply to Timothy Linn

Re: Stuck on Plugins check

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

If you just delete the questionnaire subfolder from mod then the plugin will be listed as "Missing from disk!". It won't be uninstalled so no data is lost, and you can access the site as an administrator again. You could re-attempt the Questionnaire upgrade at a later date if you wish.