Missing entries in external_functions table after upgrading to Moodle 3.1

Missing entries in external_functions table after upgrading to Moodle 3.1

by Sara Arjona Téllez -
Number of replies: 0
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hi!

After upgrading about 1500 Catalan schools from Moodle 2.8.12 to Moodle 3.1.1 we've detected that some of them have missing entries in the external_functions table. This affects, for instance, to the assignments, making teacher impossible evaluate pending submissions.

In the Javascript console we've seen the following error:

error:"No s'ha pogut trobar el registre de dades a la taula external_functions de la base de dades."

stacktrace:"* line 1502 of /lib/dml/moodle_database.php: dml_missing_record_exception thrown
* line 1478 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select()
* line 73 of /lib/externallib.php: call to moodle_database->get_record()
* line 185 of /lib/externallib.php: call to external_api::external_function_info()
* line 57 of /lib/ajax/service.php: call to external_api::call_external_function()
* line 31 of /lib/ajax/service-nologin.php: call to require_once()
"

"SELECT * FROM {external_functions} WHERE name = :name[array (  'name' => 'core_output_load_template',)]Error code: invalidrecord"

At the moment, to fix it, we've executed the following steps. 

  • Downgrade temporary the Moodle version from 3.1.1 (2016052301) to 2016052300 (it doesn't correspond with anything).

UPDATE m2config SET value='2016052300' WHERE name='version'

  • Upgrade again Moodle (accessing, for instance, to /admin page).


Do you know why this happen in some of the Moodle instances (about 25 of 1500)? Considering that these operations are critical to operate some activities, it would be great to add some kind of check to restore it without applying this workaroud. For instance, this script could be added to some cron task (I'm not sure which would be the best way).

Kind regards from Catalonia,

Sara

Average of ratings: -