Lab - Change the Default DB Path validation

I am getting validation error for Lab - Change the Default DB Path

vagrant@m103:/var/mongo/db$ validate_lab_change_dbpath
Client experienced a timeout when connecting to the database - check that mongod is running on the correct port, and that your user was created with the correct settings.

but i have db running on port 27000

vagrant@m103:/var/mongo/db$ mongo --port 27000
MongoDB shell version v3.6.15
connecting to: mongodb://127.0.0.1:27000/?gssapiServiceName=mongodb
Implicit session: session { “id” : UUID(“6461b2ec-7054-4d96-a8b5-f6820be819c4”) }
MongoDB server version: 3.6.15
Server has startup warnings:
2019-11-17T03:42:52.817+0000 I STORAGE [initandlisten]
2019-11-17T03:42:52.817+0000 I STORAGE [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
2019-11-17T03:42:52.817+0000 I STORAGE [initandlisten] ** See http://dochub.mongodb.org/core/prodnotes-filesystem
2019-11-17T03:42:53.757+0000 I CONTROL [initandlisten]
2019-11-17T03:42:53.757+0000 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
2019-11-17T03:42:53.757+0000 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.
2019-11-17T03:42:53.757+0000 I CONTROL [initandlisten]
2019-11-17T03:42:53.757+0000 I CONTROL [initandlisten]
2019-11-17T03:42:53.757+0000 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is ‘always’.
2019-11-17T03:42:53.757+0000 I CONTROL [initandlisten] ** We suggest setting it to ‘never’
2019-11-17T03:42:53.757+0000 I CONTROL [initandlisten]
2019-11-17T03:42:53.757+0000 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is ‘always’.
2019-11-17T03:42:53.757+0000 I CONTROL [initandlisten] ** We suggest setting it to ‘never’
2019-11-17T03:42:53.757+0000 I CONTROL [initandlisten]

MongoDB Enterprise > show users
{
“_id” : “test.m103-admin”,
“userId” : UUID(“a75e8125-01ba-4727-b7be-6bed26190714”),
“user” : “m103-admin”,
“db” : “test”,
“roles” : [
{
“role” : “root”,
“db” : “admin”
}
]
}

Please check where you created the user
“db” : “test”—> is not correct

Thanks for your reply
I havent specified that DB in the create user command, below is what I have used to create the user

MongoDB Enterprise > db.createUser({ user:“m103-admin”, pwd:“m103-pass”,roles: [ {role:“root”,db:“admin”} ]})

By default you will be in test DB when you connect to mongo with mongo --port 27000
You can check by db
Please make sure you are creating the user in admin by switching the DB by
use admin

1 Like

oh… U saved my day :slight_smile: I just overlooked that… Thanks a lot