We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • Quote from: entica at Jan 21, 2013, 08:47 PM
    Quote from: opengeek at Jan 21, 2013, 02:18 PM
    Just a thought. Can anyone experiencing this error confirm the class_key column values of the (modx_)media_sources table are set to something like sources.modFileMediaSource and not simply to modFileMediaSource? If you have any class_key values here that do not begin with sources., this could be the cause of this error in several places.

    Just checked my table. It only has a single entry and that entry is using sources.modFileMediaSource.
    Well, so much for that idea. tongue
      • 23018
      • 353 Posts
      Happy new year everyone!

      I have several MODx Installations with or without that particular behaviour. Some of them with monstrous error logs.

      I'm about 90% sure that this started to happen after an upgrade to 2.2.6. but it took me some time (and a helpful client) to realize it.

      The MODx error log gets clustered with error block like this one:

      [2013-01-22 18:59:04] (ERROR @ /index.php) sources.modMediaSource::getSelectColumns() is not a valid static method.
      [2013-01-22 18:59:04] (ERROR @ /index.php) Error 42S22 executing query: SELECT `modSnippet`.`id` AS `modSnippet_id`, `modSnippet`.`source` AS `modSnippet_source`, `modSnippet`.`property_preprocess` AS `modSnippet_property_preprocess`, `modSnippet`.`name` AS `modSnippet_name`, `modSnippet`.`description` AS `modSnippet_description`, `modSnippet`.`editor_type` AS `modSnippet_editor_type`, `modSnippet`.`category` AS `modSnippet_category`, `modSnippet`.`cache_type` AS `modSnippet_cache_type`, `modSnippet`.`snippet` AS `modSnippet_snippet`, `modSnippet`.`locked` AS `modSnippet_locked`, `modSnippet`.`properties` AS `modSnippet_properties`, `modSnippet`.`moduleguid` AS `modSnippet_moduleguid`, `modSnippet`.`static` AS `modSnippet_static`, `modSnippet`.`static_file` AS `modSnippet_static_file`, `` FROM `modx_site_snippets` AS `modSnippet` LEFT JOIN `modx_media_sources` `Source` ON `modSnippet`.`source` = `Source`.`id` WHERE `modSnippet`.`name` = ? ORDER BY `modSnippet`.`id` ASC  - Array
      (
          [0] => 42S22
          [1] => 1054
          [2] => Unknown column '' in 'field list'
      )


      In some cases I can see the error log grow by the second. 50Mb per Hour or so...

      I'm still analyzing the situation. As soo as I find a clue, I'll let you know.

      Regards,

      pepebe
        Homepage: pepebe.de | MODX snippets (and other stuff) at github: https://gist.github.com/pepebe
        • 33969
        • 60 Posts
        I am having the same problem. Here are some things I found.

        I am running version 2.2.5-pl (traditional). I just started seeing this error report after adding a sub domain to the client's site and managing it through a new context. The main site and the test site are hosted on 'Blue Host' as shared hosting.

        When I looked at my access logs and compared them to the Error Log report. I found:

        1. The errors were being sent by the Home page of the sub domain
        2. None of the other pages seemed to be causing errors
        3. Most of the time the errors were occuring in groups of six
        4. I couldn't reproduce the errors on the test site
        5. I didn't always get the errors, even after clearing the cache and reloading the page

        Possible causes:

        • There are six TV images that load on every page, including the Home page
        • Five of the TV images are used in a slide rotation, the other sets the background

        The five TV images for the slides on the Home page are coded into the Template while other pages use an 'If' statement and a Chunk to load the images. (So I can disable the slides for certain pages.)

        I hope this helps - since I am only seeing the problem on the main (live) site, I can't do a lot of testing. I suspect that part of the problem might when the TV images get rendered. But, I don't know enough about the order items are loaded to know for sure. However, that might explain why only the Home page seems to be causing errors.

        [ed. note: timrca last edited this post 11 years, 3 months ago.]
          Michael Regan
          TIMR Web Services
          Phone: 250.218.5284
          Eamil: [email protected]
          Website: timr.ca
          • 42694
          • 1 Posts
          I have investigated the problem and indeed it is related to getResources package in combination with Template Variables of type File.
          It is either getValue, prepareOutput method or renderOutput from Template Variable class, but I did not figure out which one makes trouble.
          These methods are called when Template Variables are used in getResources (File ones) and then the error appears.
            • 33969
            • 60 Posts
            I have getResources installed - but it isn't used on that page.

            I looked through the code for the message 'Could not get table name' and it appears to only be in the xPDO class in function getTableName. I changed the error message to the one shown in the Debug level - which gives the table name. Hopefully that will give me some more information.
              Michael Regan
              TIMR Web Services
              Phone: 250.218.5284
              Eamil: [email protected]
              Website: timr.ca
              • 8921
              • 55 Posts
              *BUMP*

              Any traction on this issue? It's starting to cause major support headaches for me with all my clients that are experiencing this.

              I guess a temporary solution would be to come up with some automated way of clearing out the error log every night.
                • 33969
                • 60 Posts
                No - I have made only limit results. Since I can't reproduce the error on my test server - it is very frustrating.

                The problem appears to be in the either xpdo class functions 'getTableName' or 'getAncestry'. 'getTableName' should return '<prefix>_media_sources' for class 'modFileMediaSource' - and most of the time it works. As far as I can tell 'getAncestry' should point 'modFileMediaSource' to 'media_sources'. I have no idea why it fails at times.

                A 'quick and dirty' way to stop the messages would be to edit the function and change:

                $this->log(xPDO::LOG_LEVEL_ERROR, 'Could not get table name for class: ' . $className);


                to

                if($classname != 'modFileMediaSource') {
                  $this->log(xPDO::LOG_LEVEL_ERROR, 'Could not get table name for class: ' . $className);
                }
                


                But I would rather try and find the source of the problem.
                  Michael Regan
                  TIMR Web Services
                  Phone: 250.218.5284
                  Eamil: [email protected]
                  Website: timr.ca
                  • 36816
                  • 109 Posts
                  Greetings,

                  I was also having this problem, and found a work-around in my particular use case. Sharing in case it helps others and/or zeroes-in on the underlying issue.

                  Using 2.2.6-pl standard. getResources installed, but not in play on the resources in the following scenario.

                  Log error entry generates on each front-end access to any resource that references an image TV, but the TV is not set for that resource. TV is referenced simply in a chunk (itself called by the resource template), thus:

                  [[*MyTvImage]]


                  If I add in a conditional output modifier to check for an empty string, and display the contents if non-empty, or nothing if empty, no more log entries. Call to TV in this case, thus:

                  [[*MyTvImage:isequalto=``:then=``:else=`[[*MyTvImage]]`]]


                  TV is configured:


                  • Input type: image
                  • Output type: text
                  • Media sources: filesystem
                    • 36816
                    • 109 Posts
                    A different use case -- using getResources. Caching seems to be impacting the issue when getResources is in play.

                    See my immediately prior message for background. In addition to simple placement of image TVs via chunk/template, on the same site on a different public resource, I have a use case to pull resources that include image TVs via getResources. I'm getting the error on accesses to the resource that calls getResources.

                    As another poster had noted; all that has to happen is for a resource to call getResources on a group of resources that themselves have one or more image TVs even if the image TVs aren't referenced in the output template. I tried changing the template getResources so that it outputs nothing but 'hello world', and the log error still appears.

                    Caching
                    In the process of working with this, I noticed that the first hit to the getResources calling-resource on an empty cache does not generate the error. Hitting it the second and subsequent times -- on a primed cache for that resource -- the error is generated.

                    I experimented with different combinations of cache settings with the following results:

                    1. Disable cache for resources pulled by getResources: error still generated
                    2. Disable caching for getResources call: error not generated. This does not work for my needs, as in this use case, I'm getting a single random resource from a collection on each page visit via getResources
                    3. Change the resource that calls getResources to non-cached: no error, even with the snippet and it's called resources cached

                    So... for the moment, I appear to be stuck with either a non-cached calling resource, or a log file that'll fill up. As I have only one viewable resource in this pickle, I went with disabling its cache.
                    • I had this same problem recently on a 2.2.6 site. It does appear to somehow involve getResources, image TVs and cached pages. For whatever reason the sources.modMediaSource class wasn't getting loading properly and the error log was growing to the tune of ~2MB / day, even though there weren't any visible problems on the front end.

                      Anyway, I tried a bunch of dumb ideas to no effect, then read an interesting discussion of the problem on the Russian MODX forum and gave one of Fi1osof's solutions ( http://community.modx-cms.ru/blog/9096.html#comment58216 ) a go. That is, create a plugin bound to onHandleRequest and put this line in it:
                      $modx->loadClass('sources.modMediaSource');

                      Which explicitly loads the class.

                      22 hours later and and not a single error message! Hat tip to the Russians.
                        Extras :: pThumbResizerimageSlimsetPlaceholders