Access is denied. : Permission denied Reason: 13: Permission denied [Solved]

On Windows 10, I was once able to start mongod (the database server) uses these exact steps:

  • Open a Command Prompt with Administrative privileges
Ctrl + Shift + Click on Control Prompt
  • Run (The path to mongo executables is enter as a Path system environmental variable)
mongod --dbpath="...\data\db"

Every since I have uninstall and reinstall mongodb to get the correct version of mongo Compass, 1.17.0 (Stable), I have received an Access denied error. I have verified that “Full Control” is given to all Users. However, I am still unable to connect to my database which I was previously able to connect to.

Please help.

From stackoverflow.com forum

“For those of you experiencing this error on Windows using Task Manager end the instance of “mongod.exe” that is running. Once that is done permanently delete the mongo.lock file and run mongod.exe. It should work perfectly after that.”

Hi @Ramachandra_37567,

The StackOverflow link you’ve pasted does not link to a particular question.

I have tried your suggestion, by following the following steps:

  1. Restarted my computer (Although, you did not specify this, I needed to do this anyway)
  2. Opened “Task Manager” (Details tab) and verified that no mongod process was running
  3. Opened “Administrator: Command Prompt”
  4. Run mongod --dbpath=".\data\db"

Result: Same as before

data\db\WiredTiger.wt: handle-set-end: SetEndOfFile: Access is denied.
: Permission denied
2019-03-20T20:14:25.252-0700 F STORAGE  [initandlisten] Reason: 13: Permission denied
2019-03-20T20:14:25.252-0700 F -        [initandlisten] Fatal Assertion 28595 at src\mongo\db\storage\wiredtiger\wiredtiger_kv_engine.cpp 704
2019-03-20T20:14:25.253-0700 F -        [initandlisten]

***aborting after fassert() failure

Looks to be permissions issue
Please check this if it helps
https://jira.mongodb.org/browse/SERVER-31542

@Ramachandra_37567
Thanks for the quick response.

I have already tried everything suggested in this post which are:

  • Run mongod from an Administrator: Command Prompt
  • Ensure that Administrators has Full Control of “This folder, subfolders, and file”
    is applied to the data/db folder.

Thanks,

Varell

I also attempted to remedy this issue by deleting the WiredTiger.wt file, but then mongod errors and says it cannot file the WiredTiger.wt file.

Sorry not able to help much here
I don’t use Windows.May be course instructors Kanika and others can help you
Try vagrant if you are comfortable
Instead of deleting just one file cleanup your data dir and retry

Below is the link which i did not give full details in my earlier post

1 Like

I’m not sure how to get others attention. You are the only whose responded over the past day.

Thanks for trying to help! I really appreciate it.:sunglasses:

@Ramachandra_37567

I literally just solved it by:

  • Uninstalling mongodb
  • Restarting my computer
  • Reinstalling mongodb

The only thing I did differently was restart my computer before reinstalling and now I’m able to connect to my db.

1 Like

This ended up being an issue with Windows Defender blocking the mongod.exe. I don’t know what caused it to block upon reinstalling of mongo and not when I initially installed it.

To stop Windows Defender from blocking mongod (and reporting it as a trojan virus), I added mongod.exe as an allowed app through “Controlled folder access.”

1 Like

Hi @varell_hawkins

Happy to hear you have resolved the issue and we’ll take note of this as another possible issue to note when debugging on Windows machines.

Kindest regards,
Eoin

1 Like

Thanks for this comment! :slightly_smiling_face: Glad I could help future people who may come across the same problem!

1 Like