0

just installed MongoDB on CentOS 7.6 but it fails to start with error code 14:

   [mehrdad@MHRS ~]$ sudo service mongod status
    Redirecting to /bin/systemctl status mongod.service
    ● mongod.service - MongoDB Database Server
       Loaded: loaded (/usr/lib/systemd/system/mongod.service; enabled; vendor preset: disabled)
       Active: failed (Result: exit-code) since Fri 2020-02-07 16:55:16 +0330; 6s ago
         Docs: https://docs.mongodb.org/manual
      Process: 16586 ExecStart=/usr/bin/mongod $OPTIONS (code=exited, status=14)
      Process: 16582 ExecStartPre=/usr/bin/chmod 0755 /var/run/mongodb (code=exited, status=0/SUCCESS)
      Process: 16578 ExecStartPre=/usr/bin/chown mongod:mongod /var/run/mongodb (code=exited, status=0/SUCCESS)
      Process: 16574 ExecStartPre=/usr/bin/mkdir -p /var/run/mongodb (code=exited, status=0/SUCCESS)

    Feb 07 16:55:16 MHRS systemd[1]: Starting MongoDB Database Server...
    Feb 07 16:55:16 MHRS mongod[16586]: about to fork child process, waiting until server is ready for connections.
    Feb 07 16:55:16 MHRS mongod[16586]: forked process: 16589
    Feb 07 16:55:16 MHRS mongod[16586]: ERROR: child process failed, exited with error number 14
    Feb 07 16:55:16 MHRS mongod[16586]: To see additional information in this output, start without the "--fork" option.
    Feb 07 16:55:16 MHRS systemd[1]: mongod.service: control process exited, code=exited status=14
    Feb 07 16:55:16 MHRS systemd[1]: Failed to start MongoDB Database Server.
    Feb 07 16:55:16 MHRS systemd[1]: Unit mongod.service entered failed state.
    Feb 07 16:55:16 MHRS systemd[1]: mongod.service failed.

and this is the MongoDB log :

2020-02-07T16:47:30.396+0330 I  CONTROL  [main] ***** SERVER RESTARTED *****
2020-02-07T16:47:30.402+0330 I  CONTROL  [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
2020-02-07T16:47:30.412+0330 I  CONTROL  [initandlisten] MongoDB starting : pid=15917 port=27017 dbpath=/var/lib/mongo 64-bit host=MHRS
2020-02-07T16:47:30.412+0330 I  CONTROL  [initandlisten] db version v4.2.3
2020-02-07T16:47:30.412+0330 I  CONTROL  [initandlisten] git version: 6874650b362138df74be53d366bbefc321ea32d4
2020-02-07T16:47:30.412+0330 I  CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.1e-fips 11 Feb 2013
2020-02-07T16:47:30.412+0330 I  CONTROL  [initandlisten] allocator: tcmalloc
2020-02-07T16:47:30.412+0330 I  CONTROL  [initandlisten] modules: enterprise 
2020-02-07T16:47:30.412+0330 I  CONTROL  [initandlisten] build environment:
2020-02-07T16:47:30.412+0330 I  CONTROL  [initandlisten]     distmod: rhel70
2020-02-07T16:47:30.412+0330 I  CONTROL  [initandlisten]     distarch: x86_64
2020-02-07T16:47:30.412+0330 I  CONTROL  [initandlisten]     target_arch: x86_64
2020-02-07T16:47:30.412+0330 I  CONTROL  [initandlisten] options: { config: "/etc/mongod.conf", net: { bindIp: "127.0.0.1", port: 27017 }, processManagement: { fork: true, pidFilePath: "/var/run/mongodb/mongod.pid", timeZoneInfo: "/usr/share/zoneinfo" }, storage: { dbPath: "/var/lib/mongo", journal: { enabled: true } }, systemLog: { destination: "file", logAppend: true, path: "/var/log/mongodb/mongod.log" } }
**2020-02-07T16:47:30.412+0330 E  NETWORK  [initandlisten] Failed to unlink socket file /tmp/mongodb-27017.sock Permission denied**
2020-02-07T16:47:30.412+0330 F  -        [initandlisten] Fatal Assertion 40486 at src/mongo/transport/transport_layer_asio.cpp 683
2020-02-07T16:47:30.412+0330 F  -        [initandlisten] 

***aborting after fassert() failure

see "Failed to unlink socket file /tmp/mongodb-27017.sock Permission denied".

but i checked /tmp/mongodb-27017.sock permissions :

[mehrdad@MHRS ~]$ sudo ls -l  /tmp/mongodb-27017.sock
[sudo] password for mehrdad: 
srwx------. 1 mongod mongod 0 Feb  7 16:15 /tmp/mongodb-27017.sock

as you see the ownership is correct.

what is the problem?

mhrsalehi
  • 1,124
  • 1
  • 12
  • 29

1 Answers1

12

as suggested in 'Failed to unlink socket file" error in MongoDB 3.0, I removed /tmp/mongodb-27017.sock and started MongoDB successfully!

mhrsalehi
  • 1,124
  • 1
  • 12
  • 29