header

Collapse

Server error when merging topics

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Go to Thank You Nelioneil
    Junior Member
    • 01.2021
    • 8
    • 0
    • 0

    Font Size
    #1

    Server error when merging topics

    Go to Thank You
    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_ASC, vB_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



    Devami...Go to Top of Post
    Similar Threads
X

Thread Information

Collapse

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

    Those who read this thread

    Collapse

    Members who have read this thread: 0

      Related Topics

      Collapse

      Topics Statistics Last Post
      Started by vB-Info, 2 weeks ago
      0 responses
      4 views
      0 reactions
      Last Post vB-Info
      by vB-Info
      Started by vB-Info, 2 weeks ago
      0 responses
      2 views
      0 reactions
      Last Post vB-Info
      by vB-Info
      Started by vB-Info, 13.03.24, 20:42
      0 responses
      21 views
      0 reactions
      Last Post vB-Info
      by vB-Info
      Working...
      😀
      😂
      🥰
      😘
      🤢
      😎
      😞
      😡
      👍
      👎

      AdBlock Detected

      Please Disable Adblock

      Please consider supporting us by disabling the ad blocker.

      I've Disabled AdBlock
      Home