Authentication Failed

Technical Support
  • #1

    I'm getting the following message when I run ./nodebb setup

    23/2 14:56:21 [6251] - 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).
    23/2 14:56:21 [6251] - info: Now configuring mongo database:
    Configuration Saved OK
    23/2 14:56:22 [6251] - error: NodeBB could not connect to your Mongo database. Mongo returned the following error: Authentication failed.
    23/2 14:56:22 [6251] - warn: NodeBB Setup Aborted.
     MongoError: Authentication failed.
        at Function.MongoError.create (/home/ubuntu/nodebb/node_modules/mongodb-core/lib/error.js:31:11)
        at /home/ubuntu/nodebb/node_modules/mongodb-core/lib/connection/pool.js:497:72
        at authenticateStragglers (/home/ubuntu/nodebb/node_modules/mongodb-core/lib/connection/pool.js:443:16)
        at Connection.messageHandler (/home/ubuntu/nodebb/node_modules/mongodb-core/lib/connection/pool.js:477:5)
        at Socket.<anonymous> (/home/ubuntu/nodebb/node_modules/mongodb-core/lib/connection/connection.js:321:22)
        at emitOne (events.js:96:13)
        at Socket.emit (events.js:188:7)
        at readableAddChunk (_stream_readable.js:176:18)
        at Socket.Readable.push (_stream_readable.js:134:10)
        at TCP.onread (net.js:559:20)

    I'm particularly concerned with the error. I'm able to log in to the nodebb db in mongo using nodebb as username and using my password

  • NodeBB

    Does your config.json have a database username and password?

  • #3

    Yes ... yes it does.

        "url": "http://localhost:4567",
        "secret": "<series of numbers and letters here>",
        "database": "mongo",
        "port": 4567,
        "mongo": {
            "host": "",
            "port": "27017",
            "username": "<it has my username here>",
            "password": "<it has my password here>",
            "database": "nodebb"
  • #4

    @baris So, just to confirm with you ... if you had anything you wanted to suggest. It still won't install

  • Global Moderator Plugin & Theme Dev

    @arkoma that error means that mongo is not accepting the credentials you provided. So either you set up mongo wrong, or you have nodebb the won't credentials.

    Beyond that, we can't really help you, as this isn't caused by NodeBB.

  • #6

    May be faster for you to figure out the correct credentials using the CLI:

    mongo --username <yourusername> --password <yourpass>

    Also worth attempting to connect with no credentials, on the off-chance you haven't correctly enabled authentication.


    If you can't figure out the correct credentials, you can set up another set with this official doc.

  • #7

    I finally got past this error.
    It took a couple of uninstalls and reinstalls of mongo until i finally got the details right.

    but now I have a new problem

    I'm still working my way through the install guide which BTW doesn't look like it's rendering correctly on my browser but that's beside the point
    I got to the part where I setup a nodebb.service file.
    This is what my nodebb.service file looks like

    [Service] Type=simple User=nodebb
    StandardOutput=syslog StandardError=syslog SyslogIdentifier=nodebb
    Environment=NODE_ENV=production WorkingDirectory=/home/ubuntu/nodebb ExecStart=/usr/bin/node loader.js –no-daemon –no-silent Restart=always
    1. Does this seem correct?

    2. When I go to the next step and run sudo systemctl enable nodebb, I get this message: Failed to execute operation: Bad message

  • GNU/Linux

    @arkoma Nah, you're missing some of the line breaks:

    After=system.slice mongod.service
    ExecStart=/usr/bin/env node loader.js --no-silent --no-daemon

    Try a different browser? Which install guide are you using?

  • #9

    @julian I'm using this guide

    I'm looking at it in Chrome on Linux Mint Ubuntu 16.04 LTS

    I put in the line breaks
    I notice that you don't have this line that I do

  • #10
    This post is deleted!
  • #11

    @arkoma It looks like nodebb defaults to running as production, unless you pass some other value to NODE_ENV, so that line will have no effect.

  • #13

    Ok I think it's running. Now how do I look at it in my browser. haha
    I have a AWS free tier instance

  • Global Moderator Plugin & Theme Dev

    Your AWS instance has an IP address or maybe even a normal address. You can use that to connect on port 4567

  • #15

    @pitaj Yeah, that's not working. Most likely I don't know what I'm doing, but it just times out.

    This is what I have in the console

    9/3 03:16:20 [1786] - info: NodeBB Ready
    9/3 03:16:20 [1786] - info: Enabling 'trust proxy'
    9/3 03:16:20 [1786] - info: NodeBB is now listening on:

    I go here

    and it just hangs

  • #16

    I finally figured it out.
    It's up and running at

    Although I get a message saying "looks like your connection to nodebb was lost" hmm... I'm going to have to search for another thread related to that.

  • #17

    Fixed it. addresses didn't match. between my actual ip and the config.json file

Suggested Topics

| | | |