0

Mongodb stops whenever I try to make a connection.

When I run

sudo service mongod start

I get a message that mongodb is running.

But then when I try to make a connection using PyMongo I get an error that says

Autoreconnect: connection closed

I check my mongodb status:

sudo service mongod status

And it says that my mongodb instance is stopped/waiting.

My mongo log file reports the following:

2015-09-17T18:19:46.816+0000 I NETWORK  [initandlisten] waiting for     connections on port 7000
2015-09-17T18:19:58.813+0000 I NETWORK  [initandlisten] connection     accepted from 54.152.111.120:51387 #1 (1 connection now open)
2015-09-17T18:19:58.816+0000 I STORAGE  [conn1] _getOpenFile() invalid file index requested 4
2015-09-17T18:19:58.816+0000 I -        [conn1] Invariant failure false src/mongo/db/storage/mmap_v1/mmap_v1_extent_manager.cpp 201
2015-09-17T18:19:58.837+0000 I CONTROL  [conn1]

This is followed by a lengthy backtrace that I can't decipher, then closes with:

2015-09-17T18:19:58.837+0000 I -        [conn1]

 ***aborting after invariant() failure

I've looked around SO, particularly trying the top two answers here, but haven't been able to figure out how to solve the problem.

I'll also note that last time I tried to connect last week, it was working fine.

Community
  • 1
  • 1
ABM
  • 1,628
  • 2
  • 26
  • 42
  • 1
    Not enough log lines to get a conclution. Usually what you describe points to file system problems (corrupted data files, not enough storage, file access permisions etc) Try to log into mongo shell and do a db.stats() see if it works, and if yes may be you will get more insight of what happens. – nickmilon Sep 17 '15 at 19:57
  • Thanks! When I try to log into a shell, mongo stops, just as if I were trying to make a remote connection. – ABM Sep 17 '15 at 21:06
  • May be change the data directory in mongo config file then restart mongo to check if that works. If yes you can try recovering the data with mongo restore – nickmilon Sep 17 '15 at 21:12

0 Answers0