mongodbgoogle-app-enginemean-stackrockmongo

Mean Stack RockMongo on Google Cloud Platform


I have a Mean stack instance deployed on Google Cloud Platform, App Engine. I'm able to open an ssh tunnel and view rockmongo from a webbrowser: http://127.0.0.1:8888/rockmongo/index.php?action=admin.index&host=0

I can login with root and default password from App Engine. When I go to add a new database it says it was successful but doesn't show the new database in the list. I create a new user and it shows that user. When I login through the command to mongo I can switch to my new database but when I try to find all items in a collection I get an error that the user isn't authorized to perform that action.

db.getCollection('users').find({}) Error: error: { "ok" : 0, "errmsg" : "not authorized on newdatabase to execute command { find: \"users\", filter: {} }", "code" : 13 }

I added the readWrite role to the user and tried again, no luck. when I do a db.getUser("username") it returns "null".

What am I missing...


Solution

  • Figured it out, I had to:

    Login as the root bitnami user

    use admin
    db.createUser( { user: "newusername",
                     pwd: "newpassword",
                     roles: [  "userAdminAnyDatabase","readWriteAnyDatabase" ]})
    

    then

    use newdatabase
                       db.createUser(
          {
            user: "newuser",
            pwd: "newpassword",
            roles: [ { role: "readWrite", db: "newdatabase" } ]
          }
        )
    

    then the error went away. So more of an issue with mongo roles and permissions than bitnami and rockmongo. Still not sure why rockmongo never showed the new database from the php admin screen (all of this was done through the mongo command line).