On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • This core cache file core/cache/context_settings/web/context.cache.php has been a problem because every couple of weeks, sometimes a week up to a month, it will not update. When this file stops updating new pages just end up as a 404 until we manually delete the file then MODx writes a new file and it works fine for a while. Then it stops updating again and have to delete it. Rinse and repeat.

    Any known bugs with MODX Revolution 2.2.0-pl2 (traditional) that relate to this kind of problem?

    Any other suggestions?


    Thanks
    • Cache corruption was in issue in early 2.2.x releases. I would upgrade to the current version.


      ------------------------------------------------------------------------------------------
      PLEASE, PLEASE specify the version of MODX you are using.
      MODX info for everyone: http://bobsguides.com/modx.html
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
      • What do you mean it will not update? Are you getting error messages about it not being writable? Or what makes you think it will not update? Are the permissions correct on the file?
        • No errors. After clearing the cache that file simply doesn't update unless you delete it. The last modified date doesn't change when clearing the cache when the other files do update. Something happens to this file after some amount of time and MODx can no longer write to it.

          So I create a new page with an alias, aliasfoo, and go to the website.com/aliasfoo and get a 404. If I delete that file and clear cache then website.com/aliasfoo works.

          When you clear the cache does MODx delete these cache files then write new ones or does it append to the files?
          • If it's a bug then that's one more reason the update MODx or switch to something else.
            • Is there a known issue that was discussed? Looking through the change logs and not seeing any specific mention about cache corruption.
              • There are no cache corruption issues I am aware of other than those discussed by folks on platforms that are using a multi-threaded API that cannot reliably use flock to get reliable exclusive locks for writing, e.g. GoDaddy's hosting.
                • I have no hard evidence of cache corruption. My opinion on it is based on the number of Forum posters with serious site problems for whom clearing the site cache in the Manager didn't work, but deleting the files in the core/cache folder did.

                  It seems to me that I saw a lot more of these in the early 2.0.x releases, though it still seems to occur. It's possible that all of them come from people with substandard hosting, but IMO, it would be better if MODX didn't crash on those platforms. I don't think WordPress does, but I could be wrong.


                  ------------------------------------------------------------------------------------------
                  PLEASE, PLEASE specify the version of MODX you are using.
                  MODX info for everyone: http://bobsguides.com/modx.html
                    Did I help you? Buy me a beer
                    Get my Book: MODX:The Official Guide
                    MODX info for everyone: http://bobsguides.com/modx.html
                    My MODX Extras
                    Bob's Guides is now hosted at A2 MODX Hosting
                  • Thanks guys.
                    • FWIW, I have refactored the the way xPDO/MODX write the cache files for 2.2.5-pl, adding an option to not depend on flock. By setting a use_flock option to false in your $config_options array in the MODX config file, you can use an alternative file locking mechanism I have added that should work on servers that cannot reliably depend on flock to lock files across unique PHP threads. In particular, this should help those on GoDaddy hosting, RackSpace Cloud hosting, and other hosting providers where folks are experiencing blank pages on the front-end that are resolved only by refreshing or manually deleting the cache contents.

                      You can see the changes here.