Course Restore not finishing

Re: Course Restore not finishing

by Ken Task -
Number of replies: 7
Picture of Particularly helpful Moodlers

The 0 byte .log files are normal.   Any log file that's larger indicates a fail.   Looking at them, however, not all that helpful in that they will show a 'stage/plan' it reached by a number ... 100, 200, 300 ... successful completion reaches 1000.

The MySQL setttings are in /etc/my.cnf on a Linux box.   On Windows?

This might help (Googled):

http://stackoverflow.com/questions/14597884/mysql-my-ini-location

However, if one logs onto the DB server via client, one can issue from the mysql> prompt:

show variables; [ENTER]

That will kick out all the variables ... among them ... max_connections (default is 151 and might need to be increased), max_allowed_packet might also need to be increased ... big chunks of data during backups and restores).

Those settings need to be set in the config file for MySQL ... setting them via mysql client will be in affect only for the life of the currently running session.   MySQL is rebooted then those are lost unless in config file.

The other settings for memory to consume, time for script to run, should all be in php.ini.   Looking at the PHP info link in Moodle will show you which php.ini file it's using.

fgrep 'max' /etc/php.ini on a linux box will show some that you might need to check:

[root@sos bin]# cd /etc/
[root@sos etc]# fgrep 'max' ./php.ini
; max_input_time
; Turning on this setting and managing its maximum buffer size can yield some
;   Integer = Enables the buffer and sets its maximum size in bytes.
; http://php.net/max-execution-time
max_execution_time = 120
; http://php.net/max-input-time
max_input_time = 120
; http://php.net/max-input-nesting-level
;max_input_nesting_level = 64
max_input_vars = 1500

Would help to locate the web server logs ... especially the error log ... and viewing them for clues.

The above assumes, of course, you are running apache and mysql.

'spirit of sharing', Ken


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

Re: Course Restore not finishing

by Scott Christy -

Ok, so I'm back again still trying to solve the issue where my course restores hang up and never complete. Here's a new bit of information that I'm wondering if it might provide more insight into where the problem is:

No matter what I do, it will only restore my course if I restore 14 topics or less. For example, I'm restoring a course that is 50mb in size. It has 18 topics. 

  • When I begin the restore if I pick the first 14 topics the restore finishes just fine. 
  • If I begin a restore and pick the first 15 topics I get the "Waiting for Moodle" remark in the bottom left corner of my browser, and the restore never completes. When I shut down my browser to get out of the restore screen and log back in the first 14 topics of the course are restored and that's it.
  • If I begin a restore and pick the last 14 topics and tell the restore to omit the first 4 topics, the restore finishes just fine.
  • If I begin a restore and pick the last 15 topics I get the "Waiting for Moodle" remark in the bottom left corner of my browser, and the restore never completes.
  • If I begin a restore and pick 14 random topics, not necessarily in order, the restore finishes just fine. 
  • If I pick 15 random topics I get the "Waiting for Moodle" remark in the bottom left corner of my browser, and the restore never completes.

The amount of content in each topic doesn't seem to have any bearing on whether or not the restore finishes. If I pick anywhere from 1-14 topics the restore finishes in a matter of seconds. If I try to restore any number beyond 14 topics it hangs up and never finishes the update no matter how long I let it run.

Any suggestions as to what might be causing the problem? As a reminder I'm running Moodle version 3.2.2 on a Windows 2012 server using MSSQL for the dbase, and PHP version 5.6.29. I've got debugging mode turned on but when it hangs up during a restore the whole screen locks up, the page does not refresh, so there is no debugging info showing up on the screen.

Anyone run into this problem and have a solution for fixing it?  I have quite a few courses to restore on our new server (over 120 courses) so restoring a course by restoring 14 topics at a time through the restore/merge option just isn't feasible.

Thanks in advance for any suggestions.


In reply to Scott Christy

Re: Course Restore not finishing

by Ken Task -
Picture of Particularly helpful Moodlers

There was a question about PHP that still needs a response ... running a 32 bit version of PHP? or a 64 bit version?   Makes a difference.

According to this:

http://windows.php.net/download/

