Bobcares

MongoDB exit code 100 – Fix it now!

by | Sep 7, 2019

Trying to start MongoDB and getting the “MongoDB exit code 100” error?

Eager to know why this error happens?

It is common to get exit code error while trying to start a MongoDB service. Incorrect file permissions and missing database directories often cause this error.

At Bobcares, we get many requests from server owners to fix MongoDB error as part of our Server Management Services.

Today, let’s have a deep look at the MongoDB exit code 100 error and how our Support Engineers fix them for the customers.

 

What causes MongoDB to exit with code 100?

As we all know, MongoDB is popular for its schema-less database. It does not use the concept of tables and columns, instead, it uses the concept of documents and collections. That’s why MongoDB is quite popular in container software like Docker.

It is common to get errors when starting the MongoDB service.

Fortunately, it returns codes and statuses when exiting. And these codes help in easy troubleshooting of issues with MongoDB.

But what causes it to exit with code 100?

Mongod, the daemon process of the MongoDB system, returns exit code 100 when the process throws an uncaught exception.

Let’s discuss some top causes of MongoDB error and how our Support Engineers fix them.

 

1. Incorrect file permissions

One main cause of exit code 100 is the incorrect file permissions.

Recently one of our customers had a problem with MongoDB. When he tried to start the mongod service in Ubuntu, he was getting the error,

root@machine ~ # service mongod start
root@machine ~ # service mongod status
● mongod.service - High-performance, schema-free document-oriented database
Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2018-02-11 09:17:55 CEST; 2s ago
Docs: https://docs.mongodb.org/manual
Process: 26942 ExecStart=/usr/bin/mongod --config /etc/mongod.conf (code=exited, status=100)
Main PID: 26942 (code=exited, status=100)

 

This occurred mainly due to permission issues with the data files. On checking, our Support Engineers found that the directory /var/lib/mongodb had root permissions.

Therefore, we changed the ownership to the MongoDB user,

chown -R mongodb:mongodb /var/lib/mongodb

This resolved the exiting error of MongoDB.

A successfully running MongoB Docker container would show up as :

2. Missing database directory

Sometimes, servers often show up MongoDB errors due to missing database directory. In Windows, they get the following error when trying to start the Mongo service,

Unexpected mongo exit code 100. Restarting.
Unexpected mongo exit code 100. Restarting.
Unexpected mongo exit code 100. Restarting.
Can't start mongod

Usually, the database directory will contain all the MongoDB files.

Missing these database directories will cause MongoDB errors. We created /data/db directory using the command,

mkdir C:\data\db

Then, we tried to start the Mongo services again and it worked fine. This is how we fixed the problem.

 

[ Need assistance to fix the MongoDB exit code 100 error?- We are available 24/7.]

 

Conclusion

In short, MongoDB exit code 100 error occurs due to the incorrect file permissions and missing database directories. Today, in this write-up, we have discussed how our Support Engineers fixed the MongoDB error for the customers.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

4 Comments

  1. Henrik

    Thank you 100% Work 🙂

    Reply
  2. ORTIZ

    Bonjour, je suis sous windows et quand je tape la commande :
    mkdir C:\data\db
    il me renvoie :
    Un sous-répertoire ou un fichier C:\data\db existe déjà.
    Mon pb erreur 100 n’est pas resolu

    Reply
    • Hiba Razak

      Hi,
      Please contact our support team via live chat

      Reply
  3. Richard Johnson

    Apparently, another possible cause is “Insufficient free space for journals”. At least that just now seems to be the cause of an error 100 for me. I found it by looking at /var/log/mongodb/mongod.log. Nothing else showed the error.

    Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF