Can't start and setup NodeBB

Technical Support
  • Hello, community.

    I am new to NodeJS and it's ecosystem. So sorry in advance.
    I am trying to install setup and run NodeBB engine, it looks so good. But I have problems from the start. Hoping you can help me.

    So, after I made all from Installation Guide, I am stuck on a moment when I must setup NodeBB with "node app --setup". After I run this (Ubuntu) it gives me an error:

    [ERROR-Server:19654] 1468872592184 [1] failed to authenticate against server 127.0.0.1:27017 { type: 'error',
    message: '[1] failed to authenticate against server 127.0.0.1:27017',
    className: 'Server',
    pid: 19654,
    date: 1468872592184 }
    18/7 23:09 [19654] - error: NodeBB could not connect to your Mongo database. Mongo returned the following error: could not authenticate
    18/7 23:09 [19654] - warn: NodeBB Setup Aborted.
    MongoError: could not authenticate
    at /home/fnk/nodebb/nodebb/node_modules/mongodb-core/lib/topologies/server.js:1492:28
    at /home/fnk/nodebb/nodebb/node_modules/mongodb-core/lib/topologies/server.js:1473:23
    at ScramSHA1.auth (/home/fnk/nodebb/nodebb/node_modules/mongodb-core/lib/auth/scram.js:109:25)
    at authenticate (/home/fnk/nodebb/nodebb/node_modules/mongodb-core/lib/topologies/server.js:1471:42)
    at Timeout._onTimeout (/home/fnk/nodebb/nodebb/node_modules/mongodb-core/lib/topologies/server.js:1485:9)
    at tryOnTimeout (timers.js:224:11)
    at Timer.listOnTimeout (timers.js:198:5)

    "./nodebb start" command doesn't work too. What I should fix to move on?

  • @zehh is your mongod process running during the installation? It seems that the database it not running, what makes nodebb crash during start up.

  • Can't remember was it running during the installation, but I tried right now "./nodebb start" with mongod running - nothing changed 😞

  • Tried "node app --setup" too, nothing work. Here's full output, I choose all defaults, may be I should chose other IP and port?

    fnk@fnk-XPS-L521X:~/nodebb/nodebb$ node app --setup
    19/7 14:48 [5590] - info: NodeBB v1.1.0 Copyright (C) 2013-2014 NodeBB Inc.
    19/7 14:48 [5590] - info: This program comes with ABSOLUTELY NO WARRANTY.
    19/7 14:48 [5590] - info: This is free software, and you are welcome to redistribute it under certain conditions.
    19/7 14:48 [5590] - info:
    19/7 14:48 [5590] - info: NodeBB Setup Triggered via Command Line

    Welcome to NodeBB!

    This looks like a new installation, so you'll have to answer a few questions about your environment before we can proceed.
    Press enter to accept the default setting (shown in brackets).
    URL used to access this NodeBB (http://localhost:4567)
    Please enter a NodeBB secret (qqq111222)
    Which database to use (mongo)

    19/7 14:48 [5590] - info: Now configuring mongo database:
    Host IP or address of your MongoDB instance (127.0.0.1)
    Host port of your MongoDB instance (27017)
    MongoDB username (username)
    Password of your MongoDB database
    MongoDB database name (nodebb)
    Configuration Saved OK
    [ERROR-Server:5590] 1468928947368 [1] failed to authenticate against server 127.0.0.1:27017 { type: 'error',
    message: '[1] failed to authenticate against server 127.0.0.1:27017',
    className: 'Server',
    pid: 5590,
    date: 1468928947368 }
    19/7 14:49 [5590] - error: NodeBB could not connect to your Mongo database. Mongo returned the following error: could not authenticate
    19/7 14:49 [5590] - warn: NodeBB Setup Aborted.
    MongoError: could not authenticate
    at /home/fnk/nodebb/nodebb/node_modules/mongodb-core/lib/topologies/server.js:1492:28
    at /home/fnk/nodebb/nodebb/node_modules/mongodb-core/lib/topologies/server.js:1473:23
    at ScramSHA1.auth (/home/fnk/nodebb/nodebb/node_modules/mongodb-core/lib/auth/scram.js:109:25)
    at authenticate (/home/fnk/nodebb/nodebb/node_modules/mongodb-core/lib/topologies/server.js:1471:42)
    at Timeout._onTimeout (/home/fnk/nodebb/nodebb/node_modules/mongodb-core/lib/topologies/server.js:1485:9)
    at tryOnTimeout (timers.js:224:11)
    at Timer.listOnTimeout (timers.js:198:5)

  • @zehh seems to be a problem of authentication, is the user/password of mongo correctly set? Can you access to the mongoshell throught comand line create a collection or run a simple query?

  • @jarey said in Can't start and setup NodeBB:

    @zehh seems to be a problem of authentication, is the user/password of mongo correctly set? Can you access to the mongoshell throught comand line create a collection or run a simple query?

    Yes, I can access to the mongoshell, can run commands there without errors. As for authorisation, I can't tell for sure, how can I check that? I used defaults without changes (press Enter during setup).

  • You have enabled MongoDB auth settings + given the right password.

    security.authorization must be enabled in mongodb. This must be an auth only issue!

    More info: https://docs.mongodb.com/manual/tutorial/enable-authentication/


Suggested Topics


  • 0 Votes
    8 Posts
    232 Views

    Can you try upgrading to Node 18?

  • 0 Votes
    8 Posts
    538 Views

    You can actually use NPM to install from a specific branch of a GitHub repo. Just do npm install NodeBB/nodebb-theme-persona#timeline-style

    Right now the version in package.js on this branch is the same as on the main branch (10.3.16) so it should work without any changes to NodeBB package.json (not sure if the version of installed theme is checked at the startup, but with the same version it doesn't matter)

    Edit: but as Julian said it's work in progress and, so it may be buggy. Also, I'm not sure if NPM will update it from its registry automatically on your next nodebb upgrade or if you'll have to manually install it back.

  • 0 Votes
    3 Posts
    398 Views

    Hi, do you know the plugin on a tick like on facebook?

  • 0 Votes
    1 Posts
    765 Views

    One of your community members tried to open an old thread with the following title: "Relay actuator sketch - auto off function"

    But NodeBB refuses to serve this to the client.

    I suspect the url-rewrite gets mocked up but nothing is reported in error/output log.

    We're still running v0.7.0-dev something

    commit 9165da3b26a044c288d5db73c4933ca2b29e6a78

    EDIT: Upgrading to 0.8.2 seems to fix this.

  • sudo nodebb help

    Technical Support
    0 Votes
    5 Posts
    2k Views

    ok got it working again i re-took ownership of the entire directory again... maybe a i did a sudo git pull by mistake or something silly

    opps xd