can not start service because of old lock file

787 views
Skip to first unread message

ruby

unread,
Feb 24, 2011, 9:46:45 PM2/24/11
to mongod...@googlegroups.com
can not start service because of old lock file, terminating


as a service, must stop the service manually before shutting down the server?
usually it'd start and stop as the windows start and stop.

---
installed mongodb as a windows service,
after I start the service and then stop it,
net start mongodb
net stop mongodb
the logfile is :
__________________________________________________
[initandlisten] MongoDB starting:pid=2044 port=27017 dbpath=c:\mongodata 64-bit
[initandlisten] db version v1.8.0-rc0, pdfile version 4.5
[initandlisten] git version: 65a7e81df0747b6bc9380b78e0182192bacdb4d0
[initandlisten] build sys info: windows (6,1,7600,2,'') BOOST_LIB_VERSION=1_42
[initandlisten] waiting for connections on port 27017
[websvr] web admin interface listening on port 28017
shutdown: going to close listening sockets...
closing listening socket: 248
closing listening socket: 260
shutdown: going to flush diaglog...
shutdown: going to close sockets...
shutdown: waiting for fs preallocator...
shutdown: closing all files...
closeAllFiles() finished
shutdown: removing fs lock...
__________________________________________________
the mongod.lock is deleted automatically, and can start the service again .

but if I start the service and then stop the server (and restart the server),
net start mongodb
shutdown
(power on again)
the logfile is :
__________________________________________________
[initandlisten] MongoDB starting:pid=1524 port=27017 dbpath=c:\mongodata 64-bit
[initandlisten] db version v1.8.0-rc0, pdfile version 4.5
[initandlisten] git version: 65a7e81df0747b6bc9380b78e0182192bacdb4d0
[initandlisten] build sys info: windows (6,1,7600,2,'') BOOST_LIB_VERSION=1_42
[initandlisten] waiting for connections on port 27017
[websvr] web admin interface listening on port 28017
CTRL_LOGOFF_EVENT signal (ignored)
CTRL_LOGOFF_EVENT signal (ignored)
CTRL_SHUTDOWN_EVENT signal (ignored)
__________________________________________________

and can not start the service any more, because of old lock file, terminating

seems that it receives the CTRL_SHUTDOWN_EVENT signal,
but doesn't delete the lock file. (ignored? )

as a service, must stop the service manually before shutting down the server?
usually it'd start and stop as the windows start and stop.

maybe ignore the .lock file?

see also:
http://jira.mongodb.org/browse/SERVER-2160
Mongodb reports successful start even when it fails to start
exception in initAndListen std::exception: old lock file, terminating

roger

unread,
Feb 25, 2011, 1:19:08 AM2/25/11
to mongodb-user
I'm not a windows expert, but it looks like the shutdown signal is
ignored when you shutdown your machine, which causes mongodb to get
killed. On shutdown, can you invoke net stop mongodb somewhere ?

-Roger

ruby

unread,
Feb 25, 2011, 2:18:20 AM2/25/11
to mongod...@googlegroups.com
roger <roger@...> writes:

>
> I'm not a windows expert, but it looks like the shutdown signal is
> ignored when you shutdown your machine, which causes mongodb to get
> killed. On shutdown, can you invoke net stop mongodb somewhere ?
>

usually services should start and stop as the windows start and stop.

> invoke net stop mongodb somewhere on shutdown ?

don't think this's a good idea.


--
this only happens on the new beta version.

version 1.65 or 1.74 is OK.

Alvin Richards

unread,
Feb 25, 2011, 2:46:41 AM2/25/11
to mongodb-user
If you are just seing this with 1.8.rc0 please log an issue at

http://jira.mongodb.org.

Thanks

-Alvin

Nat

unread,
Feb 25, 2011, 3:53:45 AM2/25/11
to mongod...@googlegroups.com
Do you see anything in event log? If the service doesn't shutdown properly, you should see some messages, especially if it reported something differently between 1.6.5 and 1.8.0-rc0.
--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com.
To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.

ruby

unread,
Feb 25, 2011, 3:54:45 AM2/25/11
to mongod...@googlegroups.com
ruby <rubik@...> writes:

check again,
seems that at version 1.65 or 1.74 ,
it also says "the shutdown signal is ignored "
and don't delete the mongod.lock file.
but the service can start anyway.


seems that only after 1.6.5 and 1.7.4 ,
from 1.7.5 , mongodb begin to delete the mongod.lock
after stopping, and check if the mongod.lock exists
before starting,

and then the problem exists:

ruby

unread,
Feb 25, 2011, 4:27:29 AM2/25/11
to mongod...@googlegroups.com
Alvin Richards <alvin@...> writes:

>
> If you are just seing this with 1.8.rc0 please log an issue at
>
> http://jira.mongodb.org.

no, this happens on the new beta versions, include 1.7.5 1.7.6 .1.8.rc0 .

version 1.6.5 or 1.7.4 is OK.

ruby

unread,
Feb 25, 2011, 4:34:56 AM2/25/11
to mongod...@googlegroups.com
Nat <nat.lueng@...> writes:

>
> Do you see anything in event log? If the service doesn't shutdown properly,
> you should see some messages,


event log?
lots of error messages. about 10 errors every seconds:

The Mongo DB service terminated unexpectedly.
It has done this 1 time(s). The following corrective action
will be taken in 0 milliseconds: Restart the service.

the mongod.exe process keeps running , killing itself , and restart

if using this command " net stop mongodb "
there's these event log:

The Mongo DB service entered the stopped state.
The Mongo DB service was successfully sent a stop control.

but if just shutdown or restart the server, there's no such messages.

at version 1.6.5 or 1.7.4, there's no these messages either,
but version 1.6.5 or 1.7.4 seems not checking the mongod.lock

mongodb seems to check the mongod.lock file from version 1.7.5,
am i right ?

at version 1.6.5 or 1.7.4, the mongod.lock file wouldn't be deleted
after system restart, but it doesn't check if the mongod.lock exists
and can start the service with no problem.

Nat

unread,
Feb 25, 2011, 4:40:57 AM2/25/11
to mongod...@googlegroups.com
For the restart problem, I noticed a similar problem in the latest version as well. It looks like that when mongodb is installed as a service, its recovery policy is set to restart immediately. This means if you have a mongodb lock file left in there, it will keep restarting forever.
-----Original Message-----
From: ruby <ru...@sina.com>
Sender: mongod...@googlegroups.com
Date: Fri, 25 Feb 2011 09:34:56
To: <mongod...@googlegroups.com>
Reply-To: mongod...@googlegroups.com
Subject: [mongodb-user] Re: can not start service because of old lock file

ruby

unread,
Feb 27, 2011, 9:46:46 PM2/27/11
to mongod...@googlegroups.com
Nat <nat.lueng@...> writes:

>
> For the restart problem, I noticed a similar problem in the latest version as
well.
> It looks like that when mongodb is installed as a service,
> its recovery policy is set to restart immediately.
> This means if you have a mongodb lock file left in there,
> it will keep restarting forever.

its recovery policy is set to restart immediately ?

sorry but what does this mean? and how to change this behavior?

Reply all
Reply to author
Forward
0 new messages