Course Restore Hangs Moodle 3.9

Re: Course Restore Hangs Moodle 3.9

by gary Collins -
Number of replies: 9
Hey Howard, I followed the install instructions and getting moosh command not found. I dont want to compound my issues and take my troubleshooting time away to troubleshoot a troubleshooting app lol. Make Sense?

Since, I have removed all plugins that did not have current version for moodle 3.9 and still have same results.
In reply to gary Collins

Re: Course Restore Hangs Moodle 3.9

by Ken Task -
Picture of Particularly helpful Moodlers

The issue with moosh is probably a matter of setting up an alias for moosh.php script so you can type/use just 'moosh'.

That aside, however, appearing to hang, but there is a course shell restored ... or screen shot suggest that's the case ... I see 'weeks' with a link to turn down each week.    Looks like Collapsed Topics addon as turning down weeks/or topics is not part of core code.

So do you have Collapsed Topics addon installed?

Also, the very last thing a restore would do is to cleanup /moodledata/temp/backup/[somecontenthashdirectorybylettersandnumbers]/

Do you have any directories in /moodledata/temp/backup/ with long names?   If so what's in them?

Ownerships/permissions on /moodledata/temp/ are rwx (globale all) recursively?

There is also a scheduled task to clean up ... by chance is that executing at a time where the restore process is getting romped upon?

'SoS', Ken

In reply to Ken Task

Re: Course Restore Hangs Moodle 3.9

by gary Collins -
Hello Ken!

Thanks also for taking the time to offer some help.  I am not 100% if Collapsed Topic addon was installed (it may have been at one point).  I did not see it in the plugins.

Ken Here is something that may help? I changed the theme to Boost. It still stopped, but I did get more information:

Exception - Call to undefined function lti_get_instance_type()

More information about this error

×Debug info:

Error code: generalexceptionmessage

×Stack trace:

line 224 of /mod/lti/service/gradebookservices/backup/moodle2/restore_ltiservice_gradebookservices_subplugin.class.php: Error thrown

line 103 of /backup/moodle2/restore_subplugin.class.php: call to restore_ltiservice_gradebookservices_subplugin->after_restore_lti()

line 445 of /backup/util/plan/restore_structure_step.class.php: call to restore_subplugin->launch_after_restore_methods()

line 106 of /backup/util/plan/restore_task.class.php: call to restore_structure_step->launch_after_restore_methods()

line 205 of /backup/util/plan/restore_plan.class.php: call to restore_task->execute_after_restore()

line 135 of /backup/moodle2/restore_final_task.class.php: call to restore_plan->execute_after_restore()

line 818 of /backup/moodle2/restore_stepslib.php: call to restore_final_task->launch_execute_after_restore()

line 34 of /backup/util/plan/restore_execution_step.class.php: call to restore_execute_after_restore->define_execution()

line 181 of /backup/util/plan/base_task.class.php: call to restore_execution_step->execute()

line 178 of /backup/util/plan/base_plan.class.php: call to base_task->execute()

line 168 of /backup/util/plan/restore_plan.class.php: call to base_plan->execute()

line 385 of /backup/controller/restore_controller.class.php: call to restore_plan->execute()

line 219 of /backup/util/ui/restore_ui.class.php: call to restore_controller->execute_plan()

line 143 of /backup/restore.php: call to restore_ui->execute()

 

Here are the files that are in the temp/Backup




Here are the permissions for the folders





In reply to gary Collins

Re: Course Restore Hangs Moodle 3.9

by Ken Task -
Picture of Particularly helpful Moodlers

Your site must have multiple folks restoring courses ... or backing them up!

In moodledata/temp/backup/ successfull restores leave only a 0 byte .log file.   Any log file larger than 0 bytes has some info in it that might be worth a gander ... IF you can tell what restore attempt is associated with the log file.

Do you have automated backups turned on and running?

Anything/everything in moodledata/temp/backup/ can be manually erased via command line, but if you do that when another admin or autobackups or something else is making a backup that will be disrupted.

Debug shows a hint:

restore_ltiservice_gradebookservices_subplugin

So does this problem course backup have an LTI resource in it?

Is this course still viewable in site?   If so, make another backup but this time de-select any LTI resource contained therein.   Then try to restore that backup.   When doing this, change the name of the backup file slightly by adding a -nlti- in it's name so you know that backup contains no LTI resources/links in it.

'SoS', Ken

In reply to Ken Task

Re: Course Restore Hangs Moodle 3.9

by gary Collins -
Hello Ken,

If I do Exactly this...

"make another backup but this time de-select any LTI resource contained therein. Then try to restore that backup. When doing this, change the name of the backup file slightly by adding a -nlti- in it's name so you know that backup contains no LTI resources/links in it."

It restores with no issue.
In reply to gary Collins

Re: Course Restore Hangs Moodle 3.9

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

So the error is:

Exception - Call to undefined function lti_get_instance_type()

and the line at the top of the stack trace is:

line 224 of /mod/lti/service/gradebookservices/backup/moodle2/restore_ltiservice_gradebookservices_subplugin.class.php: Error thrown

On the above line of that file there is the call as expected to the function the error says is missing:

224                     if ($tool = lti_get_instance_type($instance)) {

Line 29 of the same file loads the file containing this function:

 29 require_once($CFG->dirroot.'/mod/lti/locallib.php');

And as expected this function is defined in that file, mod/lti/locallib.php:

 512 function lti_get_instance_type(object $instance) : ?object {

Is the file mod/lti/locallib.php present on your Moodle server and does it contain the above line?

In reply to Leon Stringer

Re: Course Restore Hangs Moodle 3.9

by gary Collins -
Hey Leon,

No that is not found in the file.
In reply to gary Collins

Re: Course Restore Hangs Moodle 3.9

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

That indicates that mod/lti/locallib.php isn't the correct version for Moodle 3.9. Function lti_get_instance_type() wasn't present in Moodle 3.7 so maybe it's still the old file.

So you should ensure this file is the correct one for your Moodle version. But if one file is wrong there may be others too so I'd recommend ensuring all the Moodle source code files are correct, following steps such as:

  1. Move the current files and folders from the Moodle source code folder (the site's home directory) into a backup folder.
  2. Download and extract the latest Moodle 3.9 files into the source code folder.
  3. Copy config.php from the backup folder into the Moodle source code folder along with any additional plugins and themes you have.
When you log in you may be prompted to confirm the update as the latest source code may be newer.
In reply to Leon Stringer

Re: Course Restore Hangs Moodle 3.9

by gary Collins -
Hey Leon,

That was it. I renamed my moodle to moodle.old, moved files over from git, copied config.php, I got an upgrade message when I logged in, but it was done in a blink of an eye. It worked when I restored.

On a side note, this site was updated from 3.1 to 3.2 to 3.7 and finally to 3.9. So many chances for something to get messed up!

THANK YOU everyone for all your help!!! I hope this helps someone who is in my shoes.

Gary