Restoring course timed out in Moodle 2.5

Restoring course timed out in Moodle 2.5

by David Ha -
Number of replies: 17

We have been having major issues with restoring course in Moodle 2.5.  backups are fine - no issue.  But restoring some courses always result in a timed out.  The backup file is extremely small (< 15 MB).

We are running Moodle 2.5 on MS IIS 7.5 with MS SQL 2008 backend.  Performance is not an issue, we are way... under utilize the servers.  So we really don't know what cause this.  We have turned on debugging and there was no error.  We also attempt to restore the backup file on another system and it exhibit the same behavior.

Average of ratings: -
In reply to David Ha

Re: Restoring course timed out in Moodle 2.5

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

Are you turning on full developer debugging?  Turn this on and then manually go to cron.php and it should tell you what it timing out or giving an error.

In reply to Emma Richardson

Re: Restoring course timed out in Moodle 2.5

by David Ha -

Yes - developer full debugging was turn on with error message display set to yes.

In reply to David Ha

Re: Restoring course timed out in Moodle 2.5

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

I would check your timeout settings in php.ini - if you are not getting anything, it sounds like a php problem maybe..

In reply to Emma Richardson

Re: Restoring course timed out in Moodle 2.5

by David Ha -

it's not a timeout issue in PHP.  We checked and double checked.

I am pulling my hair on this one sad

In reply to David Ha

Re: Restoring course timed out in Moodle 2.5

by David Ha -

PHP error log says  "Can not obtain session lock".  This is the log on the server btw.  I also notice that when a restore is performed, a temp file is written but it stopped at 70K (the backup file is 14 MB).

 

In reply to David Ha

Re: Restoring course timed out in Moodle 2.5

by Ray Le Couteur -

I'm having the same issue with one of my courses

It's not the size of the file (I have restored a backup of over 400mb successfully in 2.5), but the database calls.

A relatively small backup with lots of data in 'feedback'  times out. So it could be a database related setting.

But my most likely route (without tearing hair out) is to delete some old data and try backup/restore again.   

In reply to David Ha

Re: Restoring course timed out in Moodle 2.5

by Mark Pearson -

David,

I did a Google search "php error Cannot obtain session lock" and found several links to items from the Moodle Tracker which may provide some useful info, eg

MDL-30026 Prevent session lock waits from stalling server processes forever

HTH

When you find a cause for this behaviour (and hopefully a solution) please post it here -- I'm sure others will be affected by the same problem.

Mark

In reply to Mark Pearson

Re: Restoring course timed out in Moodle 2.5

by David Ha -

Hmm...  that doesn't apply to us.  We are running v2.5 anyway.  Also we have noticed that if a course has an 'automatic backup file' existed then then restore works fine.  It not, then it will hung.

So in effect, any manual backup files will not work sad

In reply to Mark Pearson

Re: Restoring course timed out in Moodle 2.5

by David Ha -

Hmm...  that doesn't apply to us.  We are running v2.5 anyway.  Also we have noticed that if a course has an 'automatic backup file' existed then then restore works fine.  It not, then it will hung.

So in effect, any manual backup files will not work sad

In reply to David Ha

Re: Restoring course timed out in Moodle 2.5

by David Ha -

PHP error logs has the following entries:

[23-Jul-2013 15:17:53 America/Chicago] calculating controller checksum 785ee9db90e866bdf00c94f61793611a
[23-Jul-2013 15:18:04 America/Chicago] loading controller from db
[23-Jul-2013 15:18:04 America/Chicago] checking plan security
[23-Jul-2013 15:18:05 America/Chicago] checking plan security
[23-Jul-2013 15:18:05 America/Chicago] setting controller status to 600
[23-Jul-2013 15:18:05 America/Chicago] saving controller to db
[23-Jul-2013 15:18:05 America/Chicago] calculating controller checksum 542fefe40e0496b6189ad24b3866b96a
[23-Jul-2013 15:18:05 America/Chicago] loading controller from db
[23-Jul-2013 15:18:08 America/Chicago] setting controller status to 700
[23-Jul-2013 15:18:08 America/Chicago] saving controller to db
[23-Jul-2013 15:18:08 America/Chicago] calculating controller checksum 7187196f38f7ef1d710ad3b1792d2a62
[23-Jul-2013 15:18:09 America/Chicago] loading controller from db
[23-Jul-2013 15:18:10 America/Chicago] setting controller status to 800

any idea?

In reply to David Ha

Re: Restoring course timed out in Moodle 2.5

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

Could your database be timing out?  Have you tried clearing out the controllers table and starting again?  Grasping at straws but I know that I have had trouble with the controllers table before and clearing it out helped.

In reply to Emma Richardson

Re: Restoring course timed out in Moodle 2.5

by David Ha -

how do you clean out the controller tables

In reply to David Ha

Re: Restoring course timed out in Moodle 2.5

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

In the database, find the table, mdl_backup_controllers and remove all records.  Back it up first just in case but I have done this multiple times with no problem.

In reply to Emma Richardson

Re: Restoring course timed out in Moodle 2.5

by David Ha -

Thanks.  I will try this on a dev server and let you know the result

In reply to Emma Richardson

Re: Restoring course timed out in Moodle 2.5

by David Ha -

sadly, this is not the solution.  same errors and the timeout issue still persist

sad

In reply to David Ha

Re: Restoring course timed out in Moodle 2.5

by John Hill -

Hi David,

We have been experiencing similar problems. Our restore/import processes are failing when there are more than about 10-12 files in a folder (this is also applicable to the legacy files folder).

We haven't implemented a solution yet but I have seen today that there are a couple of tracker issues that might help:

https://tracker.moodle.org/browse/MDL-40168
https://tracker.moodle.org/browse/MDL-34744

John

In reply to John Hill

Re: Restoring course timed out in Moodle 2.5

by David Ha -

I have resolved this issue by switching to PHP 5.4.14 which comes with php_dblib.dll

Loaded the php_dblib.dll and disable the MSSQL PHP driver.  edited the moodle config file lien to change 'sqlsrv' to 'mssql'

voila.  backup and restore works.