Log file exists, mongod -f /data/mongod.conf doesn't pass test

I created the mongod.conf file inside /data/ and I then run “mongod -f /data/mongod.conf” which gives the response “2019-08-26T02:01:01.755+0000 I CONTROL [main] log file “/data/logs/mongod.log” exists; moved to “/data/logs/mongod.log.2019-08-26T02-01-01”.”

I read on another post about this that the message about log file already existing can be ignored, but when I run the test “validate_lab_configuration_file” in another terminal window after connecting with “vagrant ssh” I still get “You need to start mongod with a configuration file.”

My /data/mongod.conf file looks like this (missing indentation due to formatting of this post, in the actual file it has indentation):

dbPath: “/data/db”
path: “/data/logs/mongod.log”
destination: “file”
bindIp: “,”
port: 27000
authorization: enabled

Hey @Thomas_J_Foydel_52714

I am not sure but maybe this could help.

After adding “logAppend: true” to the “systemLog” section of my mongod.conf and mongod.yaml (I’ve been trying both) I no longer get the “2019-08-26T02:01:01.755+0000 I CONTROL [main] log file “/data/logs/mongod.log” exists; moved to “/data/logs/mongod.log.2019-08-26T02-01-01”.” when I run “mongod -f /data/mongod.conf” or “mongod -f /data/mongod.yaml”.
But when I run the configuration test, I still get “You need to start mongod with a configuration file.”

Hi @Thomas_J_Foydel_52714,

Please check the following points and try to rerun the command:

  • Please ensure that you have privileges to write into the --dbpath directory
  • Make sure no other mongod running on same port(if any running from previous lab)
  • Please check the log file for more details on the error and also try giving the same directory path for log file as the “–dbpath”

Curriculum Support Engineer

Iam not able to find mongod.log file in /data/log/

What is the path in your config file? And is mongod running?

PS: I’ve noticed that you’re always posting to old threads or threads started by other people. In the future, please create your own brand new thread.

my config file path is /data/mongod.conf
yes mongod is running

Look inside your config file and show us a screenshot of the file path for the log file.

Hi @SUJANA_42894 can you see the difference?

Please also delete your last post. It’s against forum guidelines to post answers to labs.

Hi @SUJANA_42894,

As I can see you have completed this Lab so I am going to close this thread. If you have any other issue then please feel free to create another thread.

Shubham Ranjan
Curriculum Support Engineer