Error opening config file: Is a directory

What am I doing wrong here?

I have my config file created here…


But when I try to login using the file, I receive the following error message.


And here is a snapshot of the config file with the directory path at the top…


When I try to run Mongod from the directory that has my config file I get the following error…

@Scott_86953, go through this recent thread:

mongodb parameter name does not have to have the same name and structure as in yaml configuration file

So I went through the thread and I modified my config file to the following…

I get the following when I open a mongod session using the config file

When I try to run the validation syntax to get the key, I get the following error.

You’re supposed to run everything from the vagrant Ubuntu box (i.e. the VM), not Windows.

And now I get this…

The config file you have in the Windows C:\...etc\ directory is different from the one you have in the VM’s /etc/ directory.

I don’t have an /etc/ directory in my VM…


You most certainly do :wink:

From your VM, you can access the shared folder on your local machine. That’s how you use the config file.

Good luck everyone! I am punting. To much frustration trying to get this setup and working. I don’t have the sys admin background for this.

Good Luck!

@Scott_86953 you don’t need to be a Sys Admin to take this course, it’s for Developers and DBAs and any one who’s curious. All you need is some basic Linux commands (cd, ls, mkdir, cat, vim, vi, sudo, chown, chmod etc).
Myself and @azor.haf aren’t current students, we completed this course a while back that’s why we’re able to provide assistance.

This is how you access the shared folder:
mongod --config "/shared/mongod.conf"

Any file you drop in your local Windows shared folder is accessible on the VM in /shared/… must include the first forward slash.

So I dropped the mongod.conf file in the shared folder and its not showing in the vm…


Open VirtualBox and ensure that the shared folder is linked:

If it’s not, add it or the best thing will be to re-provision your box by running these sequence of commands in Windows CMD:

vagrant destroy
vagrant up --provision
vagrant ssh

Hi @Scott_86953,

You need to make sure that you are running the mongod on port 27000 which I cannot see in your configuration file.

Also, I would highly recommend you to go through the instructions mentioned in the lab notes very carefully to create the config file with correct parameters, etc. and start your process again from scratch.

Let me know if the issue persists, we’ll help you work through it but following the lab notes is very important to be able to run your validation script successfully.


Muskan, here is the screen shot from the lab. No where does it say the port in the config file.

The folder is shared so I ran the commands provided… now I get this…


Thanks everyone. It appears I probably need to uninstall and re-install everything to see if I can get it to work.

Hi @Scott_86953,

The screenshot that you have provided here is of the lecture notes.

I see that you are trying to perform the lab - Configuration File and where it’s clearly mentioned what all you require to launch the mongod instance.

I hope this clears your doubt!
Let me know if you need further assistance.