-
Bug
-
Resolution: Fixed
-
Minor
-
2.0.3, 2.3
-
Red Hat Enterprise Linux Server release 5.6 (64-bit)
-
MOODLE_20_STABLE, MOODLE_23_STABLE
-
MOODLE_23_STABLE
-
MDL-27559-master-v2 -
I noticed an issue on a test site. When permissions were configured incorrectly, clicking the "purge all caches" button generated 400 MB of log file output. The logged errors were variations on:
[Wed May 18 10:17:35 2011] [error] [client x.x.x.x] PHP Warning: opendir(/var/www/moodledata/cache/lang) [<a href='functi
on.opendir'>function.opendir</a>]: failed to open dir: Permission denied in /var/www/html/lib/filelib.php on line 2229, referer:
http://moodle/admin/purgecaches.php
[Wed May 18 10:17:35 2011] [error] [client x.x.x.x] PHP Warning: readdir() expects parameter 1 to be resource, boolean given in /var/www/html/lib/filelib.php on line 2230, referer: http://moodle/admin/purgecaches.php
The failure loop that lead to 400 MB of logs involved those two lines repeated over and over and each time an extra slash was added to the end of the directory until the lines looked like this:
[Wed May 18 10:17:37 2011] [error] [client x.x.x.x] PHP Warning: readdir() expects parameter 1 to be resource, boolean given in /var/www/html/lib/filelib.php on line 2230, referer: http://moodle/admin/purgecaches.php
[Wed May 18 10:17:37 2011] [error] [client x.x.x.x] PHP Warning: opendir(/var/www/moodledata/cache/lang/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// in /var/www/html/lib/filelib.php on line 2229, referer: http://moodle/admin/purgecaches.php
[Wed May 18 10:17:37 2011] [error] [client x.x.x.x] PHP Warning: unlink(/var/www/moodledata/cache/lang/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// in /var/www/html/lib/filelib.php on line 2238, referer: http://moodle/admin/purgecaches.php
[Wed May 18 10:17:37 2011] [error] [client x.x.x.x] PHP Warning: mkdir() [<a href='function.mkdir'>function.mkdir</a>]: Permission denied in /var/ww
w/html/lib/setuplib.php on line 1058, referer: http://moodle/admin/purgecaches.php
[Wed May 18 10:17:37 2011] [error] [client x.x.x.x] PHP Warning: file_put_contents(/var/www/moodledata/cache/lang/en/core
_langconfig.php) [<a href='function.file-put-contents'>function.file-put-contents</a>]: failed to open stream: Permission denied in /var/www/html/lib/moodlelib.php on line 5798, referer: http://moodle/admin/purgecaches.php
Then the whole process repeats again until eventually I get:
[Wed May 18 10:20:23 2011] [error] [client x.x.x.x] PHP Fatal error: Maximum execution time of 120 seconds exceeded in /var/www/html/moodlelib.php on line 9409, referer: http://moodle/admin/purgecaches.php