[SERVER-8098] Mongo shell throws exception when connecting to a server with --auth Created: 07/Jan/13  Updated: 17/May/14  Resolved: 07/Jan/13

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: 2.3.1
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Randolph Tan Assignee: Spencer Brody (Inactive)
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

ubuntu 12 64bit


Issue Links:
Duplicate
duplicates SERVER-8056 Shell exception when printing startup... Closed
Operating System: ALL
Steps To Reproduce:

1. Start mongod with --auth.
2. Connect with mongo shell (also reproducible when done from the same machine).

Participants:

 Description   

MongoDB shell version: 2.3.2-pre-
connecting to: test
Mon Jan  7 12:06:38.011 javascript execution failed src/mongo/shell/utils.js:1595 don't know how to show [startupWarnings]
throw "don't know how to show [" + what + "]";
                                        ^

The shell session will still continue, but the error can be confusing. This is what showed up in the server logs:

Mon Jan  7 12:06:38.010 [conn1] command denied: { getLog: "startupWarnings" }
Mon Jan  7 12:06:38.011 [conn1] command denied: { replSetGetStatus: 1.0, forShell: 1.0 }



 Comments   
Comment by A Mare [ 17/May/14 ]

Please reopen this ticket as I'm not allowed to. It reproduces with the current version 2.6.1.

I'm using a local, single-process installation (i.e. without sharding or replication). After running the authorization schema upgrade, the former regular users became dbOwner on their databases. But if I try to connect to the MongoDB instance with such a user, I get

MongoDB shell version: 2.6.1
connecting to: xyz
Error while trying to show server startup warnings: not authorized on admin to execute command { getLog: "startupWarnings" }

The database process log reads:

2014-05-17T19:11:03.724+0300 [conn3] Auth schema upgrade copying version 3 users from admin.system.new_users to admin.system.users
2014-05-17T19:11:03.725+0300 [conn3] command admin.$cmd command: authSchemaUpgrade { authSchemaUpgrade: 1.0 } keyUpdates:0 numYields:0 locks(mi
cros) R:49 r:83 reslen:44 188ms
2014-05-17T19:49:10.067+0300 [conn4]  authenticate db: xyz { authenticate: 1, nonce: "xxx", user: "xyz", key: "xxx" }
2014-05-17T19:49:10.069+0300 [conn4] Unauthorized not authorized on admin to execute command { getLog: "startupWarnings" }
2014-05-17T19:49:10.070+0300 [conn4] Unauthorized not authorized on admin to execute command { replSetGetStatus: 1.0, forShell: 1.0 }

Generated at Thu Feb 08 03:16:32 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.