We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 50272
    • 89 Posts
    Hi Folks

    I've read pretty much all that is available on the subject and there still doesn't seem to be a definitive solution.
    The Error Log throws these kinds of errors on a very regular basis...
    I've just resorted to testing on a brand spanking latest version (2.5.7) install;
    Out of the box defaults.
    No Extras.
    No System Settings changes.
    Added one simple chunk and there it is...
    (ERROR @ /Applications/MAMP/htdocs/test_modx_fresh/core/model/modx/modcachemanager.class.php : 344) Error caching lexicon topic lexicon/en/core/resource

    I'm not sure if there is any substance to me thinking the problem has increased since 2.5.7 was released, or that in my stupor, I'm simply imagining this.

    Can anyone shine any authoritative wisdom on this highly frustrating issue.
    My need for a barber is rapidly diminishing by the day.
    Many thanks in advance

    Chris


    My setup:
    MODX latest (2.5.7)
    MAMP (latest (3.0.7.3))
    PHP (5.5.26)
    MySQL (5.5.38)
    Chrome: Std and Canary (latest versions)
    MacOS Sierra 10.12.5



      • 3749
      • 24,544 Posts
      If you want to try to get to the bottom of this, you can add some more debugging code to the modcachemanager class file. This will crap up your Error Log big time - but it may provide some clues. I've done it on my install, but I very seldom get those error messages.

      In the file core\model\modx\modcachemanager.class.php around line 348, find this code:

      $lifetime = (integer) $this->getOption('cache_lexicon_topics_expires', $options, $this->getOption(xPDO::OPT_CACHE_EXPIRES, $options, 0));
      if (!$this->set($cacheKey, $entries, $lifetime, $options)) {
      $this->modx->log(modX::LOG_LEVEL_ERROR, "Error caching lexicon topic " . $cacheKey);
      }

      Add the three extra log lines below so it looks like this:

      $lifetime = (integer) $this->getOption('cache_lexicon_topics_expires', $options, $this->getOption(xPDO::OPT_CACHE_EXPIRES, $options, 0));
      if (!$this->set($cacheKey, $entries, $lifetime, $options)) {

      $this->modx->log(modX::LOG_LEVEL_ERROR, "Error caching lexicon topic " . $cacheKey); // existing line
      $this->modx->log(modX::LOG_LEVEL_ERROR, 'LIFETIME: ' . $lifetime);
      $this->modx->log(modX::LOG_LEVEL_ERROR, 'ENTRIES: ' . print_r($entries, true));
      $this->modx->log(modX::LOG_LEVEL_ERROR, 'OPTIONS: ' . print_r($options, true));
      }

      Copy and paste *just* those three lines below the existing log line.







        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
        • 50272
        • 89 Posts
        I've adopted your suggestion and studying the log as I go.
        Since the additional code I've noticed these two coming up very regularly...

        [2017-07-03 19:18:23] (ERROR @ /Applications/MAMP/htdocs/_cmvc_modx/core/model/modx/modcachemanager.class.php : 347) OPTIONS: Array
        (
            [cache_key] => lexicon_topics
            [cache_handler] => xPDOFileCache
            [cache_format] => 0
            [cache_attempts] => 1
            [cache_attempt_delay] => 1000
        )


        and...

        [2017-07-04 00:29:05] (ERROR @ /Applications/MAMP/htdocs/_cmvc_modx/core/xpdo/om/xpdoobject.class.php : 811) modTemplateVar: Attempt to set NOT NULL field type to NULL


        I've also begun to be involuntarily logged out of the manager on occasion...

        I don't profess to know exactly what I'm looking for,
        but as you suggest the extra log info will hopefully lead me out of the woods...

        Many thanks for your time Bob
          • 3749
          • 24,544 Posts
          Thanks for testing. Now what we need is to see what things look like when there's no error:

          Change this (briefly):

          if (!$this->set($cacheKey, $entries, $lifetime, $options)) {
               $this->modx->log(modX::LOG_LEVEL_ERROR, "Error caching lexicon topic " . $cacheKey);
               $this->modx->log(modX::LOG_LEVEL_ERROR, 'LIFETIME: ' . $lifetime);
               $this->modx->log(modX::LOG_LEVEL_ERROR, 'ENTRIES: ' . print_r($entries, true));
               $this->modx->log(modX::LOG_LEVEL_ERROR, 'OPTIONS: ' . print_r($options, true));
          }


          to this:

          if (!$this->set($cacheKey, $entries, $lifetime, $options)) {
              $this->modx->log(modX::LOG_LEVEL_ERROR, "Error caching lexicon topic " . $cacheKey);
              //  $this->modx->log(modX::LOG_LEVEL_ERROR, 'LIFETIME: ' . $lifetime);
              //  $this->modx->log(modX::LOG_LEVEL_ERROR, 'ENTRIES: ' . print_r($entries, true));
              //  $this->modx->log(modX::LOG_LEVEL_ERROR, 'OPTIONS: ' . print_r($options, true));
          } else { /* non-error condition */
              $this->modx->log(modX::LOG_LEVEL_ERROR, 'NORMAL LEXICON CACHE');
              $this->modx->log(modX::LOG_LEVEL_ERROR, 'LIFETIME: ' . $lifetime);
              $this->modx->log(modX::LOG_LEVEL_ERROR, 'ENTRIES: ' . print_r($entries, true));
              $this->modx->log(modX::LOG_LEVEL_ERROR, 'OPTIONS: ' . print_r($options, true));
          }
          


          As soon as you get a hit (make sure it says 'NORMAL' in the log), cut and paste one of the non-error results (all four error messages) into a new, empty chunk for reference (make sure it says 'NORMAL' in the log), then change the code back to my original.

          The next time a real error occurs (it won't say NORMAL), paste all three error messages into the same chunk and see if you can spot any differences between the normal and error sections.
            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
            • 50272
            • 89 Posts
            Hi Bob

            Firstly, just to say I hadn't abandoned this thread.
            As the error hits seem to my relatively untrained eye as kind of random, I'm still trying to recognise any concrete patterns or differences in the two logs, such is the sheer volume of crud that is being spilled out. That said, none of this seems to adversely affect the site/manager functionality (aside some lag in refreshing the manager).
            Leave it with me for a while longer...

            Many thanks