[SERVER-16106] Event Viewer (system) error when pressing power button on machine Created: 12/Nov/14  Updated: 31/Jul/15  Resolved: 09/Jan/15

Status: Closed
Project: Core Server
Component/s: Admin
Affects Version/s: 2.6.3
Fix Version/s: 2.8.0-rc5

Type: Bug Priority: Major - P3
Reporter: Paul Knopf Assignee: Mark Benvenuto
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Zip Archive mongo.log.zip    
Backwards Compatibility: Fully Compatible
Operating System: Windows
Participants:

 Description   

I got an error in the event log every time I shutdown the machine.

Error	11/12/2014 9:29:58 AM	Service Control Manager	7034	None
 
Log Name:      System
Source:        Service Control Manager
Date:          11/12/2014 9:29:58 AM
Event ID:      7034
Task Category: None
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      DRSHD-xxxx-xxxC
Description:
The MongoDB service terminated unexpectedly.  It has done this 1 time(s).
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Service Control Manager" Guid="{555908d1-a6d7-4695-8e1e-26931d2012f4}" EventSourceName="Service Control Manager" />
    <EventID Qualifiers="49152">7034</EventID>
    <Version>0</Version>
    <Level>2</Level>
    <Task>0</Task>
    <Opcode>0</Opcode>
    <Keywords>0x8080000000000000</Keywords>
    <TimeCreated SystemTime="2014-11-12T14:29:58.423828100Z" />
    <EventRecordID>258292</EventRecordID>
    <Correlation />
    <Execution ProcessID="512" ThreadID="664" />
    <Channel>System</Channel>
    <Computer>DRSHD-xxxx-xxxC</Computer>
    <Security />
  </System>
  <EventData>
    <Data Name="param1">MongoDB</Data>
    <Data Name="param2">1</Data>
  </EventData>
</Event>



 Comments   
Comment by Githook User [ 09/Jan/15 ]

Author:

{u'username': u'markbenvenuto', u'name': u'Mark Benvenuto', u'email': u'mark.benvenuto@mongodb.com'}

Message: SERVER-16106: Windows Service - Process SERVICE_CONTROL_SHUTDOWN correctly
Branch: master
https://github.com/mongodb/mongo/commit/dec50fa881896c0f4691df22d0017daab21e8de5

Comment by Githook User [ 09/Jan/15 ]

Author:

{u'username': u'markbenvenuto', u'name': u'Mark Benvenuto', u'email': u'mark.benvenuto@mongodb.com'}

Message: SERVER-16106: Windows Service - Process SERVICE_CONTROL_SHUTDOWN correctly
Branch: master
https://github.com/mongodb/mongo/commit/75ca2609712b574be3b88cd40aec2ab0d8c59d0f

Comment by Githook User [ 09/Jan/15 ]

Author:

{u'username': u'markbenvenuto', u'name': u'Mark Benvenuto', u'email': u'mark.benvenuto@mongodb.com'}

Message: SERVER-16106: Windows Service - Process SERVICE_CONTROL_SHUTDOWN correctly
Branch: master
https://github.com/mongodb/mongo/commit/c81a76de0b041f1df5bd309a03f13edaa7f5c599

Comment by Mark Benvenuto [ 12/Nov/14 ]

Paul, your description of the problem is accurate. MongoD registers a Control-C handler via SetConsoleCtrlHandler. This same callback function also delivers us the Shutdown notification which causes us to shutdown even though we should wait for the SCM to signal us to stop.

Comment by Paul Knopf [ 12/Nov/14 ]

No issues with the database.

I am wondering if it has to do with mongod.exe listening to a shutdown command from the operating system, instead of from the service host directly. Maybe mongod.exe is shutting down correctly on a CTRL_SHUTDOWN_EVENT, but it shutdown before the service host was going to tell it. Therefore, the service host thinks mongod.exe shutdown "unexpectedly".

Just a thought.

Comment by Ramon Fernandez Marina [ 12/Nov/14 ]

Microsoft documentation indicates that this type of Event ID is caused by a service not producing a success return value on stop. However the the logs show that mongod shut down correctly:

2014-11-12T09:28:30.158-0500 CTRL_SHUTDOWN_EVENT signal
2014-11-12T09:28:30.158-0500 [consoleTerminate] got CTRL_SHUTDOWN_EVENT, will terminate after current cmd ends
2014-11-12T09:28:30.158-0500 [consoleTerminate] now exiting
2014-11-12T09:28:30.158-0500 [consoleTerminate] dbexit: 
2014-11-12T09:28:30.158-0500 [consoleTerminate] shutdown: going to close listening sockets...
2014-11-12T09:28:30.158-0500 [consoleTerminate] closing listening socket: 564
2014-11-12T09:28:30.158-0500 [consoleTerminate] shutdown: going to flush diaglog...
2014-11-12T09:28:30.158-0500 [consoleTerminate] shutdown: going to close sockets...
2014-11-12T09:28:30.158-0500 [consoleTerminate] shutdown: waiting for fs preallocator...
2014-11-12T09:28:30.158-0500 [consoleTerminate] shutdown: closing all files...
2014-11-12T09:28:30.158-0500 [consoleTerminate] closeAllFiles() finished
2014-11-12T09:28:30.158-0500 [consoleTerminate] shutdown: removing fs lock...
2014-11-12T09:28:30.158-0500 [consoleTerminate] dbexit: really exiting now

Is your MongoDB instance experiencing any problems? Does the issue reproduce if you stop the mongod service manually? What about if you shut down via software?

Generated at Thu Feb 08 03:39:59 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.