8

When I try to connect mongdb service i am getting error: **

Windows could not start the MongoDB service on Local Computer

**

Error1053: the service did not respond to the start or control request in a timely fashion

enter image description here

Mongodb installed path: C:\MongoDB //mongod.cfg file inside the MongodB folder not in bin folder

mongod.cfg file:


systemLog:

    destination: file

    path: c:\data\log\mongod.log

storage:

    dbPath: c:\data\db***

how do I resolve this error and run a mongodb service

Neil Lunn
  • 148,042
  • 36
  • 346
  • 317
N15
  • 305
  • 2
  • 4
  • 17
  • Probably by looking at the actual error messages in that "sytemLog" you are telling us you know where it is. A lot more useful than "screenshots" with no information at all. Look at the log, and then post the "text" if you don't understand the error listed there. – Neil Lunn Nov 08 '17 at 08:24
  • 1
    log folder is empty – N15 Nov 08 '17 at 09:21
  • 1
    Did you find any solution for this? – Setu Kumar Basak Jul 15 '18 at 17:56

6 Answers6

19

I had a similar problem with MongoDB 4. In auto generated config file, there is an extra configuration, that caused the problem.

#snmp:
mp:

When i deleted "mp:", i can finally start the server.

rale
  • 303
  • 2
  • 7
  • 1
    for me, the line after `#snmp:` was `op:` and commenting that out made it work. – Cory-G Dec 11 '18 at 20:19
  • I recommend **commenting** and not *deleting* it. Use `#` at the beginning of the line. – Zebiano Apr 29 '20 at 12:57
  • in addition to duplicate #snmp entries, mine somehow had an empty line with just a colon ":" deleted that line and the windows service went green – charles ross Jul 28 '20 at 23:02
4

For me , this error was about mongod.cfg file , which I add security; authorization enabled. But it should be colon after security not semicolon.

security:
  authorization: enabled
SayJeyHi
  • 1,559
  • 4
  • 19
  • 39
1

In my case the error was caused by the server running out of space in the hard disk drive.

Clearing some space solved the problem for me.

JulioCT
  • 1,057
  • 8
  • 7
1

For me the same error occurred when I edited the "mongod.cfg" file and added

#security:
  authorization: enabled

to #security

but the correct syntax is the following:

#security:
# authorization: enabled

I leave it here in case someone faces the same related issue.

el_noobito
  • 67
  • 6
  • The # sign is used to comment out lines, so you have disabled authorization on your MongoDb server, which may not be what you intended. To enable authorization you need these lines: security: authorization: enabled – Adrian Bhagat Jan 24 '23 at 22:40
0

In my case, this failed:

security:
  authorization: 
    enabled

And this worked fine:

security:
  authorization: enabled
Tedi
  • 426
  • 1
  • 5
  • 15
0

Check if mongod.cfg is corrupted, If you changed this confiuration file recently, try to undo the latest changes to see if this is the cause for the failure

I wonder why a simple error message cannot be printed in such a common failure
Nir
  • 1,618
  • 16
  • 24