Announcement

Collapse
No announcement yet.

Server error when merging topics

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Server error when merging topics

    Hello,

    We are trying to troubleshoot an issue with our forums that causes a 500 error when trying to merge two topics in the same channel. I have traced the execution path of the web request that causes the error: /ajax/api/node/mergeTopics

    forums/core/vb/api/node.php
    LINE 730: public function mergeTopics
    LINE 552 public function moveNodes

    Forums/core/vb/library/node.php
    LINE 4600: function moveNodes
    LINE 5055: function moveNodesInternal
    === goes back to moveNodes LINE 4807
    LINE 90: function clearChildCache
    LINE 3583: function fetchClosureChildren
    === ERRORS HERE - line 3615 - query returns 13 million+ rows

    Inside fetchClosureChildren

    PHP Code:
    //Search for what's left
    //Note that even if we were passed a parentid we still get the complete ancestry and cache it.
    $closureRecs vB::getDbAssertor()->assertQuery('vBForum:closure', array(vB_dB_Query::TYPE_KEY => vB_dB_Query::QUERY_SELECT,
    'parent' => $notfound), array('field' => array('parent''depth'),
    'direction' => array(vB_dB_Query::SORT_ASCvB_dB_Query::SORT_DESC))); 
    The $notfound array includes the node IDs of the two topics being merged, as well as the Channel ID itself. Because the channel ID is included here, that query returns almost 13 millions rows from the closure table. The result is being assign to $closureRecs, so it's likely blowing out the PHP memory limit and causing the error.

    Is there a bug here? Is it necessary to include the Channel ID itself along with the two IDs of the topics being merged? Removing the channel ID results in 71 rows being returned instead of 13 million.

    -Thanks

  • #2
    What is the actual PHP Error from your PHP Error Log?

    If you put your site into Debug Mode, it should provide the error on screen and a stack output.
    Translations provided by Google.

    Wayne Luke
    The Rabid Badger - a vBulletin Cloud demonstration site.
    vBulletin 5 API

    Comment


    • #3
      Even with debug mode on, there is no extra info or stack output... likely because this is the result of an AJAX call and not a page load?

      Click image for larger version

Name:	Screen Shot 2021-02-08 at 1.39.15 PM.png
Views:	61
Size:	13.4 KB
ID:	4453592

      Comment


      • #4
        Normally, the error is returned even via AJAX.

        What is logged in the PHP Error Log?
        Translations provided by Google.

        Wayne Luke
        The Rabid Badger - a vBulletin Cloud demonstration site.
        vBulletin 5 API

        Comment


        • #5
          It looks like timeout errors

          Code:
          [08-Feb-2021 18:55:51] WARNING: [pool www] child 12408, script '/usr/share/nginx/html/main/public/forums/index.php' (request: "POST /forums/index.php?routestring=ajax/api/node/mergeTopics") execution timed out (128.910626 sec), terminating
          [08-Feb-2021 18:55:51] WARNING: [pool www] child 12408 exited on signal 15 (SIGTERM) after 4880.095325 seconds from start

          Comment


          • #6
            This error also occurs, but only sometimes

            An unexpected error was returned: 'Too few arguments to function vB_Library_Node::deleteNodes(), 1 passed in /usr/share/nginx/html/main/public/forums/core/vb/api/node.php on line 863 and at least 3 expected'

            Comment


            • #7
              Will have the developers look in on this topic.
              Translations provided by Google.

              Wayne Luke
              The Rabid Badger - a vBulletin Cloud demonstration site.
              vBulletin 5 API

              Comment


              • southstar86
                southstar86 commented
                Editing a comment
                Thank you!

            Related Topics

            Collapse

            Working...
            X