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

Purging cache can create massive log file output

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.3
    • 2.0.3, 2.3
    • Administration
    • Red Hat Enterprise Linux Server release 5.6 (64-bit)
    • MOODLE_20_STABLE, MOODLE_23_STABLE
    • MOODLE_23_STABLE
    • MDL-27559-master-v2
    • 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.

      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

        1. filelib.patch
          0.6 kB
          Tyler Bannister

            cfulton Charles Fulton
            tbannister Tyler Bannister
            Dan Poltawski Dan Poltawski
            Sam Hemelryk Sam Hemelryk
            Frédéric Massart Frédéric Massart
            Votes:
            7 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.