Authentication Problems when connecting with new created user (Lab: Change The Default DB Path)

I am having trouble with authentication and I am receiving these errors when attempting to submit the assignment. It seems I’m able to authenticate to the admin database after connecting to port 27000. When trying to connect, and authenticate at the same time my created user does not seem to be recognized. I’ve been at this for hours. Could someone please help me figure this out?

"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.
"

Here is what is outputted from the mongo console after authenticating:

connecting to: mongodb://127.0.0.1:27000/?gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("257bbc18-0e9e-46da-9d94-dcfd174edaea") }
MongoDB server version: 3.6.17
MongoDB Enterprise > use admin
switched to db admin
MongoDB Enterprise > db.auth("m103-user", "m103-pass")
1

And this is outputed from the mongod after trying to submit the assignment

2020-03-11T11:06:34.873+0000 I NETWORK  [listener] connection accepted from 127.0.0.1:51667 #10 (2 connections now open)
2020-03-11T11:06:34.874+0000 I NETWORK  [conn10] received client metadata from 127.0.0.1:51667 conn10: { platform: "go1.9.2", driver: { name: "mongo-go-driver", version: "local build" }, os: { architecture: "amd64", type: "linux" } }
2020-03-11T11:06:34.876+0000 I ACCESS   [conn10] SCRAM-SHA-1 authentication failed for m103-admin on admin from client 127.0.0.1:51667 ; UserNotFound: Could not find user m103-admin@admin
2020-03-11T11:06:34.877+0000 I NETWORK  [conn10] end connection 127.0.0.1:51667 (1 connection now open)

You’ll get appropriate responses if your thread is linked to right course and chapter. Suggest you fix this and also mention the title of the lab that you’re working on.

Thanks for the response. My mistake, I’ll fix that.

Check that you’ve met this requirement:


I.e. you can connect to 192.168.103.100 on the admin db

Thanks for the reply. I have specified that ip. I’m still receiving the error. This is my config file:

net:

  port: 27000

  bindIp: "192.168.103.100,127.0.0.1"

security: 

  authorization: "enabled"

storage: 

  dbPath: "/var/mongodb/db"

Can you connect?

PS: Suggest you specify localhost first. You’ll need to shutdown and restart the mongod.

How do I go about doing that? I’ve already reset the session. I’ll try setting local host first

Are you sure you are starting mongod correctly.

I am using th following flag to start the mongod
mongod --config /shared/config/config.conf

mongo --host 192.168.103.100:27000 ...other options

Refer to the mongo documentation to learn more.

Share the getCmdLineOpts output again

mongod output:
vagrant@m103:~$ mongod --config /shared/config/config.conf
2020-03-11T12:14:55.635+0000 I CONTROL [initandlisten] MongoDB starting : pid=7962 port=27000 dbpath=/var/mongodb/db 64-bit host=m103
2020-03-11T12:14:55.636+0000 I CONTROL [initandlisten] db version v3.6.17
2020-03-11T12:14:55.637+0000 I CONTROL [initandlisten] git version: 3d6953c361213c5bfab23e51ab274ce592edafe6
2020-03-11T12:14:55.638+0000 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.1f 6 Jan 2014
2020-03-11T12:14:55.639+0000 I CONTROL [initandlisten] allocator: tcmalloc
2020-03-11T12:14:55.640+0000 I CONTROL [initandlisten] modules: enterprise
2020-03-11T12:14:55.641+0000 I CONTROL [initandlisten] build environment:
2020-03-11T12:14:55.642+0000 I CONTROL [initandlisten] distmod: ubuntu1404
2020-03-11T12:14:55.642+0000 I CONTROL [initandlisten] distarch: x86_64
2020-03-11T12:14:55.643+0000 I CONTROL [initandlisten] target_arch: x86_64
2020-03-11T12:14:55.643+0000 I CONTROL [initandlisten] options: { config: “/shared/config/config.conf”, net: { bindIp: “127.0.0.1,192.168.103.100”, port: 27000 }, security: { authorization: “enabled” }, storage: { dbPath: “/var/mongodb/db” } }
2020-03-11T12:14:55.644+0000 I - [initandlisten] Detected data files in /var/mongodb/db created by the ‘wiredTiger’ storage engine, so setting the active storage engine to ‘wiredTiger’.
2020-03-11T12:14:55.644+0000 I STORAGE [initandlisten]
2020-03-11T12:14:55.644+0000 I STORAGE [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
2020-03-11T12:14:55.644+0000 I STORAGE [initandlisten] ** See http://dochub.mongodb.org/core/prodnotes-filesystem
2020-03-11T12:14:55.644+0000 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=488M,cache_overflow=(file_max=0M),session_max=20000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),compatibility=(release=“3.0”,require_max=“3.0”),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),statistics_log=(wait=0),verbose=(recovery_progress),
2020-03-11T12:14:56.271+0000 I STORAGE [initandlisten] WiredTiger message [1583928896:271249][7962:0x7fae67658ac0], txn-recover: Main recovery loop: starting at 5/6144
2020-03-11T12:14:56.367+0000 I STORAGE [initandlisten] WiredTiger message [1583928896:367414][7962:0x7fae67658ac0], txn-recover: Recovering log 5 through 6
2020-03-11T12:14:56.424+0000 I STORAGE [initandlisten] WiredTiger message [1583928896:424816][7962:0x7fae67658ac0], txn-recover: Recovering log 6 through 6
2020-03-11T12:14:56.473+0000 I STORAGE [initandlisten] WiredTiger message [1583928896:473694][7962:0x7fae67658ac0], txn-recover: Set global recovery timestamp: 0
2020-03-11T12:14:56.503+0000 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory ‘/var/mongodb/db/diagnostic.data’
2020-03-11T12:14:56.504+0000 I NETWORK [initandlisten] listening via socket bound to 127.0.0.1
2020-03-11T12:14:56.504+0000 I NETWORK [initandlisten] listening via socket bound to 192.168.103.100
2020-03-11T12:14:56.504+0000 I NETWORK [initandlisten] listening via socket bound to /tmp/mongodb-27000.sock
2020-03-11T12:14:56.504+0000 I NETWORK [initandlisten] waiting for connections on port 27000
2020-03-11T12:16:09.630+0000 I NETWORK [listener] connection accepted from 192.168.103.100:50715 #1 (1 connection now open)
2020-03-11T12:16:09.631+0000 I NETWORK [conn1] received client metadata from 192.168.103.100:50715 conn1: { application: { name: “MongoDB Shell” }, driver: { name: “MongoDB Internal Client”, version: “3.6.17” }, os: { type: “Linux”, name: “Ubuntu”, architecture: “x86_64”, version: “14.04” } }

mongo output:
vagrant@m103:~$ mongo --host 192.168.103.100:27000
MongoDB shell version v3.6.17
connecting to: mongodb://192.168.103.100:27000/?gssapiServiceName=mongodb
Implicit session: session { “id” : UUID(“384ca6aa-d2c5-4193-a41e-9b40dfb8ae8a”) }
MongoDB server version: 3.6.17
MongoDB Enterprise >

You’re able to login without credentials which indicates that the user credentials you created from the previous lab no longer exists.

1 Like

Hi @Devin_22245,

Can you please confirm that your issue has been resolved ?

~ Shubham

Hello the issue was resolved. Sorry for the late response. I apparently have a cap on the number of responses I can make on a given post.