Cannot launch Mongod v4.4.5 on Ubuntu 20.04.2 LTS

Hi everyone,

I’ve installed Mongod v4.4.5 on Ubuntu 20.04.2 LTS but the service cannot be launched.

First off, systemctl start mongod shows the following output:

● mongod.service - MongoDB Database Server
     Loaded: loaded (/lib/systemd/system/mongod.service; disabled; vendor preset: enabled)
     Active: failed (Result: core-dump) since Sun 2021-05-02 18:04:11 CEST; 39min ago
       Docs: https://docs.mongodb.org/manual
    Process: 21721 ExecStart=/usr/bin/mongod --config /etc/mongod.conf (code=dumped, signal=ABRT)
   Main PID: 21721 (code=dumped, signal=ABRT)

May 02 18:04:10 Hakim systemd[1]: Started MongoDB Database Server.
May 02 18:04:11 Hakim systemd[1]: mongod.service: Main process exited, code=dumped, status=6/ABRT
May 02 18:04:11 Hakim systemd[1]: mongod.service: Failed with result 'core-dump'.

Is this due to the ulimit restrictions mentioned in recommended-ulimit-settings?

Below is the relevant output from journalctl -xe after starting the service with systemctl start mongod:

-- The unit UNIT has successfully entered the 'dead' state.
May 02 18:48:18 Hakim sudo[23430]: pam_unix(sudo:session): session closed for user root
May 02 18:48:22 Hakim sudo[23436]:    hakim : TTY=pts/3 ; PWD=/etc/apt/sources.list.d ; USER=root ; COMMAND=/bin/systemctl start mongod
May 02 18:48:22 Hakim sudo[23436]: pam_unix(sudo:session): session opened for user root by hakim(uid=0)
May 02 18:48:22 Hakim systemd[1]: Started MongoDB Database Server.
-- Subject: A start job for unit mongod.service has finished successfully
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- A start job for unit mongod.service has finished successfully.
-- 
-- The job identifier is 2687.
May 02 18:48:22 Hakim sudo[23436]: pam_unix(sudo:session): session closed for user root
May 02 18:48:23 Hakim systemd[1]: mongod.service: Main process exited, code=dumped, status=6/ABRT
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- An ExecStart= process belonging to unit mongod.service has exited.
-- 
-- The process' exit code is 'dumped' and its exit status is 6.
May 02 18:48:23 Hakim systemd[1]: mongod.service: Failed with result 'core-dump'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- The unit mongod.service has entered the 'failed' state with result 'core-dump'.
May 02 18:48:24 Hakim sudo[23462]:    hakim : TTY=pts/4 ; PWD=/home/hakim/repos/webapp ; USER=root ; COMMAND=/bin/journalctl -xe
May 02 18:48:24 Hakim sudo[23462]: pam_unix(sudo:session): session opened for user root by hakim(uid=0)

Please share the content of your configuration file:

Most likely you did not create the required directories.

Most likely you did not create the required directories.

Please find it below (I haven’t modified it as I’m not familiar with Mongodb yet):

# mongod.conf

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

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

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

# network interfaces
net:
  port: 27017
  bindIp: 127.0.0.1


# how the process runs
processManagement:
  timeZoneInfo: /usr/share/zoneinfo

#security:

#operationProfiling:

#replication:

#sharding:

## Enterprise-Only Options:

#auditLog:

#snmp:

Share output of

ls -ld /var/lib/mongodb /var/log/mongodb/

I looks like I got it fixed. All I had to do was to remove the database and log files as mentioned in the docs after deleting Mongodb with apt purge, and then reinstalling it from scratch.

I think it might’ve been caused by an old installation of Mongodb that created the databases (and I didn’t bother deleting them when Mongodb was removed).
Thanks for your help.

1 Like

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