mongod.service Failed with result core-dump

Hi Mongodb OPS and Sysad,

I’m new to mongodb and currently working on a virtual machine installed with redhat. it happens that we tried to change the permission of the following while adding the keyfile on the security option under /etc/mongod.conf

image

then we restart the mongodb using the command systemctl restart mongod

here’s the error:

● mongod.service - MongoDB Database Server
Loaded: loaded (/usr/lib/systemd/system/mongod.service; enabled; vendor pres>
Active: failed (Result: core-dump) since Wed 2021-02-24 13:41:34 PST; 1 day >
Docs: https://docs.mongodb.org/manual
Process: 1279 ExecStart=/usr/bin/mongod $OPTIONS (code=dumped, signal=ABRT)
Process: 1277 ExecStartPre=/usr/bin/chmod 0755 /var/run/mongodb (code=exited,>
Process: 1274 ExecStartPre=/usr/bin/chown mongod:mongod /var/run/mongodb (cod>
Process: 1271 ExecStartPre=/usr/bin/mkdir -p /var/run/mongodb (code=exited, s>

mongod[1279]: mongod(_ZN5mongo11Initial>
mongod[1279]: mongod(_ZN5mongo21runGlob>
mongod[1279]: mongod(+0xD9DF2A) [0x560b>
mongod[1279]: mongod(+0xD1F719) [0x560b>
mongod[1279]: libc.so.6(__libc_start_ma>
mongod[1279]: mongod(_start+0x2E) [0x56>
mongod[1279]: ----- END BACKTRACE -----
systemd[1]: mongod.service: Control proc>
systemd[1]: mongod.service: Failed with >
systemd[1]: Failed to start MongoDB Data>

I tried to uninstall using this command below:

sudo service mongod stop
sudo apt-get purge mongodb-org*

Remove Data Directories.
Remove MongoDB databases and log files.

sudo rm -r /var/log/mongodb
sudo rm -r /var/lib/mongodb

And fresh install mongodb to another version same thing happened error message didn’t disappeared and mongodb service failed to start.

Mongodb Current Version: MongoDB shell version v4.2.8
OS: Red Hat Enterprise Linux release 8.2 (Ootpa)

Hoping from this forum someone can help me on this issue and able to share some ideas to fix it. Thank you in advance.

@Ian_Sherwin_Canaya Do you get the solution for this issue ? I have also this issue i can’t get solution yet…if you get the solution please give the method…

Hi @Ian_Sherwin_Canaya and @ajay_ps, even I’m new to MongoDB and I too had this error or whatever we can call this. I searched a ton of communities and was unable to find a fix and at the end came to a decision of reinstalling MongoDB from scratch by first removing all the packages and directories like log, database etc. After reinstalling it works fine.

About the error:
I have encountered two types of similar errors so far. One is similar to the one talked about in this post Active: failed (Result: core-dump) for which only fix I could find was to reinstall from scratch. I read somewhere that this is a possible consequence of crashed or corrupted database which can be caused by terminating the database in a way which shouldn’t be used ( I have no idea what way is it).

Another similar error is Active: failed (Result: exit-code). This can be caused by various correctable reasons like ownership (chown) or rwx (chmod) permissions of the log file and dbpath, the mongod service not running, etc.

I hope someone would find this information useful :slight_smile:

@Yashvander_Bamel I reinstalled many times after deleting all packages. But No solution. and i changed the user in ubuntu and again installed but no solutions.
Checking time “sudo systemsctl start mongod” and after “mongo” command then get the error. Illegal instruction (core dumped)… this is the main issue
I can’t get any solution yet…

Did mongodb work on your system even once? Did you get this error when you installed mongodb for the first time ever? If that’s the case I can not comment anything.

But if it did run once and then crashed, you can remove all the packages and use steps mentioned here and delete all the files associated with mongodb. And then try to reinstall. Note that this would work only if you could run mongodb atleast once on your system as far as I can tell. But you can try in the other case as well.

And once you reinstall mongodb again, do not forget to change the ownership and permissions of the log and data folders