[SERVER-36717] profile command returns that it can only be run from admin database Created: 17/Aug/18  Updated: 12/Dec/23

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

Type: Bug Priority: Major - P3
Reporter: Ben Judd Assignee: Backlog - Cluster Scalability
Resolution: Unresolved Votes: 0
Labels: ShardingRoughEdges, neweng, sharding-wfbf-sprint
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Cluster Scalability
Operating System: ALL
Steps To Reproduce:

./scratch/setprof.js:
```
(function() {
assert.commandWorked(db.test.insert({}));
assert.commandWorked(db.setProfilingLevel(2));
})();
```

buildscripts/resmoke.py --suites=sharding_jscore_op_query_passthrough ./scratch/setprof.js

Participants:

 Description   

When running in sharding_jscore_op_query_passthrough, a jstest that calls setProfilingLevel is returned an errmsg: " profile may only be run against the admin database.".

Error because profile does not need to be run on admin database.



 Comments   
Comment by Ben Judd [ 17/Aug/18 ]

The ticket was to fix the error, that said the code it runs through to produce that errormsg doesn't seem to be related to it running on a mongos vs mongod, this error also doesn't occur in other suites.

https://github.com/mongodb/mongo/blob/5e461534b339c957d2e6dcf16015949a496a1110/src/mongo/db/commands.cpp#L83-L85

Generated at Thu Feb 08 04:43:53 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.