Aborted (core dumped)

heres my config file:
02%20PM

here’s my output after running mongod -f "mongod.conf":

15%20PM

any ideas why I keep getting that output and the process exits? Any Idea for a fix?

Hi @naeemgitonga,

Cursious as to why you are not using the /shared/ folder to store your config files?

Let’s see the output of the following commands:

  1. pwd
  2. ls -l
  3. ls -l /var
  4. ls -l /var/mongodb
  5. ps -ef | grep [m]ongo

1: /home/vagrantls
2.


3.
4.
5. vagrant 5112 2256 0 22:12 pts/0 00:00:00 nano mongod.conf

Any answer to this question?

didn’t know that I had to use that folder for these exercises. Is that what you suspect the solution to be?

No that’s not the solution. I believe that it’s a course requirement to use the shared drive, plus it makes sense because if you destroy your VM your config files will be intact.

I’m on my phone now. I’ll have move to my laptop in a couple of minutes and have a look at your screenshots.

thanks for helping but it’s definitely not a requirement, although it makes sense if you want to keep those config files. I have been passing the lessons up until getting stuck here without using the shared folder

Good to know. What’s the title of the lab that you’re on?

From number 5, it appears that nano still has a lock on your config file. Try opening the file and saving it, make sure you don’t have another terminal locked on the file, or save the file elsewhere. Make sure that the number 5 command doesn’t show up with nano.

got nano to go away but still no luck. I was working on Lab - Change the Default DB Path.

Follow these steps:

  1. Run the following
    rm -r /var/mongodb/db
    sudo chown -R vagrant:vagrant /var/mongodb
    mkdir -p /var/mongodb/db
  2. Under the systemlog section in the config file, add this line: logAppend: true

Try executingmongod again.

Hi naeemgitonga
You did not give output of ps -ef|grep mongo as requested by 007_jb

Is another instance running on same port or using same dir structure?

What does the new mongod.log show?
It would have given why it is failing or exiting

Thanks, I believe what helped was to remove the /var dir and to bring it back, change the owner, and make the db dir last.

I didn’t need the logAppend option.

I killed all existing mongod instances and made sure my config file was correct.

I was able to complete the lab.

Thanks again

Not necessary but it helps to keep your log data in one file otherwise your log files will rotate.

… it stops this from happening -->

Hi @naeemgitonga,

I’m glad your issue got resolved. If you have any other query then please feel free to get back to us.

Happy Learning :slight_smile:

Thanks,
Shubham Ranjan
Curriculum Support Engineer

1 Like

Thanks for your answer, and it helps. But I wonder whether it would destroy previous data stored in var/mongodb/db if in production environment. Thanks

Hi @chen_28695, in production, you most likely wouldn’t do what I suggested. My suggestion was merely because the data here doesn’t matter and this was the quickest solution.

In Prod, the first thing to do is to check the log file for the full details of the error message and from there you can decide the most appropriate action. In addition, knowing the root cause would also help in determining the appropriate action.