Backup is looking for temporary files that don't exist

Backup is looking for temporary files that don't exist

by Gustav W Delius -
Number of replies: 4

When I try to restore a course I get lots of messages like:

Warning: stat failed for /home/gustav/yorkmoodledata/temp/backup/1087836420/moddata/forum/35/110 (errno=20 - Not a directory) in /home/gustav/public_html/moodle/yorkmoodle/mod/forum/restorelib.php on line 410

Those directories do indeed not exist. Should they? The zip file from which I restore certainly doesn't contain such directories.

Average of ratings: -
In reply to Gustav W Delius

Re: Backup is looking for temporary files that don't exist

by Eloy Lafuente (stronk7) -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi Gustav,

I think it could be double checked using:

file_exists($temp_path) && is_dir($temp_path)

but I think that you shouldn't be seeing that warnings because using only:

is_dir($temp_path)

must work without warnings.

Perhaps one "buggy" PHP version at your side could be the problem?

http://bugs.php.net/bug.php?id=25343

Ciao smile
In reply to Eloy Lafuente (stronk7)

gzinflate error

by Gustav W Delius -
I agree that it is weird that is_dir issues that warning. But I am more worried about the fact that those directories don't exist. The effect is that course and user files do not get restored.

It probably has to do with an earlier error:

Unzipping backup
Warning: gzinflate: buffer error in /home/gustav/public_html/moodle/yorkmoodle/lib/pclzip/pclzip.lib.php on line 3115
In reply to Gustav W Delius

Re: gzinflate error

by Eloy Lafuente (stronk7) -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi Gustav,

the "gzinflate: buffer error" problem is a weird problem under some PHP/ZLIB and ZIP files combinations. Some weeks ago, in "Moodle en Español" course, some users reported an that error when trying to restore the Spanish version of the "Moodle for Teachers" course.

Curiously that course was restored without problems by the rest of participants. After some searches in the web looking for info about that error I wasn't able to find the exact cause/combination of the error. And users with problems were able to restore other courses.

Then I tried to create 4 different slightly modified versions of the zip file:

1.-The course zipped with the Unix "zip" executable.
2.-The course zipped with "low compression settings".
3.-The course zipped with WinZip and without the "moddata" directory.
4.-The course zipped without compression at all.

Users tried to restore that course into their "problematic" servers and the process failed in versions 1, 2 and 3, but it was successful with version 4.

So, one workaround can be to unzip and zip the course again with the Unix executable and compression set to 0 (I don't know if there is some W32 application to do that). Obviously other alternative is to use the command executables instead of Moodle internal routines.

When I was searching the web, I found one page about one PHP Bug in version 4.1.2 but one of my problematic users was using PHP 4.2.x, and a very new ZLIB library so I'm not able to determine the wrong combination.

And this is the status of this issue. In my experience it affects to random zip files under some servers. I think that it isn't related with the backup/restore procedure at all but it's really an important problem in some servers.

Any idea/alternative will be welcome, sure!! If people having this problem can post here his OS/Apache/PHP/ZLIB version, perhaps we could advance something...

Hope it heps, ciao smile
In reply to Eloy Lafuente (stronk7)

Re: gzinflate error

by Gustav W Delius -
Thank you Eloy. This problem was happening on a Debian Linux machine. Installing zip and unzip and setting Moodle up to use these has solved the problem.