I just lost a category full of threads when making a new category

Bug Reports
  • #1

    I have a category that does not show up in admin control panel. It's full of threads and I don't know what to do to get it back.

    If I add a new category I can see the missing category in the drop down optional parent list. But I cannot see the category in the Manage -> Categories list.

    I'm also getting ~100% processor usage from the nodejs process when I open the Manage -> Categories. Shutting forums down and starting it up again doesn't help. Shutting down the database and starting it again helps with the 100% processor usage but every time I open up Manage -> Categories again I get 100% processor usage.

    This all started when I made a new category that had the same name as another category and tried to move the first category under the new one. For a while it was displaying the old category under two subcategories and when I tried changing the old one's parent (because I was like "what the hell is this still doing here, in two places?) the whole category just disappeared from the list and what I described above started.

    How can I fix this?

    EDIT: When I try to add a new category now they don't appear on the list.

    EDIT2: If I have the parent category enabled under which the missing subcategory is the forums won't load but admin panel still works. If I disable the parent category then the forums will load.

    EDIT3: I also seem to be unable to set the parent category from Admin panel -> Manage -> Categories -> Edit category -> Parent category button. Pressing it does nothing.

    EDIT4: I'm also unable to remove the main category under which is missing category is. I can't even edit it, I get: "/admin/manage/categories/categories/13 cannot be found"

    I'm not getting any errors in the logs.

    EDIT5: Eventually it will throw me:

    FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory
    [cluster] Child Process (3146) has exited (code: null, signal: SIGABRT)

    EDIT6 not sure if related or not but here:
    15/9 14:37 [13346] - error: RangeError: Maximum call stack size exceeded
    at /home/minecraft/nodebb/node_modules/async/lib/async.js:52:16
    at done (/home/minecraft/nodebb/node_modules/async/lib/async.js:248:21)
    at /home/minecraft/nodebb/node_modules/async/lib/async.js:44:16
    at /home/minecraft/nodebb/node_modules/async/lib/async.js:52:16
    at /home/minecraft/nodebb/node_modules/async/lib/async.js:1166:30
    at /home/minecraft/nodebb/node_modules/async/lib/async.js:52:16
    at done (/home/minecraft/nodebb/node_modules/async/lib/async.js:248:21)
    at /home/minecraft/nodebb/node_modules/async/lib/async.js:44:16
    at /home/minecraft/nodebb/node_modules/async/lib/async.js:52:16
    at /home/minecraft/nodebb/node_modules/async/lib/async.js:1166:30
    [cluster] Child Process (13346) has exited (code: 1, signal: null)
    [cluster] Spinning up another process...

  • Community Rep

    Have you done a database backup? It sounds like the category may still be there, I would do a backup asap in case things get worse.

    No idea how it happened. Sounds to me like some kind of error in the acp when changing the parentCid or children properties of the category. Don't think it has anything to do with the name.

  • #3

    Yes I did backup as soon as this happened. The messages are still there but if I enable the category the forum stops working ... I tried checking out all the tables from Redis that show up with KEYS category but I can't see anything out of place except that the malfunctioning category had itself set as it's parent - which I fixed and it showed up in the Admin Control Panel after that.

    But all the subcategories are somehow messed up - I'm getting categories showing up in several places at once - which I fixed by deleting all subcategories ... but the remaining issue is that I can't access the malfunctioning category at all.

    I don't know what to do about it.

  • NodeBB

    If a category has itself as the parent that would cause an infinite loop in the category retrieval. We should disallow that. Can you post a link to your forum?

  • #6

    Confirmed the problem is fixed by this in latest master. I can now access the category which previously caused infinite loop. By the way, in the Redis database the broken category didn't have itself as parent so I don't know why this would happen ... but it works now so I'm happy. Thanks.

  • NodeBB

    @Pilvinen there is another sorted set that has the categories children. Check that as well.

    zrange cid:<parent_cid>:children 0 -1

    replace <parent_cid> with the category id of the parent.

  • #8

    You were right. The zrange of that category still has itself set as the parant. I'm a bit hazy on the details how the zranges work ... how do I change that value?

  • NodeBB

    Post the output of the zrange that you run.

  • #10


    zrange cid:7:children 0 -1
    1 ) "7"

  • NodeBB

    You can remove it by zrem cid:7:children 7

  • #12

    Thanks. It's now been removed - though the forums already worked fine even without this after the infinite loop was prevented. But better safe than sorry.

  • NodeBB

    Yeah it does work because of the check I added in core. I also added a check so you can't set the parent to itself to prevent it happening again.

Suggested Topics

| | | |