We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22873
    • 9 Posts
    Hello, I have a strange problem with my site. From time to time (direct reason not found), the site frontend stop working and the PHP returns status 500. The backend works properly in that moment. There are a lot of errors in the log about missing cached data (see below for an example). I've already identified, that the problem is somehow connected with caching, but clearing the cache from the Manager does not help. But removing all cache directory contents manually (rm -rf *) always helps and site is OK after it.

    Does anybody have a clue about the reason of such behavior? Or what kind of testing or investigating might I do to find the problem?

    Thanks in advance

    Pavel

    The error log contains (after manual cache delete and in a few minutes):
    [2012-06-06 10:29:10] (ERROR @ /connectors/system/log.php) Could not load class: unknown from mysql.unknown.
    [2012-06-06 10:29:10] (ERROR @ /connectors/system/log.php) unknown::load() is not a valid static method.
    [2012-06-06 10:29:10] (ERROR @ /connectors/system/log.php) Could not load class: unknown from mysql.unknown.
    [2012-06-06 10:29:10] (ERROR @ /connectors/system/log.php) unknown::load() is not a valid static method.
    [2012-06-06 10:42:18] (ERROR @ /index.php) Could not retrieve data to cache for resource 74
    [2012-06-06 10:53:41] (ERROR @ /index.php) Could not retrieve data to cache for resource 468
    


    Environment:
    MODX 2.2.1-pl traditional on a shared hosting with:
    PHP 5.3.2
    Apache/2.2.13 (Unix) DAV/2
    MySQL 5.0.87.d10-ourdelta-log
    Linux Centos, kernel 2.6.18. [ed. note: pavsyk last edited this post 14 years, 3 months ago.]
      • 22873
      • 9 Posts
      I am still not sure, what the reason of the behavior. But I am maybe a step further.

      In the meanwhile, I upgraded MODX to 2.2.2 and it seems the errors are significantly less often.

      When the error happened, I tried to remove the cache subdirectories per one. The site was again OK, when I removed the "media_sources" directory. It seems that it has something to do with it. BTW, it seems that "remove_cache" from the manager / API does not removes the contents of the directory.
        • 3749
        • 24,544 Posts
        Do you have any elements set to be static? One possible cause could be a static element with a bad path or one with the media source set to an invalid media source.


        ------------------------------------------------------------------------------------------
        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
          • 22873
          • 9 Posts
          I still have all elements in the database (I started the site with MODX 2.1.3).
            • 22873
            • 9 Posts
            Next step of investigation done. It is really the "media_sources" directory, or, better said, the "source.cache.php" in it. Suddenly, it has the following contents:
            <?php  return array (
            );<?php  return array (
            );


            I am not an PHP expert, but it seems the PHP interpreter cannot swallow it. It seems as a bug in the MODX. I will put it in the bug tracker.
              • 3749
              • 24,544 Posts
              Yes, that definitely looks like a bug. Thanks for reporting it.


              ------------------------------------------------------------------------------------------
              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
                • 22873
                • 9 Posts