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

Bad cache configuration file generated when file system flaky

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.9.6, 3.0.4
    • 2.8.10, 2.9.4, 3.0.2
    • Caching
    • MOODLE_28_STABLE, MOODLE_29_STABLE, MOODLE_30_STABLE
    • MOODLE_29_STABLE, MOODLE_30_STABLE
    • Hide
      1. Ensure that you have a cache config file ([moodledata]/muc/config.php)
      2. In cache/classes/config.php, add sleep(20); to the cache_config::include_configuration() method immediately before the include($cachefile); line
      3. Go to the cache configuration page
      4. While the script is sleeping, delete the cache config file
      5. Once the page loads, confirm that you see an error message and that no invalid new cache config file has been generated
      6. Remove the sleep() call and reload the cache config page
      7. Confirm that a valid default cache config file has been generated (with 3 stores and a non-null siteidentifier etc.)

      (The same steps can be used to reproduce the problem on a codebase without the patch.)

      Show
      Ensure that you have a cache config file ( [moodledata] /muc/config.php) In cache/classes/config.php, add sleep(20); to the cache_config::include_configuration() method immediately before the include($cachefile); line Go to the cache configuration page While the script is sleeping, delete the cache config file Once the page loads, confirm that you see an error message and that no invalid new cache config file has been generated Remove the sleep() call and reload the cache config page Confirm that a valid default cache config file has been generated (with 3 stores and a non-null siteidentifier etc.) (The same steps can be used to reproduce the problem on a codebase without the patch.)

      If there are temporary problems with the data directory filesystem it is possible to have a "null" cache configuration file generated. This is a valid configuration (in that it contains the correct structures) but it contains no store definitions or mappings. This causes Moodle to use cachestore_dummy.

      The scenario that causes this appears to be the file system dropping out momentarily during cache_config::include_configuration(), after the file_exists() check but before the include(), then reappearing in time for the new config file to be written. This seems like an extremely unlikely situation but we have seen this happen on our live system yesterday.

      The problem can be simulated using these steps:

      1. Ensure you have a valid cache configuration file
      2. Comment out the include($cachefile) line in cache_config::include_configuration()
      3. Go to a Moodle page. If you have debugging switched on you will see messages about "Your cache configuration file is out of date and needs to be refreshed"
      4. Look at your cache configuration file. It should now have "unknown" as the site identifier and no stores or mappings set up

            maherne Michael Aherne
            maherne Michael Aherne
            Andrew Lyons Andrew Lyons
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Adrian Greeve Adrian Greeve
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

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