Failed with result "core-dump", "illegal instruction"

Earlier today, I noticed the Ubuntu VM containing my mongodb instance was using a lot of memory, so I stopped the programs that used it and then restarted it. Suddenly, when I restarted it, mongodb now refuses to start.
Running sudo systemctl start mongod and then sudo systemctl status mongod returns the following:

Reinstalling mongodb did not change anything - same issue.
After a quick Google search I found out that the command sudo mongod --repair --dbpath /var/lib/mongod could fix the problem - but that only responded with “Illegal instruction”. In fact, running mongod at all just responds with “Illegal instruction” or “Illegal instruction (core dumped)”

What do I do?

After you reinstalled did you check mongod folder has proper permissions/ownership
Try to clean dbpath & logpath dirs and see if the service comes up
Most likely issue could be permissions issue or old files or lock files from previous runs

How do I clean the “dbpath” directory without deleting the contents of my database?

Here are the permissions on /var/lib/mongodb:

This is starting to really annoy me. I decided that there was no saving my existing VM (I discovered it was also running Ubuntu 21.04 which wasn’t listed as a supported version) so I made a new Ubuntu 20.04 VM, copied over the database to a brand new disk image, and ran it - and guess what? The exact same thing happened and changing the dbpath to the normal one still causes it to occur. Please help!!!

@jmk I too had a similar problem. You can look here for my take on this issue.

In a nutshell, I did not find any way to correct this error other than removing each and every file which contains name “mongo”, uninstalling the package and then reinstalling it over again.

NOTE: All this is valid if mongodb ran on your system at least once before it started showing failed (Result: core-dumped)

I’d suggest backing up the data before deleting it.

It was working on my original VM before it started showing it - on the new VM this is the first thing it showed once I gave it my original dbpath. I just can’t delete my entire database - that’s not happening. I need to keep my data - it’s still there and I have it, I just can’t use it.

Sadly, I was not able to fix this problem - even with reinstalls, new VMs, and a ton of debugging. I got my data back by copying it over the network to my main PC and running it off my Windows machine locally.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.