Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-27559

Purging cache can create massive log file output

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.3, 2.3
    • Fix Version/s: 2.3
    • Component/s: Administration
    • Labels:
    • Environment:
      Red Hat Enterprise Linux Server release 5.6 (64-bit)
    • Testing Instructions:
      Hide

      1. Change the cache/lang directory to restrictive permissions (for example root:root 750) .
      2. Go to your Moodle site.
      3. Turn debug messages on (set them to Developer)
      4. Go to the "Purge all caches" page.
      5. Click the "Purge all caches" button.

      Show
      1. Change the cache/lang directory to restrictive permissions (for example root:root 750) . 2. Go to your Moodle site. 3. Turn debug messages on (set them to Developer) 4. Go to the "Purge all caches" page. 5. Click the "Purge all caches" button.
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-27559-master-v2

      Description

      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

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Votes:
                7 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  25/Jun/12