We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22835
    • 54 Posts
    I run a couple of Modx sites all revo at various versions. Something that routinely happens with all sites on different servers is the cache gets corrupted and I have to manually clear it.

    Needless to say when the page goes blank serving 500 error my clients get very jittery... it's starting to grate on me now.

    Why does this keep happening with Modx?
      • 10208 ☆ A M B ☆
      • 1,780 Posts
      Is there something the same that you do with every installation? An extra perhaps?

      And, is it just a couple sites (2)? Or are there more than that having the issue? Are you able to find out which file is actually corrupted in the cache? What's in the error log?
        Frogabog- MODX Websites in Portland Oregon
        "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
        Having server issues? These guys have MODX Hosting perfected - SkyToaster
        • 3749
        • 24,544 Posts
        This seems to happen to a small number of people. No one knows why at this point. It's never happened to me on a production site. This snippet will clear the cache for you http://bobsguides.com/cache-clear-tutorial.html, though obviously it's not a real solution.

        One user set up a cron job to clear the cache at certain intervals.

        As Frogabog says, you might see a clue in the error log.

        If you can figure out which part of the cache is getting corrupted, it might help find the problem and deleting just that part of the cache won't slow down your site as much.

        You can delete single directories 0ne-by-one in the cache and see if things clear up. I'd start with the plugin cache. If you find out which directory it's in, you can drill down from there the next time it happens by deleting subdirectories and/or files under it.
          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
          • 22835
          • 54 Posts
          Sounds like I'll have to isolate the erroneous files the next time it happens. 2 sites that it is particularly bad on have getResources working heavily... so I'm suspecting that.

          Will report back next time it happens
            • 39333
            • 151 Posts
            I've had this same problem on a couple sites, although since upgrading from around version 2.2 I no longer have seen this, not even once. I'm much more diligent with version and details within my installs now however as well.

            As a note neither of the sites mentioned were using getResources so I would be surprised if that is the cause unless the add-on is actually corrupted.

            I personally tried every fix I could find suggested everywhere, and there were many, without any permanent fix. I also tried different solutions in different configurations with also no permanent fix. Troubleshooting this with my host company we determined, as you said, a corrupted cache was the cause and that's as close as we could come to the root of the problem.

            Deeper research lead me to find out there are some malicious activities that site visitors can do which also duplicates this problem and while you may not have pissed off some script kiddie or nefarious type directly there are always those who only truly feel united through hatred and go around causing problems for others to make themselves feel better about their daily lives. These types don't care to fully understand your situation, only to punish by a set of standards they don't actually apply to themselves or purposely overlook with those in their inner circle.

            Something may have gotten corrupted within the MODX install itself as well. If it were me and I was sick of dealing with clearing the cache over and over I would do a separate fresh install of the latest version, import the DB, log into the site, force remove each add on, and reinstall them one by one. This would eliminate the possibility of a corrupted file within the MODX install or add-on all in one swoop.

            It's really very easy to do and unless you have dozens and dozens of add-ons won't take long. With this method I have successfully removed lots of strange "corrupt" behaviors on my installs and have never had a site not come back up 110% perfect after these steps. As an added step I would also recommend removing your Core directory from the web root on your host as leaving it there makes an easy target for vengeful or hateful types to target. Again this is very easy to do.

            Hope this helps smiley
              MODX...the Zen of CMS
              "Bight off more than you can chew and keep right on chewing."