Follow

MongoDB service fails to start - DB detected unclean shutdown in log

Product: ProfileUnity

Product Version: 6.5.x

Expires on: 365 days from publish date

Updated: Jan 12, 2015

 

Problem: 

MongoDB Service won't start or stay running, causing FlexDisk Service to not start or throw errors in the logs.

 

Symptoms:

DB could be corrupt if the end of C:\Program Files\MongoDB\log\mongo.log reflects this message over and over each startup attempt of the service:

2016-01-06T09:02:41.663-0600 I CONTROL  ***** SERVER RESTARTED *****
2016-01-06T09:02:41.686-0600 I CONTROL  Trying to start Windows service 'MongoDB'
2016-01-06T09:02:41.706-0600 I STORAGE  Service running
2016-01-06T09:02:41.707-0600 I CONTROL  [initandlisten] MongoDB starting : pid=1564 port=27017 dbpath=C:\Program Files\MongoDB\data\db 64-bit host=LWLProfile01
2016-01-06T09:02:41.707-0600 I CONTROL  [initandlisten] targetMinOS: Windows 7/Windows Server 2008 R2
2016-01-06T09:02:41.707-0600 I CONTROL  [initandlisten] db version v3.0.0
2016-01-06T09:02:41.707-0600 I CONTROL  [initandlisten] git version: a841fd6394365954886924a35076691b4d149168
2016-01-06T09:02:41.707-0600 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.1j-fips 15 Oct 2014
2016-01-06T09:02:41.707-0600 I CONTROL  [initandlisten] build info: windows sys.getwindowsversion(major=6, minor=1, build=7601, platform=2, service_pack='Service Pack 1') BOOST_LIB_VERSION=1_49
2016-01-06T09:02:41.707-0600 I CONTROL  [initandlisten] allocator: system
2016-01-06T09:02:41.707-0600 I CONTROL  [initandlisten] options: { config: "C:\Program Files\MongoDB\mongod.cfg", security: { authorization: "enabled" }, service: true, storage: { dbPath: "C:\Program Files\MongoDB\data\db", mmapv1: { smallFiles: true } }, systemLog: { destination: "file", logAppend: true, path: "C:\Program Files\MongoDB\log\mongo.log" } }
2016-01-06T09:02:41.713-0600 W -        [initandlisten] Detected unclean shutdown - C:\Program Files\MongoDB\data\db\mongod.lock is not empty.
2016-01-06T09:02:41.723-0600 I STORAGE  [initandlisten] **************
old lock file: C:\Program Files\MongoDB\data\db\mongod.lock.  probably means unclean shutdown,
but there are no journal files to recover.
this is likely human error or filesystem corruption.
please make sure that your journal directory is mounted.
found 5 dbs.
see: http://dochub.mongodb.org/core/repair for more information
*************
2016-01-06T09:02:41.727-0600 I STORAGE  [initandlisten] exception in initAndListen: 12596 old lock file, terminating
2016-01-06T09:02:41.727-0600 I CONTROL  [initandlisten] dbexit:  rc: 49

Possible resolution: Repair the DB manually, this example is an in-place repair, **TAKE A SNAPSHOT FIRST** just in case.  (Assumes default install path)

Option A)

Delete "Mongo.lock" file from "C:\Program Files\MongoDB directory" and try to start the service

Option B)

Open an elevated Command Prompt (Run as Administrator) and execute:  "C:\Program Files\MongoDB\bin\mongod.exe" --dbpath "C:\Program Files\MongoDB\data\db" --repair

Once complete the process should end and the service should be able to be started normally again either via the Services MMC snap-in or a reboot.

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Article is closed for comments.