I'm not sure if the problem is specific to our setup. Our Moodle is 2.02, on Windows, IIS, MS-SQL, (ms native driver for php).
Courses that contain scorm objects don't get backed up. Oddly, the process just hangs rather than erroring, until it's killed by fastcgi timeouts. Extending the timeout just extends the wait.
I've done some work tracing the issue. As far as I can tell, moodle sends a particular query to the mssql server, which just hangs there-- no response, no error, no timeout.
The query is sent while the backup process is doing something with the files contained in the scorm object.
In the function in backup_structure_dbops.class.php
public static function move_annotations_to_final($backupid, $itemname) {
......lines
if (! $DB->record_exists('backup_ids_temp', array('backupid' => $backupid,
'itemname' => $itemname . 'final',
'itemid' => $annotation->itemid))) {
******* $DB->set_field('backup_ids_temp', 'itemname', $itemname . 'final', array('id' => $annotation->id));
}
}
the ***** line is where it hangs. Tracing this execution through set_field_select and do_query shows the query that hangs
In do_query (mssql native version)
$result = sqlsrv_query($this->sqlsrv, $sql);
At this point $sql="UPDATE #mdl_backup_ids_temp SET itemname = N'filefinal' WHERE id = '3'"
Adding a timeout to the sqlsrv_query line allows the process to terminate. In the php_logs I can see
Message: [Microsoft][SQL Server Native Client 10.0]Query timeout expired<br>
UPDATE #bhi_backup_ids_temp SET itemname = N'filefinal' WHERE id = '3'
[array (
0 => 'filefinal',
1 => '3',
)]
Any ideas???