Locked value missing. Code is possibly not usings the getter properly.

Locked value missing. Code is possibly not usings the getter properly.

by Patrick Walsh -
Number of replies: 4

We are migrating from moodle v2.8 to v3.9, on a new server. The major challenge we are trying to overcome is that our team does not want the ELIS plugin (https://docs.moodle.org/29/en/ELIS_Introduction) to come over to the new environment. Because of this, our migration deviates slightly from the recommended practice. We installed the moodle codebase , copied over the moodledata folder, but we did not take a full mysql dump. 

We are manually exporting data from the old 2.8 database and then importing that data into the 3.9 database. 

However, for courses, we are getting the following stack trace when viewing a course. This repeats probably anywhere between 20-50 times.  The page does load with the course information and sections, and sidebar, but when clicking scorm links, I get another error.

We were careful when importing all relevant course database tables, as well as context, block_instances, and other tables.

Are there any ideas on what we should look at to fix this? ANY ideas , no matter how small are very appreciated!!! thanks!!


ERRORS WHEN viewing a page such as: /course/view.php?id=915

Locked value missing. Code is possibly not usings the getter properly.
  • line 5062 of /lib/accesslib.php: call to debugging()
  • line 6097 of /lib/accesslib.php: call to context::preload_from_record()
  • line 1686 of /lib/navigationlib.php: call to context_helper::preload_from_record()
  • line 1924 of /lib/navigationlib.php: call to global_navigation->load_all_courses()
  • line 2674 of /lib/navigationlib.php: call to global_navigation->load_all_categories()
  • line 1356 of /lib/navigationlib.php: call to global_navigation->add_course()
  • line 4146 of /lib/navigationlib.php: call to global_navigation->initialise()
  • line 768 of /lib/pagelib.php: call to settings_navigation->__construct()
  • line 830 of /lib/pagelib.php: call to moodle_page->magic_get_settingsnav()
  • line 135 of /blocks/settings/block_settings.php: call to moodle_page->__get()
  • line 341 of /blocks/moodleblock.class.php: call to block_settings->get_content()
  • line 235 of /blocks/moodleblock.class.php: call to block_base->formatted_contents()
  • line 1181 of /lib/blocklib.php: call to block_base->get_content_for_output()
  • line 1239 of /lib/blocklib.php: call to block_manager->create_block_contents()
  • line 374 of /lib/blocklib.php: call to block_manager->ensure_content_created()
  • line 3965 of /lib/outputrenderers.php: call to block_manager->region_has_content()
  • line 40 of /theme/boost/layout/columns2.php: call to core_renderer->blocks()
  • line 1376 of /lib/outputrenderers.php: call to include()
  • line 1306 of /lib/outputrenderers.php: call to core_renderer->render_page_layout()
  • line 244 of /course/view.php: call to core_renderer->header()
Locked value missing. Code is possibly not usings the getter properly.
  • line 5062 of /lib/accesslib.php: call to debugging()
  • line 6097 of /lib/accesslib.php: call to context::preload_from_record()
  • line 218 of /course/classes/category.php: call to context_helper::preload_from_record()
  • line 266 of /course/classes/category.php: call to core_course_category->__construct()
  • line 1114 of /calendar/lib.php: call to core_course_category::get()
  • line 52 of /blocks/calendar_upcoming/block_calendar_upcoming.php: call to calendar_information::create()
  • line 341 of /blocks/moodleblock.class.php: call to block_calendar_upcoming->get_content()
  • line 235 of /blocks/moodleblock.class.php: call to block_base->formatted_contents()
  • line 1181 of /lib/blocklib.php: call to block_base->get_content_for_output()
  • line 1239 of /lib/blocklib.php: call to block_manager->create_block_contents()
  • line 374 of /lib/blocklib.php: call to block_manager->ensure_content_created()
  • line 3965 of /lib/outputrenderers.php: call to block_manager->region_has_content()
  • line 40 of /theme/boost/layout/columns2.php: call to core_renderer->blocks()
  • line 1376 of /lib/outputrenderers.php: call to include()
  • line 1306 of /lib/outputrenderers.php: call to core_renderer->render_page_layout()
  • line 244 of /course/view.php: call to core_renderer->header()
ERRORS WHEN viewing a page like:  mod/resource/view.php?id=5909

Invalid course module ID

More information about this error

×Debug info:
Error code: invalidcoursemodule
×Stack trace:
  • line 498 of /lib/setuplib.php: moodle_exception thrown
  • line 46 of /mod/resource/view.php: call to print_error()
Locked value missing. Code is possibly not usings the getter properly.
  • line 5195 of /lib/accesslib.php: call to debugging()
  • line 7407 of /lib/accesslib.php: call to context->__construct()
  • line 5212 of /lib/accesslib.php: call to context_block->__construct()
  • line 5595 of /lib/accesslib.php: call to context::create_instance_from_record()
  • line 6142 of /lib/accesslib.php: call to context->get_child_contexts()
  • line 478 of /lib/modinfolib.php: call to context_helper::preload_course()
  • line 417 of /lib/modinfolib.php: call to course_modinfo->__construct()
  • line 2183 of /lib/modinfolib.php: call to course_modinfo::instance()
  • line 2050 of /lib/navigationlib.php: call to get_fast_modinfo()
  • line 2114 of /lib/navigationlib.php: call to global_navigation->generate_sections_and_activities()
  • line 502 of /course/format/lib.php: call to global_navigation->load_generic_course_sections()
  • line 2029 of /lib/navigationlib.php: call to format_base->extend_course_navigation()
  • line 1313 of /lib/navigationlib.php: call to global_navigation->load_course_sections()
  • line 3503 of /lib/navigationlib.php: call to global_navigation->initialise()
  • line 3548 of /lib/navigationlib.php: call to navbar->has_items()
  • line 4551 of /lib/outputrenderers.php: call to navbar->get_items()
  • line 44 of /theme/boost/layout/columns2.php: call to core_renderer->region_main_settings_menu()
  • line 1376 of /lib/outputrenderers.php: call to include()
  • line 1306 of /lib/outputrenderers.php: call to core_renderer->render_page_layout()
  • line 2822 of /lib/outputrenderers.php: call to core_renderer->header()
  • line 1945 of /lib/setuplib.php: call to core_renderer->fatal_error()
  • line 390 of /lib/setuplib.php: call to bootstrap_renderer->__call()
  • line ? of unknownfile: call to default_exception_handler()

Average of ratings: -
In reply to Patrick Walsh

Re: Locked value missing. Code is possibly not usings the getter properly.

by Patrick Walsh -
also, the error occurs in this file and function: https://github.com/moodle/moodle/blob/master/lib/accesslib.php

/**
* Preloads context information from db record and strips the cached info.
*
* @static
* @param stdClass $rec
* @return void (modifies $rec)
*/
protected static function preload_from_record(stdClass $rec) {
$notenoughdata = false;
$notenoughdata = $notenoughdata || empty($rec->ctxid);
$notenoughdata = $notenoughdata || empty($rec->ctxlevel);
$notenoughdata = $notenoughdata || !isset($rec->ctxinstance);
$notenoughdata = $notenoughdata || empty($rec->ctxpath);
$notenoughdata = $notenoughdata || empty($rec->ctxdepth);
$notenoughdata = $notenoughdata || !isset($rec->ctxlocked);
if ($notenoughdata) {
// The record does not have enough data, passed here repeatedly or context does not exist yet.
if (isset($rec->ctxid) && !isset($rec->ctxlocked)) {
debugging('Locked value missing. Code is possibly not usings the getter properly.', DEBUG_DEVELOPER);
}
return;
}
In reply to Patrick Walsh

Re: Locked value missing. Code is possibly not usings the getter properly.

by Ken Task -
Picture of Particularly helpful Moodlers

Ok, stupid question ... why not delete the ELIS plugin in the 2.8.x site first?

Also ... one cannot hyperjump from a 2.8.any to a 3.9.highest.

Might want to see/read/study:

http://www.syndrega.ch/blog/#php-and-dbms-compatibility-of-major-moodle-releases

Upgrade from 2.8.x to 3.9.highest will have to be done in hops.

Due to the un-orthodox method your team is using right now not sure anyone ... even those from/work for a Moodle Partner ... would/could provide specific fixes.

https://docs.moodle.org/311/en/Moodle_migration

and might also want to read up on the first hop ... 2.8.x to which ever one can hop to in the march ...

https://docs.moodle.org/dev/Releases

In looking at the 3.9 (your desitination version):

https://docs.moodle.org/39/en/Upgrading#Check_the_requirements

"Notes:

  • You can only upgrade to Moodle 3.9 from Moodle 3.5 or later. If upgrading from earlier versions, you must upgrade to 3.5 as a first step."

And 2 cents more ... I'd work on getting the migrated site to new hosting under git and use git update/upgrades to march the moodle upwards.

https://docs.moodle.org/311/en/Git_for_Administrators

While above link shows 311 the basic concepts of using git for 2.8.x -> next hop apply.

'SoS', Ken

In reply to Ken Task

Re: Locked value missing. Code is possibly not usings the getter properly.

by Patrick Walsh -
Ken, thank you for the detailed and well formed response. We will definitely use your recommendations.

Below are the reasons for not uninstalling the ELIS plugin directly.

"The reason we haven’t uninstalled the plugin is because when we tested in the past, removing class instances would unenroll users from the Moodle course, even if we had already taken time to duplicate the enrollments on the Moodle side. (You can enroll using both Moodle and ELIS.) Once users are unenrolled, we lost their grade and completion data. This was in spite of doing the enrolment cleanup process we did, so we were worried that uninstalling the plugin would have a disastrous and far-reaching impact."
In reply to Patrick Walsh

Re: Locked value missing. Code is possibly not usings the getter properly.

by Ken Task -
Picture of Particularly helpful Moodlers

Yep ... unenrolling students would lose their data.

Maybe more than one way to 'skin a cat' ... not a first choice, but considering 2.8 -> 3.9.highest and having to go through hops to get to the 3.9 that leaves plenty of room for catch 22's and gotcha's. sad

So ... make a backup of one of those 2.8 courses with users, but NO ELIS block or mod/activity in the backup - nothing but content.

Then, download that .mbz file and un-compress it in a test directory.  An .mbz is really a tar.gz (gunzip).

There will be quite a few .xml files.   They act as roadmaps on restores.   Open oh let's say the users.xml file and check for anything ELIS.   Remove the tags related.  Do same for any/all xml files.

Once you think you have eradicated anything ELIS from those xml files, re-package the .mbz file by creating a .tar.gz with extension .mbz inside the test directory.   Moodle restores expect to find a moodle_backup.xml file at the root of the backup files when it uncompresses the .mbz to inspect and restore.

Fingers crossed ... do a dance or incantation ... do VoDoo or whatever you think would work, and attempt restore to a fresh 3.9.highest.

Good luck!   Uhhh ... you did say "any suggestions no matter' .... ! smile

'SoS', Ken