[SERVER-11816] In sharded system with no shards, cannot run commands against dbs other than "config" and "admin" Created: 21/Nov/13  Updated: 06/Dec/22  Resolved: 18/Oct/18

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

Type: Bug Priority: Minor - P4
Reporter: Spencer Brody (Inactive) Assignee: [DO NOT USE] Backlog - Sharding Team
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-11126 addUser does not work on mongos witho... Closed
Related
related to SERVER-12621 Reduce localhost exception permissions Closed
Assigned Teams:
Sharding
Operating System: ALL
Participants:

 Description   

If you have a new sharded system, where no shards have been actually added yet, its not possible to run any commands on dbs other than those that live on the config servers, even if those commands do not require writing anything to the database.

For example:

db.runCommand("serverStatus")
2013-11-21T11:56:11.620-0500 error: {
	"$err": "error creating initial database config information :: caused by :: can't find a shard to put new db on",
	"code": 10185
} at src/mongo/shell/query.js:131

This also prevents creating users on non-admin dbs before the first shard has been added: SERVER-11126



 Comments   
Comment by Gregory McKeon (Inactive) [ 18/Oct/18 ]

This error no longer occurs in master.

Comment by Andreas Nilsson [ 24/Apr/14 ]

Need addShard in localhost exception until createUser can be run without shards.

Comment by Spencer Brody (Inactive) [ 21/Nov/13 ]

This seems to be because Request::reset calls grid.getDBConfig( <namespace> ) early on in the handling of every new request on mongos, and getDBConfig throws an exception if there's no place to put storage for the given namespace.

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