Issue with categories : forums won't display the homepage anymore.



  • Hello,

    I ran into a pretty annoying issue last week after upgrading from 0.5.3 to 0.5.4.

    The problem is my forum throws me some errors regarding the categories which I can't even access in the admin panel.

    Here's a screenshot of the log :

    log.jpg

    If anyone has an idea on how to fix this, it would be great 🙂


  • Admin

    Can you post the output of the following.

    redis-cli
    zrange categories:cid 0 -1
    

    That should list the category ids in the database. After that you can check the data for those categories with

    hgetall category:<id>
    

    Seems like a category doesn't have proper data or was purged but not removed from categories:cid.



  • @baris Thank you for your quick reply ! Here's the log :

    1) "1"
    2) "2"
    3) "14"
    4) "15"
    5) "11"
    6) "13"
    7) "12"
    8) "16"
    9) "{categories.cid}"

  • Admin

    That last one definitely looks wrong. If you have all your categories in that range(1,2,11,12,13,14,15,16). You can remove that last one with.

    redis-cli
    zrem categories:cid "{categories.cid}"
    


  • @baris And ... it works again ! Thank you for your help !


  • Admin

    No problem. I am curious as to why that value is in categories:cid if you can manage to repro that would be helpful. You seem to have deleted some categories was this an imported forum by any chance?



  • Hello, I have the same issue as @brieucswales

    I used the drag and drop in the admin panel, in the manage/categories section, to move up a category and now I have the same error and strange behaviour.

    In order to be able to repair the damaged category what would be the command with Mongo since the solution above is for redis?

    Thanks for your help!


  • Admin

    @TaLoche first grab the list of category ids

    mongo
    db.objects.find({_key:"categories:cid"}).pretty();
    

    Then to remove the wrong one.

    db.objects.remove({_key:"categories:cid", value: "<insert_cid_here>"});
    

    I will see if can reproduce this.



  • @baris Thanks!

    The category causing all the trouble

    "_id" : ObjectId("547e1db2f303ddd981c99ad0"),
    "_key" : "categories:cid",
    "score" : 1,
    "value" : "2"

    When it should be

    "_id" : ObjectId("547e1db2f303ddd981c99ad0"),
    "_key" : "categories:cid",
    "value" : "2"
    "score" : 1,

    Is there a way to change that without removing the category as you suggested? It's a big category with a lot of topics in it. I don't want to purge it if I have a choice.


  • Admin

    Those two objects look identical to me, both have score:1 and value:2. In this case score is the order and value is the category id.

    Can you post the full output of db.objects.find({_key:"categories:cid"}).pretty();



  • sorry wrong pasted code! I've updated my previous message.



  • {
    "_id" : ObjectId("54902fe6e0b2fdca2defe7f7"),
    "_key" : "categories:cid",
    "value" : "3",
    "score" : 4
    }
    {
    "_id" : ObjectId("547e1db2f303ddd981c99ad0"),
    "_key" : "categories:cid",
    "score" : 1,
    "value" : "2"
    }
    {
    "_id" : ObjectId("54902e94e0b2fdca2defc05c"),
    "_key" : "categories:cid",
    "value" : "15",
    "score" : 2
    }
    {
    "_id" : ObjectId("54902e16e0b2fdca2def9e07"),
    "_key" : "categories:cid",
    "value" : "14",
    "score" : 5
    }
    {
    "_id" : ObjectId("548ecd53e0b2fdca2def5123"),
    "_key" : "categories:cid",
    "value" : "13",
    "score" : 6
    }
    {
    "_id" : ObjectId("548ecae1e0b2fdca2def493e"),
    "_key" : "categories:cid",
    "value" : "12",
    "score" : 3
    }
    {
    "_id" : ObjectId("548ec825e0b2fdca2def493b"),
    "_key" : "categories:cid",
    "value" : "11",
    "score" : 4
    }


  • Admin

    You category ids look good, there is only a dupe score of 4 but that shouldn't break anything, what problem are you having? Is the category not visible on the home page? Is there any crashes in the output.log.



  • Ok, I thought that the second category having it's value and score not in the same order as the others was the issue.

    I can hardly access my admin panel, but I manage to go in every section, except the categories one.

    On my front page I have "Failed to lookup view "footer" in views directory" or Failed to lookup view "admin/footer" in views directory

    When I check my log, I have the exact issue as @brieucswales (his screenshot).
    I have tried, restarting and rebooting, nothing changes.
    If I stay on the homepage or admin panel every 30 secondes, I have a refresh notification that keeps poping-up even if I have already refreshed the page.

    Since drag and dropping that category was the last thing I did, I'm guessing that's the issue. Since when I log out, I can see all the categories on the homepage except the one that I drag and dropped.


  • Admin

    Sounds like something else is not working properly, the refresh icon is an indication of sockets disconnecting and trying to reconnect. Is you forum public?



  • @baris Ah crap! I had all my hopes on this category thing.

    For now my nodebb forum in hosted on DigitalOcean but I'm the only one having fun with it for now.
    I had help from Nifty to export my old forum (mybb) onto my droplet. I was just cleaning up by setting up new categories, deleting some topics and I was about to set up a theme and plugins.


  • Admin

    If you have a public url that you can share post it maybe sockets aren't setup properly. Your browser console should give more info as well.

    Another way to confirm if your category data is good is to go to http://yourforum.com/api that should return all the categories on the homepage.



  • This post is deleted!


  • 2014-12-16T18:35:01.594Z - info: [hotswap] Router with id `plugins` replaced successfully
    2014-12-16T18:35:01.595Z - info: [plugins] All plugins reloaded and rerouted
    2014-12-16T18:35:01.609Z - info: [meta/css] Minifying LESS/CSS
    2014-12-16T18:35:01.611Z - info: NodeBB attempting to listen on: 0.0.0.0:4567
    2014-12-16T18:35:01.612Z - info: [hotswap] Router with id `auth` replaced successfully
    [cluster] Child Process (6026) listening for connections.
    2014-12-16T18:35:01.617Z - info: NodeBB is now listening on: 0.0.0.0:4567
    2014-12-16T18:35:01.667Z - info: [meta/templates] Compiling templates
    2014-12-16T18:35:02.020Z - info: [cluster] Client-side javascript and mapping propagated to worker 159
    2014-12-16T18:35:02.041Z - info: [sounds] Sounds OK
    2014-12-16T18:35:02.104Z - info: [cluster] Stylesheets propagated to worker 159
    2014-12-16T18:35:02.653Z - info: [meta/templates] Successfully compiled templates.
    2014-12-16T18:35:02.711Z - error: TypeError: Cannot read property 'parentCid' of null
        at /home/nodebb/nodebb/src/categories.js:427:31
        at Array.filter (native)
        at /home/nodebb/nodebb/src/categories.js:426:28
        at /home/nodebb/nodebb/node_modules/async/lib/async.js:249:17
        at /home/nodebb/nodebb/node_modules/async/lib/async.js:125:13
        at Array.forEach (native)
        at _each (/home/nodebb/nodebb/node_modules/async/lib/async.js:46:24)
        at async.each (/home/nodebb/nodebb/node_modules/async/lib/async.js:124:9)
        at _asyncMap (/home/nodebb/nodebb/node_modules/async/lib/async.js:248:13)
        at Object.map (/home/nodebb/nodebb/node_modules/async/lib/async.js:219:23)
    TypeError: Cannot read property 'parentCid' of null
        at /home/nodebb/nodebb/src/categories.js:427:31
        at Array.filter (native)
        at /home/nodebb/nodebb/src/categories.js:426:28
        at /home/nodebb/nodebb/node_modules/async/lib/async.js:249:17
        at /home/nodebb/nodebb/node_modules/async/lib/async.js:125:13
        at Array.forEach (native)
        at _each (/home/nodebb/nodebb/node_modules/async/lib/async.js:46:24)
        at async.each (/home/nodebb/nodebb/node_modules/async/lib/async.js:124:9)
        at _asyncMap (/home/nodebb/nodebb/node_modules/async/lib/async.js:248:13)
        at Object.map (/home/nodebb/nodebb/node_modules/async/lib/async.js:219:23)
    2014-12-16T18:35:02.712Z - info: [app] Shutdown (SIGTERM/SIGINT) Initialised.
    2014-12-16T18:35:02.714Z - info: [app] Database connection closed.
    2014-12-16T18:35:02.714Z - info: [app] Web server closed to connections.
    2014-12-16T18:35:02.714Z - info: [app] Shutdown complete.
    [cluster] Child Process (6026) has disconnected
    [cluster] Child Process (6026) has exited (code: 1, signal: null)
    [cluster] Spinning up another process...
    2014-12-16T18:35:02.899Z - info: Time: Tue Dec 16 2014 13:35:02 GMT-0500 (EST)
    2014-12-16T18:35:02.903Z - info: Initializing NodeBB v0.5.7
    2014-12-16T18:35:02.903Z - info: * using configuration stored in: /home/nodebb/nodebb/config.json
    2014-12-16T18:35:02.903Z - info: * using mongo store at 127.0.0.1:27017
    2014-12-16T18:35:02.903Z - info: * using themes stored in: /home/nodebb/nodebb/node_modules
    2014-12-16T18:35:03.207Z - warn: You have no mongo password setup!
    2014-12-16T18:35:03.969Z - info: [user.startJobs] Registering User Jobs
    [cluster] Child Process (6047) listening for connections.
    
    2014-12-16T18:35:04.162Z - warn: [plugins/nodebb-plugin-mentions] This plugin may not be compatible with your version of NodeBB. This may cause unintended behaviour or crashing.
    2014-12-16T18:35:04.162Z - warn: [plugins/nodebb-plugin-mentions] In the event of an unresponsive NodeBB caused by this plugin, run ./nodebb reset plugin="nodebb-plugin-mentions".
    
    
    2014-12-16T18:35:04.164Z - warn: [plugins/nodebb-widget-essentials] This plugin may not be compatible with your version of NodeBB. This may cause unintended behaviour or crashing.
    2014-12-16T18:35:04.164Z - warn: [plugins/nodebb-widget-essentials] In the event of an unresponsive NodeBB caused by this plugin, run ./nodebb reset plugin="nodebb-widget-essentials".
    
    
    2014-12-16T18:35:04.166Z - warn: [plugins/nodebb-plugin-markdown] This plugin may not be compatible with your version of NodeBB. This may cause unintended behaviour or crashing.
    2014-12-16T18:35:04.166Z - warn: [plugins/nodebb-plugin-markdown] In the event of an unresponsive NodeBB caused by this plugin, run ./nodebb reset plugin="nodebb-plugin-markdown".
    
    2014-12-16T18:35:04.685Z - info: [hotswap] Router with id `plugins` replaced successfully
    2014-12-16T18:35:04.685Z - info: [plugins] All plugins reloaded and rerouted
    2014-12-16T18:35:04.700Z - info: [meta/css] Minifying LESS/CSS
    2014-12-16T18:35:04.702Z - info: NodeBB attempting to listen on: 0.0.0.0:4567
    2014-12-16T18:35:04.703Z - info: [hotswap] Router with id `auth` replaced successfully
    [cluster] Child Process (6047) listening for connections.
    2014-12-16T18:35:04.709Z - info: NodeBB is now listening on: 0.0.0.0:4567
    2014-12-16T18:35:04.788Z - info: [meta/templates] Compiling templates
    2014-12-16T18:35:05.055Z - info: [sounds] Sounds OK
    2014-12-16T18:35:05.083Z - info: [cluster] Client-side javascript and mapping propagated to worker 160
    2014-12-16T18:35:05.142Z - info: [cluster] Stylesheets propagated to worker 160
    2014-12-16T18:35:05.688Z - info: [meta/templates] Successfully compiled templates.
    2014-12-16T18:35:08.908Z - info: [meta/css] admin.css committed to disk.
    2014-12-16T18:35:10.836Z - info: [meta/css] stylesheet.css committed to disk.
    2014-12-16T18:35:13.432Z - info: [meta/js] Minification complete
    2014-12-16T18:35:13.523Z - info: [meta/js] Client-side minfile and mapping committed to disk.
    2014-12-16T18:35:13.523Z - info: NodeBB Ready
    

  • Admin

    Can you post the output of the following

    db.objects.find({_key:"category:2"}).pretty();
    db.objects.find({_key:"category:3"}).pretty();
    db.objects.find({_key:"category:11"}).pretty();
    db.objects.find({_key:"category:12"}).pretty();
    db.objects.find({_key:"category:13"}).pretty();
    db.objects.find({_key:"category:14"}).pretty();
    db.objects.find({_key:"category:15"}).pretty();
    

    Any of those empty?


Log in to reply
 


Star

Looks like your connection to NodeBB was lost, please wait while we try to reconnect.