[SERVER-27933] MongoDB service doesn't start on Windows 10 startup Created: 07/Feb/17  Updated: 26/Jul/17  Resolved: 24/Mar/17

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 3.2.5
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Pierre Theate Assignee: Mark Agarunov
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Steps To Reproduce:

Start Windows 10.
The MongoDB service is not started.

Participants:

 Description   

At windows 10 startup, the MongoDB service doesn't start.
There is no log as if it was not run.
Starting the server manually (from command line or services window) works fine.
I tried to set the startup type to Automatic Delayed Start but it doesn't help.
My colleague who created the installation batch script added a service dependency to Netman but leaving or removing this dependency doesn't help.
Using the same MongoDB version and installation script (so with same config) on Windows 7 works fine.
The config file paths are absolute paths.



 Comments   
Comment by Mark Agarunov [ 26/Jul/17 ]

Hello pth,

Thank you for providing the the additional information about this issue and a workaround to avoid the behavior.

Thanks,
Mark

Comment by Pierre Theate [ 26/Jul/17 ]

I finally found the issue.
Starting with Windows 8, a fast startup mode is available to start a computer in less time than is typically required for a traditional, cold startup.
This option was activated in my PC.
You can find it in Power Options -> Choose what the power buttons do (on the left) -> Shutdown settings -> Turn on fast startup (recommended).
When this option is activated and your service is stopped before Shutdown, the service is not restarted.
In summary, there is 2 solutions:

  1. either restart your PC instead of shutting it down
  2. either disable the above option.

Pierre.

Comment by Ramon Fernandez Marina [ 16/Jul/17 ]

andyjcarroll, for MongoDB-related support discussion please post on the mongodb-user group or Stack Overflow with the mongodb tag, where your question will reach a larger audience. A question like this involving more discussion would be best posted on the mongodb-user group. See also our Technical Support page for additional support resources.

Thanks,
Ramón.

Comment by Andy Carroll [ 13/Jul/17 ]

I see this exact same problem on Windows 10.
Following a cold boot mongodb doesn't start despite the service being configured for Autostart, however if you then manually start the service it works correctly.
I assume there is some undocumented dependency and Mongo exist silently when Windows is first starting up.

Any suggestions as to how to track this down?

Comment by Mark Agarunov [ 24/Mar/17 ]

Hello pth,

Unfortunately we haven't been able to reproduce the behavior described. Following the install guide, the service is started on Windows 10 startup in my reproduction attempts.

Thanks,
Mark

Comment by Pierre Theate [ 22/Mar/17 ]

Hello Mark,

I tried a clean install of MongoDB 3.4.2.
I followed exactly the procedure link you sent me.
Same issue, the service doesn't start automatically, no log after shutting down and restarting my PC, see log content here below :
2017-03-22T09:45:36.561+0100 I CONTROL [main] Trying to install Windows service 'MongoDB'
2017-03-22T09:45:36.564+0100 I CONTROL [main] Service 'MongoDB' (MongoDB) installed with command line '"C:\Program Files\MongoDB\Server\3.4\bin\mongod.exe" --config "c:\Program Files\MongoDB\Server\3.4\mongod.cfg" --service'
2017-03-22T09:45:36.564+0100 I CONTROL [main] Service can be started from the command line with 'net start MongoDB'

The service can be started manually.
Here is the content of the file C:\Program Files\MongoDB\Server\3.4\mongod.cfg:
systemLog:
destination: file
path: c:\data\log\mongod.log
storage:
dbPath: c:\data\db

Am I the only one to get this issue ?

Comment by Pierre Theate [ 13/Mar/17 ]

Hello Mark,

