MongoDB Error

General Discussion
  • Whenever I try to use MongoDB, I always get this error:

    :/var/www/forum# node app
    info: NodeBB v0.2.1 Copyright (C) 2013 DesignCreatePlay Inc.
    info: This program comes with ABSOLUTELY NO WARRANTY.
    info: This is free software, and you are welcome to redistribute it under certain conditions.
    info: 
    info: Initializing NodeBB v0.2.1, on port 4567, using mongo store at 127.0.0.1:27017.
    info: NodeBB instance bound to: Any address (0.0.0.0)
    error: auth fails
    

    When I originally set it up, I had this:

    URL of this installation (http://localhost) http://mywebsite.com
    Port number of your NodeBB (4567) 
    Use a port number to access NodeBB? (y) 
    IP or Hostname to bind to (0.0.0.0) 
    Which database to use (redis) mongo
    Host IP or address of your MongoDB instance (127.0.0.1) 
    Host port of your MongoDB instance (27017) 
    MongoDB username <my username>
    Password of your MongoDB database <my password>
    Which database to use (0..n) (0) <my alphabetic database name>
    info: Configuration Saved OK
    error: auth fails
    

    I don't know what it could be. The last time I installed this, it worked fine. And, checking your GitHub log, it doesn't seem like there were any major changes in the last 10 hours.

  • Check your config.json and make sure the mongodb auth details are correct. Also does it work if you remove the authentication all together?

  • Okay, I enabled auth and it works like a charm. Sorry for wasting your time.

  • No problem 🙂

  • Me, coming from a Ruby background, just can't seem to wrap my mind around the awesomeness of node.js, so don't worry. There will be plenty of stupid posts to follow.

  • glad you figured it out 🙂 we've not got many tutorials / wiki / guides on setting up NodeBB with MongoDB so if you ever feel like contributing back to our community please do 🙂

  • I am also getting this issue

    [ezra@kiwidev community]$ node app.js
    info: NodeBB v0.4.2 Copyright (C) 2013-2014 DesignCreatePlay Inc.
    info: This program comes with ABSOLUTELY NO WARRANTY.
    info: This is free software, and you are welcome to redistribute it under certain conditions.
    info:
    info: Time: Mon May 12 2014 06:31:33 GMT+0400 (MSD)
    info: Initializing NodeBB v0.4.2
    info: * using configuration stored in: /var/www/alternative-gaming/community/config.json
    info: * using mongo store at 127.0.0.1:28900
    info: * using themes stored in: /var/www/alternative-gaming/community/node_modules
    Failed to load c++ bson extension, using pure JS version
    error: auth failed
    

    config.json

     {
    "base_url": "http://community.ag-aus.org",
    "port": "4680",
    "use_port": false,
    "secret": "XXX",
    "bind_address": "127.0.0.1",
    "database": "mongo",
    "mongo": {
        "host": "127.0.0.1",
        "port": "28900",
        "username": "XXX",
        "password": "XXX",
        "database": "XXX"
    },
    "bcrypt_rounds": 12,
    "upload_path": "/public/uploads",
    "relative_path": ""
    }
    

Suggested Topics