MONGODB_CONFIG_OVERRIDE_NOFOR - Exit code14 - MongoDB server on centos8 Linux

[root@RKCOM ~]# systemctl status mongod
● mongod.service - MongoDB Database Server
   Loaded: loaded (/usr/lib/systemd/system/mongod.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Tue 2023-09-26 18:49:48 IST; 1h 29min ago
     Docs: https://docs.mongodb.org/manual
  Process: 1945 ExecStart=/usr/bin/mongod $OPTIONS (code=exited, status=14)
 Main PID: 1945 (code=exited, status=14)
Sep 26 18:49:45 RKCOM systemd[1]: Started MongoDB Database Server.
Sep 26 18:49:46 RKCOM mongod[1945]: {"t":{"$date":"2023-09-26T13:19:46.626Z"},"s":"I",  "c":"CONTROL",  "id":7484500, "ctx":"main","msg":"Environment variable MONGODB_CONFIG_OVERRIDE_NOFOR>
Sep 26 18:49:48 RKCOM systemd[1]: mongod.service: Main process exited, code=exited, status=14/n/a
Sep 26 18:49:48 RKCOM systemd[1]: mongod.service: Failed with result 'exit-code'.

Hey @Rakesh_Kubehera,

Welcome to the MongoDB Community!

As per the logs you shared, it states: "Main process exited, code=exited, status=14/n/a," which indicates that the MongoDB process exited with a status code of 14. In MongoDB, exit code14 typically indicates an unrecoverable error or an uncaught exception.

Could you share how you installed MongoDB, the version you are using, and whether you’re using Docker or similar? Also, please share the MongoDB configuration file. These details will help us to assist you better.

Looking forward to your response.

Best regards,
Kushagra

1 Like

Hello,

In parallel to what @Kushagra_Kesav said, I would validate that /tmp/mongodb-27017.sock exists and remove it. Then I would restart the service again.

This could be a permissions issue in /var/lib/mongodb (datadir) or in the /tmp/mongodb-27017.sock file itself

1 Like

Hii Please find the conf file I have installed Mongo enterprise version 4.4 on centos8 linux

#mongod.conf

#for documentation of all options, see:
#http://docs.mongodb.org/manual/reference/configuration-options/

# where to write logging data.
systemLog:
  destination: file
  logAppend: true
  path: /var/log/mongodb/mongod.log

# Where and how to store data.
storage:
  dbPath: /var/lib/mongo
  journal:
    enabled: true
#  engine:
#  wiredTiger:

# how the process runs
processManagement:
  fork: true
  pidFilePath: /var/run/mongodb/mongod.pid
  timeZoneInfo: /usr/share/zoneinfo

# network interfaces
net:
  port: 27017
  bindIp: 127.0.0.1  # Enter 0.0.0.0,:: to bind to all IPv4 and IPv6 addresses or, alternatively, use the net.bindIpAll setting.

#security:
#operationProfiling:
#replication:
#sharding:
## Enterprise-Only Options
#auditLog:
#snmp:

Hello, did you manage to validate what we said above?

When you start the MongoDB server, it dynamically creates a socket file, typically named something like mongodb-27017.sock (with 27017 being the default MongoDB port). This file serves as a point of contact for client applications to connect to the MongoDB server, enabling data exchange and query execution.

sudo rm /tmp/mongodb-27017.sock

Restart MongoDB Service
To restart the MongoDB service, you can use the following command

sudo systemctl restart mongodb

Check The Status
``sudo systemctl status mongodb`