-
Type: Task
-
Resolution: Won't Fix
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: mongodump
When mongodump is run with --dbpath, and the lock file cannot be created/locked, the following message is output:
If you are running a mongod on the same path you should connect to that instead of direct data file access
The lock failure could be for many reasons other than a mongod (or other tool) running on the dbpath, including
- the directory not existing
- bad directory permissions/ownership
- read-only filesystem (
SERVER-593) - locking disabled on the filesystem (eg. NFS with nolock or no rpc.lockd running)
The message is output because acquirePathLock() has thrown an exception. The code for acquirePathLock() includes uasserts for the different failure modes, including distinct log messages and (importantly) errnoWithDescription() for the common case of open() failing. So, a simple and adequate solution should be to have Tool::main output the contents of the DBException.