Cant access mongo terminal in Digital Ocean

  • @frissdiegurke
    export LC_CTYPE=en_US.UTF-8 && mongo method worked and it was okay. But when I logout and log in back.

    I tried mongo and got this error back.

    perl: warning: Setting locale failed.
    perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LC_CTYPE = "UTF-8",
    LANG = "en_US.UTF-8"
    are supported and installed on your system.
    perl: warning: Falling back to the standard locale ("C").

  • Plugin & Theme Dev

    @gvimlan yes, the export command only sets the environment-variable LC_CTYPE for that session. it's just for testing whether I've determined the correct problem.

    So you now know the problem is definitely a wrong assigned environment-variable.
    Because I don't use ubuntu at all I don't know where they typically set such variables.
    You may also check the /etc/environment file for LC_CTYPE (cat /etc/environment | grep LC_CTYPE for example) or ~/.bashrc or any other file starting with ~/.bash.
    Otherwise it doesn't look like a standard-file for environment-setup does this assignment.

    If you don't find that assignment as a not-the-cleanest fix you should overwrite it yourself by adding LC_CTYPE=en_US.UTF-8 into /etc/default/locale or /etc/locale.conf or (user-scope) export LC_CTYPE=en_US.UTF-8 into ~/.profile.

    For further information about where/when/whatever of environment-variables within ubuntu take a look at

  • @frissdiegurke
    Hey mate. Thanks for the advice.
    Should I add LC_CTYPE=en_US.UTF-8 or LC_CTYPE="en_US.UTF-8" into .etc/default/locale? Is the " " necessary?

  • Plugin & Theme Dev

    @gvimlan it's not necessary but doesn't make a difference in that case 😉

  • @frissdiegurke
    Thanks mate 🙂

  • @frissdiegurke Hey mate

    I installed nodebb and mongodb based on this tutorial.
    [Installing method]
    Everyone went well. When i typed mongo and type show databases. I m getting the following error. Does this mean I m not having root access. How do I login to the database?

    2015-03-31T09:04:42.214-0400 E QUERY Error: listDatabases failed:{
    "ok" : 0,
    "errmsg" : "not authorized on admin to execute command { listDatabases: 1.0 }",
    "code" : 13
    at Error (<anonymous>)
    at Mongo.getDBs (src/mongo/shell/mongo.js:47:15)
    at (src/mongo/shell/utils.js:630:33)
    at shellHelper (src/mongo/shell/utils.js:524:36)
    at (shellhelp2):1:1 at src/mongo/shell/mongo.js:47

  • Plugin & Theme Dev

    Since I did never create any additional mongodb-users (I have no running systems) I can't help you with that pretty much.

    Maybe you've run db.createUser without use nodebb before in that very same session (I don't know to which db they get bound in this case)...

    Try show users (within a clean mongo session) and if a nodebb user exists I'd recommend following this official guide.

  • @frissdiegurke
    Hi mate
    I m not sure how things are working. But I created the nodebb forum and everything seems to be storing in the database. How do I look into to the content saved in the database? And will the content being saved in the database I specified or the default one?
    Everything seems to be good except the database part. Is there I can read where does Nodebb save its data and stuff?

    Thank you

  • Plugin & Theme Dev

    If you look into the config.json within your NodeBB root-directory you should get some information about how NodeBB tries to access the database (the way you specified within ./nodebb setup)

    If you'd be able to manage your permission-problem you could run mongo and within use nodebb and show collections for each of the collections you may run db.COLLECTION.find() to get a plain list of the JSONs within.

  • @frissdiegurke
    Hey mate 🙂

    Why do I get the error below:
    2015-04-01T07:02:19.625-0400 E QUERY Error: couldn't add user: not authorized on nodebb to execute command { createUser: "user, roles: [ "readWrite" ], digestPassword: false, writeConcern: { w: "majority", wtimeout: 30000.0 } }
    at Error (<anonymous>)
    at DB.createUser (src/mongo/shell/db.js:1066:11)
    at (shell):1:4 at src/mongo/shell/db.js:1066

    I get error like this whenever i tried to do sometime like show collections or show databases

    Why do i get this error?

Suggested Topics

| | |

© 2014 – 2022 NodeBB, Inc. — Made in Canada.