Error
Error Code:
98
MongoDB Error 98: Data Directory Locked
Description
This error indicates that the MongoDB data directory (dbpath) is currently in use or locked by another process. It typically occurs when a new `mongod` instance attempts to start but cannot acquire exclusive access to its data files, often due to an existing lock file or an active process.
Error Message
D B Path In Use
Known Causes
3 known causesExisting MongoDB Instance
Another `mongod` process is already running and utilizing the specified data directory, preventing a new instance from acquiring the necessary lock.
Unclean Shutdown
A previous `mongod` instance did not terminate gracefully, leaving behind a stale lock file (`mongod.lock`) that signals the directory is still in use.
Directory Permissions Issue
The user account attempting to start `mongod` lacks the required read and write permissions for the data directory, preventing the creation or modification of lock files.
Solutions
Coming SoonGeneral Troubleshooting Tips
- Check the error message carefully for specific details
- Review recent changes that might have caused the error
- Search for the exact error code in the official documentation
- Check log files for additional context
- Try restarting the application or service