Chapter 1: Lab Creating First Application User

that was helpful but still having issue in doing the lab to run mongod with configuration configuration file please check and advise

YAML is very picky. Make sure you indent with 4 spaces. Make sure you have a space after the colon when specifying a value.

1 Like

Give one space before 27000 in port field
Indentation is very important in YAML

1 Like

Hi @nakeeran_Saravanan,

I hope you found @steevej-1495’s and @Ramachandra_37567’s response helpful. Please let us know if you are still facing any issue.

~ Shubham

Still facing issue

Did u make the necessary changes ?

Please share a screenshot.

~ Shubham

S i did it earlier still getting this error. And fyi this error is not coming for port this is coming for authorization.

I suspect then that you have hidden characters, may be you cut-n-pasted from a web site. I would erase the line and retype it char by char.

i didn’t know where it went wrong but i have changed it to security.authorization: enabled then it worked
thanks to u all

Hi @nakeeran_Saravanan,

I’m glad your issue got resolved.

Hi mate can I please see the start of your code I know I am being stupid

You most likely already started mongod at this port number.

Hi @Amar_Mohammed,

This :point_down:

What’s the output of this command ? [List the currently running mongod instances]

ps -ef | grep mongod

When i try the same in Vagrant environment i face the error : "couldn’t add user: there are no users authenticated " could you help me resolve the same.
please find the screenshots of mongod and mongo shell attached for your reference image image

Are you using IDE or Vagrant for this course?
I see another post from you on IDE

About your error the user already exists/created
Try to login with that user or authenticate the user with db.auth

i have done the task in IDE wanna try the same in Vagrant

for LAB creating first Application User
i use the following commands and still i fail the test can you please help

i execute :

mongod --config mongod.conf

mongo --host localhost:27000 --username m103-admin --password m103-pass --authenticationDatabase admin

db.createUser({ user: “m103-application-admin”, pwd: “m103-application-pass”, roles: [{role: “readWrite”, db: “applicationData”}]})

and i get :

db.createUser({ user: “m103-application-admin”, pwd: “m103-application-pass”, roles: [{role: “readWrite”, db: “ApplicationData”}]})
Successfully added user: {
“user” : “m103-application-admin”,
“roles” : [
“role” : “readWrite”,
“db” : “ApplicationData”

test output :

3 total, 0 passed, 0 skipped:
[FAIL] “The user m103-application-user was created on the admin database”

Did you create the ‘m103-application-user’ on the admin database?

[FAIL] “The user m103-application-user has the correct permissions”

Did you create the ‘m103-application-user’ with the readWrite role on the
applicationData database?

[FAIL] “The user m103-application-user has the correct password”

Did you create the ‘m103-application-user’ with the password

Watch your typos.

And you do db.createUser({ user: “m103-application-admin”, p….

And you do …db: “ApplicationData”….

Actually i corrected both the typos and tried even then facing same error

I suspect that you forgot to switch to the admin database with use admin.

Post the output of db.getUsers().