• GNU/Linux Gamers

    Hello. Yesterday I updated my NodeBB from 1.18.0 to .3 and restarted the computer it runs on (Ubuntu 20.04 ish, regular laptop home hosted) and when I boot it back up I realize the mongodb service won’t start no matter what. I couldn’t figure this out, and NodeBB doesn’t start of course if database isn’t running.

    I looked around and realized that it wasn’t loading the confit file or something, because there error was that it couldn’t find a database at this path because it was hosted in a different path. (It thought it was in default db folder but I set config to a different
    Anyway I can get it to work if I open a terminal and sudo mongodb -dbpath my/correct/path

    But I would rather not keep it in a terminal window and instead have it be a service

  • Topic has been marked as a question  dunlix dunlix 
  • Community Rep

    @dunlix So you updated NodeBB only? No other system updates that may have touched mongodb, correct? Cuz, if so, then this just seems bizarre - why, oh why, would a NodeBB update/grade have anything to do with mongodb? Mongodb should still start regardless, independent, of any NodeBB changes. It is not like they are joined at the hip. One uses your pkg manager to update, whilst the other is.... other... depending on how you do it.

    If sudo is working for you, and assuming that you are otherwise utilizing systemd to launch mongodb, I suggest you either 1) examine the mongodb service file and tweak to point to correct path, or 2) relocate that mongodb data dir to where mongodb expects to find it. Then go from there.

    Hope this helps. But, like I said, unless you also ran some system wide updates, this seems rather bizarre.

    Good luck and have fun! o/ 🐕

    @dunlix said in Mongodb not working:

    realized that it wasn’t loading the confit file or something, because there error was that it couldn’t find a database at this path

    This needs to be investigated further. Logs??

  • GNU/Linux Gamers

    @gotwf I agree I’m the sense that this problem really isn’t a bug with NodeBB unless it messed with systemctl or something (I don’t even have NodeBB running as a service)
    Of course I would rather mongo not be in console window because of clutter, security, etc.

    The problem really is that Systemctl or services or whatever fail to try to start mongo with proper path and it doesn’t work ofc. But I don’t know how to fix this, even though it’s probably s simple fix.

    Also I didn’t run any updates other than NodeBB until after this problem started

  • GNU/Linux Gamers

    @gotwf also I can get logs later if you tell me where to find them
    I guess they will say the same thing that the path is invalid

  • Community Rep

    @dunlix Cannot speak for Ubuntu but on CentOS they are thus:

    [root@forums mongodb]# pwd
    [root@forums mongodb]# ll
    total 11533
    -rw-r----- 1 mongod mongod 11753544 Sep 22 20:39 mongod.log

    Similarly, I expect your mongo.conf to be located under /etc:

    [root@forums ~]# ll /etc/mongod.conf

    I expect same on Ubuntu but one never knows. Especially since your data dir appears to be in an atypical location.

    In any event, you should be able to scout mongod.conf for parameters such as system log and data dir paths.

    [root@forums ~]# grep -i dbpath /etc/mongod.conf
      dbPath: /var/lib/mongo

    Then edit your nodebb config.json as appropriate.

    Seems like maybe, just maybe, your nodebb update/grade may have somehow overwritten your config.json? 🤔

    Have fun and good luck! o/

  • GNU/Linux Gamers

    @gotwf I know my NodeBB config wasn’t changed or anything because I actually checked in case I overwrote it.
    If all comes to loss then I could just move the db to its default location that it wants

  • Community Rep

    @dunlix Would not it be simpler to just tweak your nodebb config.js to point to the correct mongod datadir?

  • GNU/Linux Gamers

    @gotwf doesn’t NodeBB only connect to mongo through local host and default port? I didn’t think the data dir. is even a part of the NodeBB.config

  • Community Rep

    @dunlix Uh, duh!! Apologies for the brain fart on that one. !Aye, caramba!! 🤦

Suggested Topics

| |