32

I just instaled mongo 3. And tried to run it as windows server but receive error

The MongoDB 3.0 service terminated with the following service-specific error: 
Cannot create another system semaphore.

Can't find any info about that error and mongodb.

3
  • 1
    I just installed also Mongo and got same error. Did you find out what is the problem?
    – jpkeisala
    Commented May 12, 2015 at 19:18
  • 1
    Yes, in my case problem was in hard drive available space. Need more than 3 GB
    – Radislav
    Commented May 13, 2015 at 9:07
  • 1
    The 3GB problem was mine too Commented Nov 1, 2015 at 12:58

11 Answers 11

30

Check mongodb logs. In my case mongodb could not find directory from mongod.cfg

1
  • 2
    Yes, I had same directory missing problem
    – jpkeisala
    Commented May 14, 2015 at 9:41
19

In my case it appered to be mongod.lock issue after unexpected shutdown.

Detected unclean shutdown - E:\MongoDb\Databases\mongod.lock is not empty.

I deleted E:\MongoDb\Databases\mongod.lock and mongo successfuly started.

0
3

In Windows:

there is an effective method to solve this issue.

Firstly, try to delete the file storage.bson under the folder "D:\mongodb\data", or the corresponding path in your PC.

If the issue still exists, try following steps in order.

For example mongoDB version 3.6 is installed, and the install path of MongoDB is "D:\Program Files\MongoDB".

Create folder D:\mongodb\logs, then create file mongodb.log inside this folder.

Run cmd.exe as administrator,

D:\Program Files\MongoDB\Server\3.6\bin>taskkill /F /IM mongod.exe
D:\Program Files\MongoDB\Server\3.6\bin>mongod.exe --logpath D:\mongodb\logs\mongodb.log --logappend --dbpath D:\mongodb\data --directoryperdb --serviceName MongoDB --remove
D:\Program Files\MongoDB\Server\3.6\bin>mongod --logpath "D:\mongodb\logs\mongodb.log" --logappend --dbpath "D:\mongodb\data" --directoryperdb --serviceName "MongoDB" --serviceDisplayName "MongoDB" --install

Remove these two files mongod.lock and storage.bson under the folder "D:\mongodb\data".

Then type net start MongoDB in the cmd using administrator privilege, the issue will be solved.

1
  • Thanks ... storage.bson was not letting me start the service.
    – Apoorv
    Commented Oct 17, 2018 at 11:05
2

This happened for me a couple times because my Mac crashed which resulted in unclean shutdown of Parallels and my Mongo instance. mongod.lock was not empty.

This was on a development server so I didn't have backups. I was able to repair by using

mongod --repair --repairpath <path to your mongo data>

More instructions here

2

After installing the .msi on Windows 10 in Program Files, I created the service for a different data location C:\Mongo\Data\DB

The Service installed correctly but didn't start with error "Cannot create another system semaphore" because:

I hadn't created the required folder structure. Simple as that - d'oh!

Hope this helps someone.

1

Also check permissions for dbpath and logpath. In my case I had configured mongo as a service running as Network Service, but, hadn't given Network Service write access to those directories.

0
1

In case this helps anyone else, for me it was that I had started mongod.exe manually in a command prompt window so the windows service couldn't run mongod.exe on the same port already in use. Doh!

1

I had the same problem and in my case the config was wrong. This error from event viewer is not very helpful and mostly confusing so everyone should check mongo logs first.

1

Didn't have enough space on disc C: where MongoDB was installed. After making some space -- mongod.exe successfully started.

0

In my case, another instance of MongoDB was running in command prompt on the same port.

0

For me, on a fresh install of MongoDB v4.0.3 on Windows 10 Pro, the install failed to start the mongo service at the end.

Trying to start mongod from the command prompt, pointed to the correct mongodb.cfg config, gave me the error:

Unrecognized option: mp

I ripped open the config and searched for "mp", to find the last 2 lines of the file:

#snmp:
mp:

I threw a # in front of that last line and tried again, and the service started fine.

¯\_(ツ)_/¯

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.