Divide by zero
 Wednesday, July 30, 2008
Moodle file upload and SCORM problems
I have been doing some work with the excellent Moodle, an open source Learning Management System, and after doing an upgrade, started experiencing problems uploading SCORM objects. The specific errors I was getting were PCLZIP_ERR_BAD_FORMAT (-10) : Unable to find End of Central Dir Record signature, and An error occurs during package unzip (sic). After a lot of searching, it seemed a few people were having similar issues, and mostly it seems Internet Explorer was being blamed. Perhaps there is also a problem with Internet Explorer, however in my case, I ended up working out where Moodle stores the files on the server and inspected the folder. The file was corrupt, I couldn't download the zip file.

After trying to manually upload the files I discovered that the disk quota had been exceeded. After doing a cleanup of the disk, everything worked well.

Sometimes when searching for the cause of a problem some facts eclipse our abilities to be a little objective about the true nature of the problem. In my case it seemed clear that the problem occurred as soon as I upgraded, when in reality the cause was my making a backup on a full server. This could have been avoided in a few ways. Firstly I should keep an eye on the server quotas, that should have been a give away. However, I think the Moodle developers should have caught an IO exception when the disk was full, and reported back to the browser. This would have saved a lot of time. Having said that, I am very impressed with Moodle, this is just one of those habits that happen a lot in programming where such potential errors as stack overflow, out of memory, or IO errors are ignored with an optimistic hope that they should never occur. With this error, I assume something worse is happening. Because the page didn't crash with an error, I can only assume the error was swallowed, and thus vital helpful information was never presented on the web page.

As soon as I have caught up with this work I will look at the code and see if I can offer a bug fix.

Update: I have also experienced problems doing a course backup, with the same root cause, not enough disk space. When doing the course backup, the messages received are An error occurred while backing up course start and An error occurred while copying the zip file to the course directory. After looking at the code, it appears the Moodle error handling only looks for 4 types of IO errors. PHP 5 has 7 types, I believe it is the type 7 error that would cause this. Unfortunately the error trapping routine has a default handler for unknown error types.


Wednesday, July 30, 2008 4:24:06 PM (AUS Eastern Standard Time, UTC+10:00)   #    Comments [0]  Moodle | Programming | Webmaster
link to del.icio.us link to reddit link to StumbleUpon link to Facebook Bookmark to Google