2

I installed mongodb and then I created a service to run it. Starting the service works without problem but while trying to shutdown it, I get an error code by windows. I checked the log file and this is what I get:

2017-02-23T08:36:51.518+0100 I CONTROL [serviceStopWorker] shutting down with code:49 enter image description here

(Translation) Error 1067: the process terminated unexpectedly

Service path:

"C:\Program Files\MongoDB\Server\3.4\bin\mongod.exe" --config "C:\Program Files\MongoDB\Server\3.4\bin\mongod.cfg" --service

mongodb.cfg

systemLog:
    destination: file
    path: "C:\\data\\log\\mongod.log"
storage:
    dbPath: "C:\\data\\db"

I tried to find the error codes but it doesn't appear.

https://docs.mongodb.com/manual/reference/exit-codes/

The only reference I could find is this. A test with questions/answers about exit codes. (Question #7)

http://www.sanfoundry.com/mongodb-questions-answers-exit-codes-statutes/

7. 49 code is returned by mongod from _________ Service control Manager.
a) Linux
b) Windows
c) Ubuntu
d) All of the mentioned
View Answer

Answer:a
Explanation:Custom read preferences and write concerns evaluate tags sets in different ways.

But I am on a Windows 7 machine. So that's quite odd.

Windows 7 x64 SP1

MongoDB 3.4.2

Any idea?

LOG

2017-02-23T08:36:48.484+0100 I CONTROL [main] Trying to start Windows service 'MongoDB'

2017-02-23T08:36:48.485+0100 I CONTROL [initandlisten] MongoDB starting : pid=17856 port=27017 dbpath=C:\data\db 64-bit host=FRAmdsWS430

2017-02-23T08:36:48.485+0100 I CONTROL [initandlisten] targetMinOS: Windows 7/Windows Server 2008 R2

2017-02-23T08:36:48.485+0100 I CONTROL [initandlisten] db version v3.4.2

2017-02-23T08:36:48.485+0100 I CONTROL [initandlisten] git version: 3f76e40c105fc223b3e5aac3e20dcd026b83b38b

2017-02-23T08:36:48.485+0100 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.1u-fips 22 Sep 2016

2017-02-23T08:36:48.485+0100 I CONTROL [initandlisten] allocator: tcmalloc

2017-02-23T08:36:48.485+0100 I CONTROL [initandlisten] modules: none

2017-02-23T08:36:48.486+0100 I CONTROL [initandlisten] build environment:

2017-02-23T08:36:48.486+0100 I CONTROL [initandlisten] distmod: 2008plus-ssl

2017-02-23T08:36:48.486+0100 I CONTROL [initandlisten] distarch: x86_64

2017-02-23T08:36:48.486+0100 I CONTROL [initandlisten] target_arch: x86_64

2017-02-23T08:36:48.486+0100 I CONTROL [initandlisten] options: { config: "C:\Program Files\MongoDB\Server\3.4\bin\mongod.cfg", service: true, storage: { dbPath: "C:\data\db" }, systemLog: { destination: "file", path: "C:\data\log\mongod.log" } }

2017-02-23T08:36:48.488+0100 I - [initandlisten] Detected data files in C:\data\db created by the 'mmapv1' storage engine, so setting the active storage engine to 'mmapv1'.

2017-02-23T08:36:48.497+0100 I JOURNAL [initandlisten] journal dir=C:\data\db\journal

2017-02-23T08:36:48.497+0100 I JOURNAL [initandlisten] recover : no journal files present, no recovery needed

2017-02-23T08:36:48.636+0100 I JOURNAL [durability] Durability thread started

2017-02-23T08:36:48.636+0100 I JOURNAL [journal writer] Journal writer thread started

2017-02-23T08:36:48.693+0100 I CONTROL [initandlisten]

2017-02-23T08:36:48.693+0100 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.

2017-02-23T08:36:48.693+0100 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.

2017-02-23T08:36:48.693+0100 I CONTROL [initandlisten]

2017-02-23T08:36:48.938+0100 W FTDC [initandlisten] Failed to initialize Performance Counters for FTDC: WindowsPdhError: PdhExpandCounterPathW failed with 'Das angegebene Objekt wurde nicht auf dem Computer gefunden.' for counter '\Memory\Available Bytes'

2017-02-23T08:36:48.938+0100 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory 'C:/data/db/diagnostic.data'

2017-02-23T08:36:48.940+0100 I NETWORK [thread1] waiting for connections on port 27017

2017-02-23T08:36:48.940+0100 I STORAGE [initandlisten] Service running

2017-02-23T08:36:51.412+0100 I CONTROL [serviceShutdown] got SERVICE_CONTROL_STOP request from Windows Service Control Manager, will terminate after current cmd ends

2017-02-23T08:36:51.412+0100 I NETWORK [serviceShutdown] shutdown: going to close listening sockets...

2017-02-23T08:36:51.412+0100 I NETWORK [serviceShutdown] closing listening socket: 456

2017-02-23T08:36:51.413+0100 I NETWORK [serviceShutdown] shutdown: going to flush diaglog...

2017-02-23T08:36:51.413+0100 I FTDC [serviceShutdown] Shutting down full-time diagnostic data capture

2017-02-23T08:36:51.413+0100 I STORAGE [serviceShutdown] shutdown: waiting for fs preallocator...

2017-02-23T08:36:51.413+0100 I STORAGE [serviceShutdown] shutdown: final commit...

2017-02-23T08:36:51.438+0100 I JOURNAL [serviceShutdown] journalCleanup...

2017-02-23T08:36:51.439+0100 I JOURNAL [serviceShutdown] removeJournalFiles

2017-02-23T08:36:51.439+0100 I JOURNAL [serviceShutdown] old journal file will be removed: C:\data\db\journal\j._0

2017-02-23T08:36:51.439+0100 I JOURNAL [serviceShutdown] Terminating durability thread ...

2017-02-23T08:36:51.516+0100 I JOURNAL [journal writer] Journal writer thread stopped

2017-02-23T08:36:51.516+0100 I JOURNAL [durability] Durability thread stopped

2017-02-23T08:36:51.516+0100 I STORAGE [serviceShutdown] shutdown: closing all files...

2017-02-23T08:36:51.518+0100 I STORAGE [serviceShutdown] closeAllFiles() finished

2017-02-23T08:36:51.518+0100 I STORAGE [serviceShutdown] shutdown: removing fs lock...

2017-02-23T08:36:51.518+0100 I CONTROL [serviceShutdown] now exiting

2017-02-23T08:36:51.518+0100 I CONTROL [serviceStopWorker] shutting down with code:49

1 Answer 1

1

This seems to be a bug introduced in MongoDB version 3.4.2. Check out https://jira.mongodb.org/browse/SERVER-6065

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.