Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-2719

mongod running as a service on Windows does not restart correctly after a reboot

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.8.1, 1.9.0
    • Affects Version/s: 1.8.0-rc1
    • Component/s: None
    • None
    • Environment:
      Windows 7 64-bit with SP1 and all Windows Updates as of 2011-03-07.
    • Windows

      Steps to reproduce:

      1. mongod --install --logpath c:\data\logs --logappend
      2. net start MongoDB
      3. at this point mongod is running as a Windows service
      4. reboot

      Upon reboot mongod repeatedly fails to start. If you watch its status using the Windows Services Administrative Tool you can see the status alternating between Starting and Started.

      Each time mongod attempts to start it writes a few lines to the log file, and the attempts to start are happening in such quick succession that the log file is growing at the rate of several MB/minute, so unless action is taken the disk can be filled up.

      To break out of the cycle repeatedly run:

      net stop MongoDB

      The problem is that this command only works when the service is in the Started state, which it is only very briefly before failing. So you have to keep running this command until you get lucky.

      The other piece of information is that upon reboot the mongod.lock file is not empty. It contains one line of text with a number in it.

      The two log files attached are the log file right after the service was started for the first time, and the first 20K of the ever growing log file after reboot.

        1. 0001-SERVER-2719-clean-up-the-log-file-when-Windows-shuts.patch
          1 kB
        2. logs.zip
          1 kB
        3. mongo.log
          3.87 MB

            Assignee:
            tad Tad Marshall
            Reporter:
            robert@mongodb.com Robert Stam
            Votes:
            2 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: