Failed upgrade repair possible?

Failed upgrade repair possible?

by J Guzman -
Number of replies: 3

After I upgraded to the latest V3.3.2.  I cannot manage authentication, because of the following error shows up:
Authentication plugin enroll not found.  Before, it was working just fine.  Can it be just repaired or reinstalled?

So now, it seems I cannot use the auto enroll feature to avoid having to manually add 1000 people to courses or using the keycodes.

The web server is hosted by windows 2016 server.  Database in in a different 2016 server  The web server's moodle files are located in E:\moodle

I created another instance as a sandbox and it does work fine.

Troubleshooting,  I did switch to debug and this is what it shows:


Warning: include(E:\Moodle\dirroot/auth/enrol/version.php): failed to open stream: No such file or directory in E:\Moodle\dirroot\lib\classes\plugin_manager.php on line 305

Warning: include(): Failed opening 'E:\Moodle\dirroot/auth/enrol/version.php' for inclusion (include_path='E:\Moodle\dirroot/lib/pear;.;C:\php\pear') in E:\Moodle\dirroot\lib\classes\plugin_manager.php on line 305

Plugin auth_enrol does not declare valid $plugin->component in its version.php.
  • line 315 of \lib\classes\plugin_manager.php: call to debugging()
  • line 335 of \lib\classes\plugin_manager.php: call to core_plugin_manager->load_present_plugins()
  • line 217 of \lib\classes\plugininfo\base.php: call to core_plugin_manager->get_present_plugins()
  • line 143 of \lib\classes\plugininfo\base.php: call to core\plugininfo\base->load_disk_version()
  • line 97 of \lib\classes\plugininfo\base.php: call to core\plugininfo\base::make_plugin_instance()
  • line 395 of \lib\classes\plugin_manager.php: call to core\plugininfo\base::get_plugins()
  • line 43 of \admin\settings\plugins.php: call to core_plugin_manager->get_plugins_of_type()
  • line 8004 of \lib\adminlib.php: call to require()
  • line 19 of \admin\settings.php: call to admin_get_root()
It seems Im missing that file/folder.  How can I repair it?  Should I need to reinstall?    THANKS!
Average of ratings: -
In reply to J Guzman

Re: Failed upgrade repair possible?

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

1.  Either you did not copy over the plugin folder when you upgraded or

2.  The plugin is not compatible with the latest version of moodle.  

I suspect the second option as your error states that it does not declare its component.  This is a requirement in later versions of moodle.  If you are not afraid to hack some code, you might be able to fix it if there is not an updated version of the plugin - you should check that first.  If there is not an update, open up the version.php file in the auth/enrol folder and add the following line: 

$plugin->component = 'auth_enrol';  

Then go to notifications and see if the plugin will now install.

BEFORE YOU DO ANY OF THIS, BACKUP THE SITE!!!

Average of ratings: Useful (1)
In reply to J Guzman

Re: Failed upgrade repair possible?

by Ken Task -
Picture of Particularly helpful Moodlers

Don't do Windows but have had to deal with a failed upgrade ... an attempted hyperjump where OP didn't copy addons/plugins into newly acquired code directory.

So the first question ... you upgraded from what version to 3.3.2?

Your test install was with a fresh version 3.3.highest and that would work just fine.

In a stock 3.3.highest there is no /moodlecode/auth/enrol

So it looks like whatever version you had before there was an auth (enrol) that was an addon?

Look in code directory auth/enrol/ if it is there.   Is there a version.php file?

All the authentication plugins that come with the moodle 3.3.highest code have a version.php file.

clip of what one looks like from manual enrolment:

$plugin->version   = 2017051500;        // The current plugin version (Date: YY$
$plugin->requires  = 2017050500;        // Requires this Moodle version
$plugin->component = 'auth_manual';

Your error says there isn't a variable for $plugin->component

So assuming you kept the old code directory, look in it under auth/ for an enrol directory.

"Repair" ... a Windows term ... may not apply here ... it's more a 'cheat' that might get you up and running but with exception to the auth/enrol thing.    And if that's the major method for all your users,etc. ... problems.   One *might* be able to 'doctor' a version.php file so that there is a declaraton of a plugin component, but then you have to tinkr with the version and requires values.

Going that route might have cascading affects. :|

'spirit of sharing', Ken



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

Re: Failed upgrade repair possible?

by J Guzman -

Thank you EMMA and KEN!!


I found the needed plugin in a previous backup.  I was kind of reluctant to do that because I wasnt sure it would work.  As Kent mentions, "repair" is a Windows thing and I don't need to complicate that much here lol.


Cheers!


J.Guzman