We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29796
    • 91 Posts
    My error log is filled up with errors like:

    [19-Oct-2017 21:33:06] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /www/core/xpdo/xpdo.class.php on line 1241
    [19-Oct-2017 21:42:42] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /www/core/xpdo/xpdo.class.php on line 2160
    [19-Oct-2017 21:43:17] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /www/core/xpdo/xpdo.class.php on line 695
    [19-Oct-2017 22:16:07] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /www/core/xpdo/om/xpdoobject.class.php on line 425
    [19-Oct-2017 22:24:15] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /www/core/xpdo/xpdo.class.php on line 1400
    [19-Oct-2017 22:26:30] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /www/core/xpdo/om/xpdoobject.class.php on line 2419
    [19-Oct-2017 22:29:00] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /www/core/model/modx/modx.class.php on line 1176
    [19-Oct-2017 22:31:29] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /www/core/model/modx/modx.class.php on line 2711
    [19-Oct-2017 22:40:09] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /www/core/xpdo/om/xpdoobject.class.php on line 236
    [19-Oct-2017 22:40:45] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /www/core/xpdo/om/xpdoobject.class.php on line 985
    


    and I can't figure it out the cause. Error occurs in same 2-3 files but always in different lines. Anyway ... what is the best way to get to the cause of this ?? I can't debug on a live site so I created a copy of that page locally. The problem is that local page has no visitors and error rarely is displayed.

    Any tips?

    This question has been answered by theuros. See the first response.

      • 3749
      • 24,544 Posts
      You probably know this, but some PHP script (plugin or snippet) you're running is taking more than 30 seconds to run. The error shows up on different lines because that's where the program was when it hit the time limit. It can be a different place each time depending on how busy the server is.

      It's a script or plugin related to those two pages. What snippets tags are on those pages?

      What plugins are connected to events that would fire when you view those pages?

        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
        • 29796
        • 91 Posts
        Yea I know that those errors are caused by some faulty script, I just wanted to know if there is a easier way to find it out beside checking every element on that page.

        Current suspect are default output modifiers which are overused for my taste. Error log is filled with "PHP warning: A non-numeric value encountered" which are caused by using dateformat filter on empty TV.

        Well... I'll start to find all elements which are rendered and debug them step by step. Is there a way to find what snippets, chunks and plugins are called when processing a specific page?
          • 3749
          • 24,544 Posts
          There will be a snippet tag in the page content, the template. There may also be chunk tags on the page where the chunk contains a snippet tag.

          Unfortunately, plugins will execute any time a System Event they're attached to is fired.

          It might be easier to start disabling things.

          You can right-click on plugins in the tree to disable them. I'd start there.

          Snippets can be disabled by putting a space between the first to brackets:

          [ [SnippetName]]


          When you do that, you'll usually see the tag on the page rather than the results of the snippet code.

          You could also have a circular reference. For example, you could have a getResources tag that processes the page with the tag. In that case getResources is called over and over endlessly, though that usually depletes memory before it would hit the time limit, unless the server is slow (which it could be with that many sites).

          Another possibility is a script that calls a remote service (e.g., a Twitter of Facebook feed) that takes a long time to respond.

          Complex, conditional output modifiers are notoriously slow, though usually not enough to use up that much time. One issue is that usually all the possible cases are executed, whether they're ultimately used or not. It might make sense to try disabling the tags containing the output modifiers first.
            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
          • discuss.answer
            • 29796
            • 91 Posts
            I forgot to reply to this post sooner. After reviewing all snippets and plugins I found my dumb mistake which caused timeouts. Basically I just had a non existing ID on error_page, so every time wrong URL was entered site went to timeout.
              • 3749
              • 24,544 Posts
              That will do it. wink
                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