Ubuntu reports unable to start Mongod database

After used a snap installation all was working fine and got no errors in the systemlogs
This morning, a update was introduced for the mongod database.
After install this update errors where reported in the log files.

This is the information from the database:

sudo mongod --version
db version v4.4.16
Build Info: {
“version”: “4.4.16”,
“gitVersion”: “a7bceadbac919a2c035f2874c61d138fd75d6a6f”,
“openSSLVersion”: “OpenSSL 1.1.1f 31 Mar 2020”,
“modules”: ,
“allocator”: “tcmalloc”,
“environment”: {
“distmod”: “ubuntu2004”,
“distarch”: “x86_64”,
“target_arch”: “x86_64”
}
}

This is the information found in the system logs:

Sep 24 07:00:00 ubuntu systemd[1]: Failed to start Service for snap application rocketchat-server.rocketchat-mongo.
Sep 24 07:00:00 ubuntu systemd[1]: snap.rocketchat-server.rocketchat-mongo.service: Failed with result ‘exit-code’.
Sep 24 07:00:00 ubuntu systemd[1]: snap.rocketchat-server.rocketchat-mongo.service: Start request repeated too quickly.
Sep 24 07:00:00 ubuntu systemd[1]: Stopped Service for snap application rocketchat-server.rocketchat-mongo.
Sep 24 07:00:00 ubuntu systemd[1]: snap.rocketchat-server.rocketchat-mongo.service: Scheduled restart job, restart counter is at 6.
Sep 24 06:59:59 ubuntu systemd[1]: Failed to start Service for snap application rocketchat-server.rocketchat-mongo.
Sep 24 06:59:59 ubuntu systemd[1]: snap.rocketchat-server.rocketchat-mongo.service: Failed with result ‘exit-code’.
Sep 24 06:59:59 ubuntu systemd[1]: snap.rocketchat-server.rocketchat-mongo.service: Control process exited, code=exited, status=1/FAILURE
Sep 24 06:59:59 ubuntu rocketchat-server.rocketchat-mongo[1608]: [ERROR] mongo server start failed
Sep 24 06:59:59 ubuntu rocketchat-server.rocketchat-mongo[1629]: To see additional information in this output, start without the “–fork” option.
Sep 24 06:59:59 ubuntu rocketchat-server.rocketchat-mongo[1629]: ERROR: child process failed, exited with 48
Sep 24 06:59:59 ubuntu mongod[1632]: {“t”:{“$date”:“2022-09-24T06:59:59.779+00:00”},“s”:“I”, “c”:“CONTROL”, “id”:23138, “ctx”:“initandlisten”,“msg”:“Shutting down”,“attr”:{“exitCode”:48}}
Sep 24 06:59:59 ubuntu mongod[1632]: {“t”:{“$date”:“2022-09-24T06:59:59.779+00:00”},“s”:“I”, “c”:“CONTROL”, “id”:20565, “ctx”:“initandlisten”,“msg”:“Now exiting”}
Sep 24 06:59:59 ubuntu mongod[1632]: {“t”:{“$date”:“2022-09-24T06:59:59.779+00:00”},“s”:“I”, “c”:“FTDC”, “id”:4784926, “ctx”:“initandlisten”,“msg”:“Shutting down full-time data capture”}
Sep 24 06:59:59 ubuntu mongod[1632]: {“t”:{“$date”:“2022-09-24T06:59:59.779+00:00”},“s”:“I”, “c”:“-”, “id”:4784931, “ctx”:“initandlisten”,“msg”:“Dropping the scope cache for shutdown”}
Sep 24 06:59:59 ubuntu mongod[1632]: {“t”:{“$date”:“2022-09-24T06:59:59.778+00:00”},“s”:“I”, “c”:“STORAGE”, “id”:4784929, “ctx”:“initandlisten”,“msg”:“Acquiring the global lock for shutdown”}
Sep 24 06:59:59 ubuntu mongod[1632]: {“t”:{“$date”:“2022-09-24T06:59:59.778+00:00”},“s”:“I”, “c”:“STORAGE”, “id”:4784927, “ctx”:“initandlisten”,“msg”:“Shutting down the HealthLog”}
Sep 24 06:59:59 ubuntu mongod[1632]: {“t”:{“$date”:“2022-09-24T06:59:59.778+00:00”},“s”:“I”, “c”:“CONTROL”, “id”:4784925, “ctx”:“initandlisten”,“msg”:“Shutting down free monitoring”}
Sep 24 06:59:59 ubuntu mongod[1632]: {“t”:{“$date”:“2022-09-24T06:59:59.778+00:00”},“s”:“I”, “c”:“SHARDING”, “id”:4784921, “ctx”:“initandlisten”,“msg”:“Shutting down the MigrationUtilExecutor”}
Sep 24 06:59:59 ubuntu mongod[1632]: {“t”:{“$date”:“2022-09-24T06:59:59.778+00:00”},“s”:“I”, “c”:“NETWORK”, “id”:4784918, “ctx”:“initandlisten”,“msg”:“Shutting down the ReplicaSetMonitor”}
Sep 24 06:59:59 ubuntu mongod[1632]: {“t”:{“$date”:“2022-09-24T06:59:59.778+00:00”},“s”:“I”, “c”:“REPL”, “id”:4784907, “ctx”:“initandlisten”,“msg”:“Shutting down the replica set node executor”}
Sep 24 06:59:59 ubuntu mongod[1632]: {“t”:{“$date”:“2022-09-24T06:59:59.778+00:00”},“s”:“I”, “c”:“NETWORK”, “id”:4784905, “ctx”:“initandlisten”,“msg”:“Shutting down the global connection pool”}
Sep 24 06:59:59 ubuntu mongod[1632]: {“t”:{“$date”:“2022-09-24T06:59:59.778+00:00”},“s”:“I”, “c”:“SHARDING”, “id”:4784902, “ctx”:“initandlisten”,“msg”:“Shutting down the WaitForMajorityService”}
Sep 24 06:59:59 ubuntu mongod[1632]: {“t”:{“$date”:“2022-09-24T06:59:59.778+00:00”},“s”:“I”, “c”:“COMMAND”, “id”:4784901, “ctx”:“initandlisten”,“msg”:“Shutting down the MirrorMaestro”}
Sep 24 06:59:59 ubuntu mongod[1632]: {“t”:{“$date”:“2022-09-24T06:59:59.778+00:00”},“s”:“I”, “c”:“REPL”, “id”:4784900, “ctx”:“initandlisten”,“msg”:“Stepping down the ReplicationCoordinator for shutdown”,“attr”:{“waitTimeMillis”:10000}}
Sep 24 06:59:59 ubuntu mongod[1632]: {“t”:{“$date”:“2022-09-24T06:59:59.778+00:00”},“s”:“E”, “c”:“STORAGE”, “id”:20568, “ctx”:“initandlisten”,“msg”:“Error setting up listener”,“attr”:{“error”:{“code”:9001,“codeName”:“SocketException”,“errmsg”:“Address already in use”}}}
Sep 24 06:59:59 ubuntu mongod[1632]: {“t”:{“$date”:“2022-09-24T06:59:59.776+00:00”},“s”:“I”, “c”:“CONTROL”, “id”:21951, “ctx”:“initandlisten”,“msg”:“Options set by command line”,“attr”:{“options”:{“config”:“/var/snap/rocketchat-server/1526/mongod.conf”,“net”:{“bindIp”:“127.0.0.1”,“port”:27017},“processManagement”:{“fork”:true,“pidFilePath”:“/var/snap/rocketchat-server/common/mongod.pid”},“replication”:{“replSetName”:“rs0”},“setParameter”:{“enableLocalhostAuthBypass”:“false”},“storage”:{“dbPath”:“/var/snap/rocketchat-server/common”,“journal”:{“enabled”:true}},“systemLog”:{“destination”:“syslog”}}}}
Sep 24 06:59:59 ubuntu mongod[1632]: {“t”:{“$date”:“2022-09-24T06:59:59.776+00:00”},“s”:“I”, “c”:“CONTROL”, “id”:51765, “ctx”:“initandlisten”,“msg”:“Operating System”,“attr”:{“os”:{“name”:“Ubuntu”,“version”:“20.04”}}}
Sep 24 06:59:59 ubuntu mongod[1632]: {“t”:{“$date”:“2022-09-24T06:59:59.776+00:00”},“s”:“I”, “c”:“CONTROL”, “id”:23403, “ctx”:“initandlisten”,“msg”:“Build Info”,“attr”:{“buildInfo”:{“version”:“4.4.15”,“gitVersion”:“bc17cf2c788c5dda2801a090ea79da5ff7d5fac9”,“openSSLVersion”:“OpenSSL 1.1.1f 31 Mar 2020”,“modules”:,“allocator”:“tcmalloc”,“environment”:{“distmod”:“ubuntu2004”,“distarch”:“x86_64”,“target_arch”:“x86_64”}}}}
Sep 24 06:59:59 ubuntu mongod[1632]: {“t”:{“$date”:“2022-09-24T06:59:59.776+00:00”},“s”:“I”, “c”:“STORAGE”, “id”:4615611, “ctx”:“initandlisten”,“msg”:“MongoDB starting”,“attr”:{“pid”:1632,“port”:27017,“dbPath”:“/var/snap/rocketchat-server/common”,“architecture”:“64-bit”,“host”:“ubuntu”}}
Sep 24 06:59:59 ubuntu mongod[1632]: {“t”:{“$date”:“2022-09-24T06:59:59.769+00:00”},“s”:“W”, “c”:“ASIO”, “id”:22601, “ctx”:“main”,“msg”:“No TransportLayer configured during NetworkInterface startup”}
Sep 24 06:59:59 ubuntu mongod[1632]: {“t”:{“$date”:“2022-09-24T06:59:59.769+00:00”},“s”:“I”, “c”:“NETWORK”, “id”:4648602, “ctx”:“main”,“msg”:“Implicit TCP FastOpen in use.”}
Sep 24 06:59:59 ubuntu mongod[1632]: {“t”:{“$date”:“2022-09-24T06:59:59.767+00:00”},“s”:“W”, “c”:“ASIO”, “id”:22601, “ctx”:“main”,“msg”:“No TransportLayer configured during NetworkInterface startup”}
Sep 24 06:59:59 ubuntu mongod[1632]: {“t”:{“$date”:“2022-09-24T06:59:59.765+00:00”},“s”:“I”, “c”:“CONTROL”, “id”:23285, “ctx”:“main”,“msg”:“Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols ‘none’”}
Sep 24 06:59:59 ubuntu rocketchat-server.rocketchat-mongo[1632]: forked process: 1632
Sep 24 06:59:59 ubuntu rocketchat-server.rocketchat-mongo[1629]: about to fork child process, waiting until server is ready for connections.
Sep 24 06:59:59 ubuntu kernel: audit: type=1400 audit(1664002799.751:58): apparmor=“DENIED” operation=“open” profile=“snap.rocketchat-server.rocketchat-mongo” name=“/proc/1629/mountinfo” pid=1629 comm=“mongod” requested_mask=“r” denied_mask=“r” fsuid=0 ouid=0
Sep 24 06:59:59 ubuntu audit[1629]: AVC apparmor=“DENIED” operation=“open” profile=“snap.rocketchat-server.rocketchat-mongo” name=“/proc/1629/mountinfo” pid=1629 comm=“mongod” requested_mask=“r” denied_mask=“r” fsuid=0 ouid=0
Sep 24 06:59:59 ubuntu systemd[1]: Starting Service for snap application rocketchat-server.rocketchat-mongo…
Sep 24 06:59:59 ubuntu systemd[1]: Stopped Service for snap application rocketchat-server.rocketchat-mongo.
Sep 24 06:59:59 ubuntu systemd[1]: snap.rocketchat-server.rocketchat-mongo.service: Scheduled restart job, restart counter is at 5.

Asking the status give me this, which is in contradiction with the systemlogs:

sudo systemctl status mongod.service
● mongod.service - MongoDB Database Server
Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2022-09-24 06:59:32 UTC; 30min ago
Docs: https://docs.mongodb.org/manual
Main PID: 728 (mongod)
Memory: 243.6M
CGroup: /system.slice/mongod.service
└─728 /usr/bin/mongod --config /etc/mongod.conf

Sep 24 06:59:32 ubuntu systemd[1]: Started MongoDB Database Server.

Is there anything I can do to solve this problem?
Did the update install a second mongo instance? if true how to remove it without damage the snap install?

Using the rocket website does not produce any error

greetings

NO need to answer this anymore, I did a full clean reinstall and this issues are gone,

Thanks

1 Like

Thanks for sharing!

If possible, please, prefer docker in favor of Snap, as this will give you a more similar deployment to a lot of other users :slight_smile:

Thanks!