MongoDB can't start when bulking data - mongodb

I insert 2800000 records into mongo by bulking from pymongo, that the mongo suddenly show to me about this error:
[initandlisten] exception in initAndListen: 16966 _extentManager.init failed: InternalError DataFile::openExisting - mmf.open failed, terminating
I use ubuntu 12.04 32 bit.
and now, I can't to start mongo.
how to solve this issue?

Related

Unable to start mongod with one missing collection wt file

I have a working mongod instance (v3.2.21).
But suddenly it stopped working. When i run mongo command it is throwing me following error:
2019-06-04T13:52:41.725+0000 W NETWORK [thread1] Failed to connect to 127.0.0.1:27017, in(checking socket for error after poll), reason: errno:111 Connection refused
When i checked log its showing:
2019-06-04T13:36:43.388+0000 E STORAGE [initandlisten] WiredTiger (2) [1559655403:388180][8404:0x7fb74e904c80], file:collection-1-1305830686620002691.wt, WT_SESSION.open_cursor: /mnt/volume-fra1-01//collection-1-1305830686620002691.wt: handle-open: open: No such file or directory
2019-06-04T13:36:43.388+0000 E STORAGE [initandlisten] no cursor for uri: table:collection-1-1305830686620002691
2019-06-04T13:36:43.388+0000 F - [initandlisten] Invalid access at address: 0x58
2019-06-04T13:36:43.398+0000 F - [initandlisten] Got signal: 11 (Segmentation fault).
The collection which was earlier there is now missing in data directory
I tried to use --repair but the process gets stop at this collection.
I have looked at various resources but couldn't figure out how to make it working? Is there way so that wiredtiger escape this collection?
MongoD 4.0.3 and newer has better repair facilities as per SERVER-19815.
One thing you can try:
Copy your original dbpath so if the attempt is not successful, you don't clobber your original data
Download the 4.0.3 binaries (or newer, currently the latest is 4.0.10)
mongod --repair using the 4.0.3 binaries to attempt to repair the copied dbpath
If the repair is successful, try to run the 3.2.21 binaries pointing to the repaired dbpath
Please note that this repair attempt is best-effort and there's no guarantee of success. Having an up-to-date backup is still recommended. You might also want to investigate how the dbpath is missing a file to begin with.

Error repairing MongoDB database - Verify failed on uri table

Suddenly my mongodb server has stopped working on my Mac and I just try to start it again It'll throw me an error described here https://jira.mongodb.org/browse/WT-4135.
So run a database repair and I keep getting this error,
2018-06-19T13:18:38.428+0530 I STORAGE [initandlisten] repairDatabase pdg_db
2018-06-19T13:18:38.428+0530 I STORAGE [initandlisten] Repairing collection ipd_db.app_sessions
2018-06-19T13:18:38.428+0530 I STORAGE [initandlisten] Verify failed on uri table:collection-1--4208304830224804148. Running a salvage operation.
2018-06-19T13:18:38.428+0530 F - [initandlisten] Invariant failure rs.get() src/mongo/db/catalog/database_impl.cpp 226
So I can't even start the server. As my understanding if I drop pdg_db this issue will be solved. But how to drop database without running the mongodb server? Is there any other way to do this?
Thanks

Cannot connect with MongoDB

I have problems with connecting with mongo.
me#the_host:~$ mongo
MongoDB shell version v4.0.0
connecting to: mongodb://127.0.0.1:27017
2018-06-28T17:06:37.445+0200 E QUERY [js] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed: SocketException: Error connecting to 127.0.0.1:27017 :: caused by :: Connection refused :
connect#src/mongo/shell/mongo.js:251:13
#(connect):1:6
exception: connect failed
I went to /var/log/mongodb/mongod.log to see:
2018-06-28T17:16:11.763+0200 I COMMAND [initandlisten] Assigning UUID b237b94b-b3a3-4ba1-9c39-c87d6f3555db to collection local.startup_log
2018-06-28T17:16:11.764+0200 F STORAGE [initandlisten] Unable to start up mongod due to missing featureCompatibilityVersion document.
2018-06-28T17:16:11.764+0200 F STORAGE [initandlisten] Please run with --journalOptions 4 to recover the journal. Then run with --repair to restore the document.
2018-06-28T17:16:11.764+0200 F - [initandlisten] Fatal Assertion 40652 at src/mongo/db/repair_database_and_check_version.cpp 555
2018-06-28T17:16:11.764+0200 F - [initandlisten]
I executed mongod --journalOptions 4 and then mongod --repair but the error is still the same.
I have no idea what to do next..
Could anybody, who overcame this before, point me to proper direction?

how to remove mongodb collection if mongod doesn't start cause of broken collection?

I can't start mongod cause of broken collection, mongod.log says:
2018-01-06T09:32:19.089+0000 I INDEX [initandlisten] found 2
index(es) that wasn't finished before shutdown
2018-01-06T09:32:19.089+0000 I - [initandlisten] Fatal assertion
28579 UnsupportedFormat: Unable to find metadata for table:index-5155-
3080678491732636775 Index: {name: _id_, ns: gozazu.phones_10759} -
version too new for this mongod. See
http://dochub.mongodb.org/core/3.4-index-downgrade for detailed
instructions on how to handle this error. at
src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp 241
2018-01-06T09:32:19.089+0000 I - [initandlisten]
***aborting after fassert() failure
Command mongod --repair doesn't help. How can i remove or fix this collection if mongo shell can't connect to mongod?

MongoDB FATAL ERROR: Out of memory trying to allocate internal tcmalloc data

I am running mongodb 3.2 on ubuntu 14.04 server 64 bit. The mongodb server keeps crashing. Whenever I restart the server I see this:
stop: Unknown instance:
mongod start/running, process 25687
Also on running mongo shell after this I get the following error in it:
src/third_party/gperftools-2.2/src/page_heap_allocator.h:74] FATAL ERROR: Out of memory trying to allocate internal tcmalloc data (bytes, object-size) 131072 48
It was not happening before on my system. How Can I correct this error? It keeps happening every 2-3 hour.
Complete MongoDB Log File : Download Here
EDIT1: Added mongodb log file.