MongoDB exit code 100 – Fix it now!

MongoDB exit code 100 – Fix it now!

Table of Contents

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 1 onlyhost, 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
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.]


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.

Leave a Comment

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

Social Share


Cheapest Web Hosting

Fasters Web Hosting Promo
Scroll to Top

Launch your Website at RS599

Create a professional website yourself with our domain hosting combo. Get Extra benefits at this Year end Sale with 10% OFF and Enjoy Amazing Deels on Shared Hosting!

Starting at Only RS599/Year

Year End Sale


Use Code STARTBIZ at Checkout.

Create an earning opportunity with A Web Hosting Business

Become reseller and start reselling domains, web hosting, ssl certificates and More.

45% OFF

Starting at RS399/Month


Use coupon: at the checkout.