As mentioned in my initial message, there is no log on cold start.
Here is the log after a restart:
2017-03-10T15:01:52.966+0100 I CONTROL [main] Trying to start Windows service 'MongoDB'
2017-03-10T15:01:52.968+0100 I STORAGE [thread1] Service running
2017-03-10T15:01:52.968+0100 I CONTROL [initandlisten] MongoDB starting : pid=5088 port=27017 dbpath=E:\IApp\trunk\Sources\Build\Debug\db\ 64-bit host=SWT-N2048
2017-03-10T15:01:52.968+0100 I CONTROL [initandlisten] targetMinOS: Windows 7/Windows Server 2008 R2
2017-03-10T15:01:52.968+0100 I CONTROL [initandlisten] db version v3.2.5
2017-03-10T15:01:52.968+0100 I CONTROL [initandlisten] git version: 34e65e5383f7ea1726332cb175b73077ec4a1b02
2017-03-10T15:01:52.968+0100 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.1p-fips 9 Jul 2015
2017-03-10T15:01:52.968+0100 I CONTROL [initandlisten] allocator: tcmalloc
2017-03-10T15:01:52.968+0100 I CONTROL [initandlisten] modules: none
2017-03-10T15:01:52.968+0100 I CONTROL [initandlisten] build environment:
2017-03-10T15:01:52.968+0100 I CONTROL [initandlisten] distmod: 2008plus-ssl
2017-03-10T15:01:52.968+0100 I CONTROL [initandlisten] distarch: x86_64
2017-03-10T15:01:52.968+0100 I CONTROL [initandlisten] target_arch: x86_64
2017-03-10T15:01:52.968+0100 I CONTROL [initandlisten] options: { config: "e:\IApp\Works\Sources\Build\Debug\mongodb.cfg", service: true, storage: { dbPath: "E:\IApp\trunk\Sources\Build\Debug\db\", mmapv1:

{ smallFiles: true }

}, systemLog:

{ destination: "file", path: "E:\IApp\trunk\Sources\Build\Debug\logs\mongo.log", quiet: true }

}
2017-03-10T15:01:52.970+0100 I - [initandlisten] Detected data files in E:\IApp\trunk\Sources\Build\Debug\db\ created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2017-03-10T15:01:52.972+0100 W - [initandlisten] Detected unclean shutdown - E:\IApp\trunk\Sources\Build\Debug\db\mongod.lock is not empty.
2017-03-10T15:01:52.972+0100 W STORAGE [initandlisten] Recovering data from the last clean checkpoint.
2017-03-10T15:01:52.972+0100 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=4G,session_max=20000,eviction=(threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0),
2017-03-10T15:01:53.260+0100 W STORAGE [initandlisten] Detected configuration for non-active storage engine mmapv1 when current storage engine is wiredTiger
2017-03-10T15:01:53.260+0100 I CONTROL [initandlisten]
2017-03-10T15:01:53.260+0100 I CONTROL [initandlisten] ** WARNING: Insecure configuration, access control is not enabled and no --bind_ip has been specified.
2017-03-10T15:01:53.260+0100 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted,
2017-03-10T15:01:53.260+0100 I CONTROL [initandlisten] ** and the server listens on all available network interfaces.
2017-03-10T15:01:53.260+0100 I CONTROL [initandlisten]
2017-03-10T15:01:53.262+0100 I NETWORK [HostnameCanonicalizationWorker] Starting hostname canonicalization worker
2017-03-10T15:01:53.262+0100 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory 'E:/IApp/trunk/Sources/Build/Debug/db/diagnostic.data'
2017-03-10T15:01:53.265+0100 I NETWORK [initandlisten] waiting for connections on port 27017
2017-03-10T15:01:54.018+0100 I FTDC [ftdc] Unclean full-time diagnostic data capture shutdown detected, found interim file, some metrics may have been lost. OK

The server was not running before a restart.
The server was not shutdown manually so it was either not running, either shut down when shutting down windows.
Thank you for your feedback,
Pierre.

Comment by Mark Agarunov [ 10/Mar/17 ]

Hello pth,

Thank you for the report. Unfortunately we have not yet been able to reproduce the behavior you've described. To better investigate this issue, could you please:

  • Provide the complete logs from mongod on a "cold" boot when it fails to start,
  • Provide the complete logs from mongod after a restart when it successfully starts,
  • Clarify the distinction between a cold boot and a restart, that is, for a "cold" boot, how was the server previously shut down.

Thanks,
Mark

Comment by Pierre Theate [ 10/Mar/17 ]

Another additional information, it works after a Restart of the PC but not on "cold" start !
Do you have any idea when you will have time to investigate on this issue ?
Thanks,

Pierre.

Comment by Pierre Theate [ 06/Mar/17 ]

Additional information, version 3.2.5 is used.

Comment by Pierre Theate [ 02/Mar/17 ]

Oooops I forgot to mention the following command that is executed after the "mongod.exe --config mongodb.cfg --install" command:
sc config MongoDB depend= Netman

Pierre.

Comment by Pierre Theate [ 02/Mar/17 ]

Hello Mark,

No problem when installing MongoDB.
It has been installed as a service and the service is not started automatically as described in my previous mail.
The service has been installed as following:
mongod.exe --config mongodb.cfg --install
with mongodb.cfg file content:
systemLog:
quiet: true
destination: file
path: E:\IApp\trunk\Sources\Build\Debug\logs\mongo.log
storage:
dbPath: E:\IApp\trunk\Sources\Build\Debug\db\
mmapv1:
smallFiles: true
Everything run fine except the service doesn't start at windows 10 startup.
Pierre.

Comment by Mark Agarunov [ 14/Feb/17 ]

Hello pth

Thank you for the report. To properly investigate the behavior you're describing, please check the procedure for installing MongoDB on Windows and pinpoint at which step the process fails and you experience the described behavior. Additionally, please provide the command or script used to create and install the windows service.

Thanks,
Mark

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