x86_64 Builds

The x64 builds of PHP 5 for Windows are experimental, and do not provide 64-bit integer or large file support.

PHP 7 provides full 64-bit support. The x64 builds of PHP 7 support native 64-bit integers, LFS, 64-bit memory_limit and much more.

The PHP 5.6 (5.6.30) versions do list x64 builds but they are currently
experimental

Since you have Moodle 3.2.2 it is safe to use PHP 7, but I'll defer to any Windows person
to confirm if that includes the 7.1.3 downloads from http://windows.php.net/download/#x64 or not.   Am not a Windows person myself  so just doing some 'leg work' for ya.

Size of a course ... that term alone is misleading ... normally one thinks in terms of size = how large files are.   Plus, 14 topics can contain many, many, many resources/activities in those topics and those resources/activities could be 'heavy processing' ... thus 'larger'.   Quiz for example takes more processing that most other activities.   A quiz comes from a question bank ... so there is more than meets the eye to your description of the courses that are failing to restore ... and probably also failing to backup.

'spirit of sharing', Ken

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

Re: Course Restore not finishing

by Scott Christy -

Right now we're running the 32 bit version of PHP. I'd like to upgrade to PHP7 so that we'd gain the 64 bit support but from what I'm reading PHP7 doesn't support MSSQL which is the dbase I have to run within our district. Am I understanding that correctly or will PHP 7 work with MSSQL and Moodle 3.2?


As for the size of the course issue.... The course size is roughly 50Mb. I know the back up is sound because when I do a restore on our old Linux install of Moodle (v 2.6) the restore works flawlessly. On our new Windows install of Moodle 3.2 it does not. The other odd thing is it doesn't matter which 14 topics I pick to restore. I can pick any 14 topics, some with lots of things in them, some with a few, and everything in between, and the restore works. If I try to do it with 15 topics - any 15 topics - it hangs up every time. 

Also, for the record this particular course does not have any question banks or quizzes.

I sure appreciate all the time you've put in to trying to help me Ken. Would it be helpful for me to send you a copy of the .mbz file i'm using for the restore?

In reply to Scott Christy

Re: Course Restore not finishing

by Ken Task -
Picture of Particularly helpful Moodlers

Remember, I told you I wasn't Windows and that someone else would have to confirm use of PHP 7.   But from what you've found, MSSQL not compat ... soooooo .... kinda sounds like you could be stuck between rock and hard place.

As far as being required to run MSSQL ... would think a better approach today would be use what works. ;)

About the course backup ... that would be ok, but your backup is coming from Windows and MSSQL?   I run Linux with MySQL ... heard there are issues with that.  I'll try it.    Can also extract checking the backup - un-compress and inspecting xml's etc. can tell a lot about it.

However, no EMail attachment please ....

Put it up in some web accessible space you have access to ... then let me know where I can acquire and I'll look at it - send Private Message from here to me with URL.    As soon as I am successful in acquiring I'll let you know via PM this system and you can remove from whereever.

'spirit of sharing', Ken




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

Re: Course Restore not finishing

by Scott Christy -

Sent you a link via PM. Thanks again for looking at that for me.

Yeah, if it was up to me we'd be going Linux and MYSQL. Unfortunately it's not up to me. Our DBA's want us to use MSSQL because it's in line with all of their other current systems and it also improves our odds of our programmers being able to make the Moodle grade book talk to our SIS.

In reply to Scott Christy

Re: Course Restore not finishing

by Ken Task -
Picture of Particularly helpful Moodlers

Well, if programmers are involved and interfacing with SIS then there is a 'good reason' for it.

In 5-10 years it will all be cloud anyway! ;)

'spirit of sharing', Ken

Average of ratings: Useful (1)
In reply to Scott Christy

Re: Course Restore not finishing

by Ken Task -
Picture of Particularly helpful Moodlers

Sent you a true EMail with info/url/link and access credentials to a site where the course did restore.

Did change course short name and full name taking out the apostrophies.
Competencies were locked???

Sooooo .... on Windows??????

'spirit of sharing', Ken

Average of ratings: Useful (1)