[SERVER-6511] Handle errors gracefully when mongod don't have the right permissions under the dbpath directory Created: 18/Jul/12  Updated: 06/Dec/22  Resolved: 04/Mar/19

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

Type: Bug Priority: Major - P3
Reporter: Randolph Tan Assignee: Backlog - Storage Execution Team
Resolution: Done Votes: 3
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-5894 sharding failed after restarting mongo Closed
Related
Assigned Teams:
Storage Execution
Operating System: ALL
Sprint: Storage 2017-08-21
Participants:

 Description   

One example is there is a moveChunk directory under the dbpath directory and the mongod does not have the right permissions to access it, it will crash when a moveChunk command is issued to it.



 Comments   
Comment by Spencer Jackson [ 06/Jan/15 ]

Using the wiredTiger storage engine with directoryperdb and attempting to create a database with the same name as a read only directory in the dbpath resulted in:

> db.col.insert({})
WriteResult({
"nInserted" : 0,
"writeError" :

{ "code" : 8, "errmsg" : "13: Permission denied" }

})

Performing these actions on mmapv1 still raised the described exception.

Comment by William Zola [ 04/Oct/13 ]

Also occurs when trying to create a namespace file and the process doesn't have write privileges:

Thu Oct 3 08:10:06.760 [conn9999] ERROR: Uncaught std::exception: boost::filesystem::status: Permission denied: "/data/db/foobar/foobar.ns", terminating

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