Configuration File ERROR

Hi everybody ! Can you help me with this problem ?
i am using windows to work
vagrant@m103:~$ mongod --dbpath /data/db --logpath /data/log/mongod.log --fork
about to fork child process, waiting until server is ready for connections.
forked process: 7112
ERROR: child process failed, exited with error number 1
To see additional information in this output, start without the “–fork” option.

vagrant@m103:~ mongod --dbpath /data/db --logpath /data/log/mongod.log 2019-12-29T19:10:51.468+0000 F CONTROL [main] Failed global initialization: FileNotOpen: Failed to open "/data/log/mongod.log" vagrant@m103:~

Looks like your mongod.log is not created
Please check ls -lrt /data/log/mongod.log
Have you created necessary dir’s?

thanks for answer ! this is the output

vagrant@m103:~$ ls -lrt /data/log/mongod.log
ls: cannot access /data/log/mongod.log: No such file or directory

how is the command for create the file?
it would be with mkdir /data/log/mongo.log ?

You don’t have to create the mongod.log file
It gets created when you start mongod
Please make sure /data/db and /data/log exists
First cd /data —>means switch to the dir
ls -lrt —> means list the files/dirs
if you see the dir db nothing to do.if db is not there create by mkdir db
if you don’t see log dir create it by mkdir log
All you need is a valid path where mongod can write
You can start mongod by changing logpath to /data
In this case mongod.log will be created under /data but please follow you lab instructions as validations will fail if you don’t stick to instructions

1 Like

Hi @Lucas_Exequiel_10425,

As @Ramachandra_37567 mentioned, you are getting error because of the non-existent directory.

You can create the directory using this command :

mkdir -p /data/log

Hope it helps!

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

Thanks,
Shubham Ranjan
Curriculum Support Engineer

1 Like

@Ramachandra_37567 @Shubham_Ranjan
Thank a lot to both ! now it worked and i could pass the lab.

Hi,
I am trying also to run my configuration file, however I got the following error:

“about to fork child process, waiting until server is ready for connections.
fork process: 2259
ERROR: child process failed, exited with error number 51
To see additional information in this output, start without the “–fork” option”

If I run the configuration file without the fork option, I will get the following message:
2019-12-31T01:32:47.704+0000 I CONTROL [main] log file “/data/logs/mongod.log” exists; moved to “/data/logs/mongod.log.2019-12-31T01-32-47”.
Aborted (core dumped)

Can you help me please?

Hi @Rodolfo_33565,

In this lab you don’t need to have the logging information in your configuration file.

I will suggest you either remove it or add the logAppend parameter under systemLog and set it to true.

For more information you can refer our documentation.

In addition to this, please ensure that for all the directories that you have specified in your configuration file - it exists and vagrant is the owner.

Thanks,
Shubham Ranjan
Curriculum Services Engineer