I can't create/open the log file when launch the config file

Hi! I can’t create/open a log file I receive the following message when I run the config file ….(after of delete the option of --fork that was the suggestion of the system "run without --fork command for more details) and I received the following error message:
2019-11-19T16:03:30.353+0000 F CONTROL [main] Failed global initialization: FileNotOpen: Failed to open “/data/log.mongod.log”

Maybe this is the problem?

Does the directory /data/ exists?

Based on the error message, I’m even suspecting that /data/log.mongod.log should actually have been /data/log/mongod.log … most likely a simple typo

Hi @Marcos_33957,

As mentioned by others in the forum please make sure you have provided the correct path to the log file in the configuration file.

Also ensure that the directories exist and permissions are set on it.

Thanks,
Shubham Ranjan
Curriculum Support Engineer

I keep getting this.

vagrant@m103:~$ mongod --config mongod.conf
2020-01-12T19:45:48.115+0000 F CONTROL [main] Failed global initialization: FileNotOpen: Failed to open “/data/log/mongod.log”

Hi @Oliver_40486, what’s the output of the following commands:

#1
ls -l /data/log

#2
ls -ld /data

Hi @Oliver_40486,

It could be a permission issue. Please share the output of the commands mentioned by @007_jb.

Thanks,
Shubham Ranjan
Curriculum Services Engineer

vagrant@m103:~ ls -l /data/log ls: cannot access /data/log: No such file or directory vagrant@m103:~ ls -ld /data
drwxrwxrwx 3 vagrant vagrant 4096 Jan 12 17:22 /data

This is the output of the commands.

There’s your answer :arrow_up: @Oliver_40486

Hi @Oliver_40486,

Can you please confirm that your issue has been resolved so that I can close this thread ?

Thanks,
Shubham Ranjan
Curriculum Services Engineer

@Shubham_Ranjan Can you confirm as per labs what all files/folders should be in shared folder of m103-vagrant-env

Hi @Shamli_80969,

It would be great if you can share the output of the below command from inside the vagrant:

 ls /shared 

Kanika

@kanikasingla vagrant@m103:~$ ls /shared
data mongo.conf var

Hi @Shamli_80969,

Thanks for sharing the details. I would recommend you to keep all of your configuration files in the /shared folder. In addition to this, you will find any other relevant information very explicitly mentioned in the labs.

Please feel free to get back to us if you have any other query.

Thanks,
Shubham Ranjan
Curriculum Services Engineer