Post Count display zero



  • Hi Guys,

    I though it would be fixed on 0.5.x but it wasnt.. now im on v0.6.0-dev and still problem on that display.. can you guys checkout?

    Its not showing some posts count.

    bug_nodebb.png


  • Admin

    1. Are you running redis or MongoDB?
    2. Do new posts increment the post counter?
    3. If redis, what does redis-cli hget category:1 post_count return?


  • 1 - Running over mongodb
    2 - new posts dont increment 😕


  • Admin

    Okay. Perhaps this is a persistent issue that only occurs on MongoDB installs. Will have to wait for @baris


  • Admin

    Seems to be only happening on that category?

    Run the following in mongo please

    db.objects.find({_key:"category:1"}).pretty();
    db.objects.find({_key:"global"}).pretty();
    

    Does the post count go up for other categories when you post in them?

    Also that js errors seems to be from templates.js, what version is installed? npm ls templates.js



  • nodebb@0.6.0-dev /home/xxx/nodebb
    └── templates.js@0.1.9

    db.objects.find({_key:"category:1"}).pretty();
    {
        "_id" : ObjectId("52e55fad3cba0a1923de65ea"),
        "_key" : "category:1",
        "bgColor" : "#ca4247",
        "cid" : 1,
        "class" : "col-md-3 col-xs-6",
        "color" : "#fff",
        "description" : "Discussão geral sobre Teste e Desenvolvimento de Software",
        "disabled" : 0,
        "icon" : "fa-doesnt-exist",
        "image" : "https://i.imgur.com/p1zxd9G.png",
        "imageClass" : "cover",
        "link" : "",
        "name" : "Geral",
        "numRecentReplies" : "4",
        "order" : "1",
        "post_count" : NaN,
        "slug" : "1/geral",
        "topic_count" : 31
     }
    
    db.objects.find({_key:"global"}).pretty();
    {
        "_id" : ObjectId("52e55fad3cba0a1923de65dc"),
        "_key" : "global",
        "nextCid" : 12,
        "nextMid" : 128,
        "nextNid" : 557,
        "nextPid" : 309,
        "nextTid" : 105,
        "nextUid" : 252,
        "postCount" : NaN,
        "topicCount" : 99,
        "uniqueIPCount" : 2186,
        "userCount" : 228
    }

  • Admin

    Ok you can fix it by running the below two queries in mongodb

    db.objects.update({_key: "category:1"}, {"$set": {"post_count": 177}});
    db.objects.update({_key: "global"}, {"$set": {"postCount": 297}});
    

    This shouldn't happen again in 0.6.x since there are checks now to prevent the post count from becoming invalid. If it does let me know.



  • @baris I deleted a thread in this category when my board was on 0.5.4... Now we're on 0.6.0-dev and the problem persists. DB backend is Redis.

    funny.png


  • Admin

    What is the url of your forum?



  • @julian, For those on Redis with a similar issue for the widget that shows global post count (increments at times, but not at others) which command should update the count? I've seen a few ask about this, I've still got the issue as well.



  • Thanks @baris


Log in to reply
 


Star

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