-
Type: Bug
-
Resolution: Works as Designed
-
Priority: Major - P3
-
Affects Version/s: 2.2.0
-
Component/s: None
-
None
-
Environment:OS: redhat 8.8
node.js / npm versions:
Additional info:
-
Not Needed
-
Developer Tools
Problem Statement/Rationale
From mongo version 6 onwards, I am not able to run any command using mongosh to login.
bin/mongosh -u xxx -p xxxx --port 1234 admin
Using MongoDB: 7.0.6
Using Mongosh: 2.2.0
For mongosh info see: https://docs.mongodb.com/mongodb-shell/
Warning: Found ~/.mongorc.js, but not ~/.mongoshrc.js. ~/.mongorc.js will not be loaded.
You may want to copy or rename ~/.mongorc.js to ~/.mongoshrc.js.
xxxxxxxxxxx [direct: arbiter] admin> rs.conf();
MongoServerError[Unauthorized]: Command replSetGetConfig requires authentication
But, if I were to use the old mongoDB shell, I can run those commands.
MongoDB shell version v5.0.25 MongoDB server version: 7.0.6 WARNING: shell and server versions do not match ================ Warning: the "mongo" shell has been superseded by "mongosh", which delivers improved usability and compatibility.The "mongo" shell has been deprecated and will be removed in an upcoming release. For installation instructions, see https://docs.mongodb.com/mongodb-shell/install/ xxxxxxxxxxx :ARBITER> rs.conf(); { "_id" : "xxxxxxxxxxx", "version" : 3, "term" : 1, "members" : [...] ... }
I would like to know if this is expected behavior for mongosh and it is not due to any issue due to configuration etc. Thanks!
- duplicates
-
MONGOSH-1241 mongosh does not authenticate on ARBITER
- Closed