[SERVER-18558] 2015-05-19T16:06:33.749+0530 listDatabases failed:{ "errmsg" : "exception: _extentManager.init failed: InternalError DataFile::openExisting - mmf.open failed", "code" : 16966, "ok" : 0 } at src/mongo/shell/mongo.js:47 Created: 19/May/15  Updated: 20/May/15  Resolved: 20/May/15

Status: Closed
Project: Core Server
Component/s: Admin
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Pankaj Agrawal [X] Assignee: Sam Kleinman (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

2015-05-19T16:06:33.749+0530 listDatabases failed:

{ "errmsg" : "exception: _extentManager.init failed: InternalError DataFile::openExisting - mmf.open failed", "code" : 16966, "ok" : 0 }

at src/mongo/shell/mongo.js:47


Operating System: ALL
Participants:

 Description   

2015-05-19T16:06:33.749+0530 listDatabases failed:

{ "errmsg" : "exception: _extentManager.init failed: InternalError DataFile::openExisting - mmf.open failed", "code" : 16966, "ok" : 0 }

at src/mongo/shell/mongo.js:47



 Comments   
Comment by Pankaj Agrawal [X] [ 20/May/15 ]

yes, I have delete database from command and now its working fine..

Thanks a lot Kaloian Manassiev for your valuable help.

Comment by Pankaj Agrawal [X] [ 20/May/15 ]

How can i drop databases from command . show dbs not show any database it only giving error in console.
can you please give me command for drop some database.

Comment by Kaloian Manassiev [ 20/May/15 ]

Thank you for providing the log files. Looks like the problem is that you are running a 32-bit instance and the combined size of all data has outgrown the 2GB of virtual memory space available to 32-bit systems:

2015-05-19T17:02:51.409+0530 [initandlisten] ** NOTE: This is a 32 bit MongoDB binary.
2015-05-19T17:02:51.409+0530 [initandlisten] ** 32 bit builds are limited to less than 2GB of data (or less with --journal).
2015-05-19T17:02:51.409+0530 [initandlisten] ** Note that journaling defaults to off for 32 bit and is currently off.
2015-05-19T17:02:51.409+0530 [initandlisten] ** See http://dochub.mongodb.org/core/32bit
.....
2015-05-20T09:43:44.383+0530 [conn2] ERROR: mmap() failed for /var/lib/mongodb/AlohaTest.4 len:268435456 errno:12 Cannot allocate memory
2015-05-20T09:43:44.383+0530 [conn2] ERROR: mmap failed with out of memory. You are using a 32-bit build and probably need to upgrade to 64

You can try running on a 64-bit system or just dropping some databases.

Comment by Pankaj Agrawal [X] [ 20/May/15 ]

2015-05-20T09:43:07.518+0530 [IndexRebuilder] DBException 16966: _extentManager.init failed: InternalError DataFile::openExisting - mmf.open failed
2015-05-20T09:43:07.520+0530 [IndexRebuilder] warning: Index rebuilding did not complete: _extentManager.init failed: InternalError DataFile::openExisting - mmf.open failed
2015-05-20T09:43:24.960+0530 [initandlisten] connection accepted from 127.0.0.1:53779 #1 (1 connection now open)
2015-05-20T09:43:29.640+0530 [conn1] end connection 127.0.0.1:53779 (0 connections now open)
2015-05-20T09:43:35.324+0530 [initandlisten] connection accepted from 127.0.0.1:53780 #2 (1 connection now open)
2015-05-20T09:43:44.383+0530 [conn2] info openExisting file size 16777216 but storageGlobalParams.smallfiles=false: /var/lib/mongodb/AlohaTest.0
2015-05-20T09:43:44.383+0530 [conn2] info openExisting file size 33554432 but storageGlobalParams.smallfiles=false: /var/lib/mongodb/AlohaTest.1
2015-05-20T09:43:44.383+0530 [conn2] ERROR: mmap() failed for /var/lib/mongodb/AlohaTest.4 len:268435456 errno:12 Cannot allocate memory
2015-05-20T09:43:44.383+0530 [conn2] ERROR: mmap failed with out of memory. You are using a 32-bit build and probably need to upgrade to 64
2015-05-20T09:43:44.383+0530 [conn2] Assertion: 16966:_extentManager.init failed: InternalError DataFile::openExisting - mmf.open failed
2015-05-20T09:43:44.399+0530 [conn2] 0x8e2eead 0x8dc9c16 0x8dac230 0x8dac7f6 0x84aa83e 0x84ae5a1 0x84bab51 0x84e2363 0x84e25a0 0x84e2a4b 0x862c8d7 0x861ccf3 0x861e196 0x8620579 0x896e267 0x879f797 0x87a10d0 0x8351957 0x8ddf9a1 0xb75bad78
/usr/bin/mongod(_ZN5mongo15printStackTraceERSo+0x2d) [0x8e2eead]
/usr/bin/mongod(_ZN5mongo10logContextEPKc+0x166) [0x8dc9c16]
/usr/bin/mongod(_ZN5mongo11msgassertedEiPKc+0x110) [0x8dac230]
/usr/bin/mongod() [0x8dac7f6]
/usr/bin/mongod(_ZN5mongo8Database12openAllFilesEv+0x10e) [0x84aa83e]
/usr/bin/mongod(_ZN5mongo8DatabaseC1EPKcRbRKSs+0x571) [0x84ae5a1]
/usr/bin/mongod(_ZN5mongo14DatabaseHolder11getOrCreateERKSsS2_Rb+0x4e1) [0x84bab51]
/usr/bin/mongod(_ZN5mongo6Client7Context11_finishInitEv+0x53) [0x84e2363]
/usr/bin/mongod(_ZN5mongo6Client7ContextC1ERKSsS3_b+0x80) [0x84e25a0]
/usr/bin/mongod(ZN5mongo6Client11ReadContextC1ERKSsS3+0x19b) [0x84e2a4b]
/usr/bin/mongod(_ZN5mongo16CmdListDatabases3runERKSsRNS_7BSONObjEiRSsRNS_14BSONObjBuilderEb+0x2b7) [0x862c8d7]
/usr/bin/mongod(_ZN5mongo12_execCommandEPNS_7CommandERKSsRNS_7BSONObjEiRSsRNS_14BSONObjBuilderEb+0x53) [0x861ccf3]
/usr/bin/mongod(_ZN5mongo7Command11execCommandEPS0_RNS_6ClientEiPKcRNS_7BSONObjERNS_14BSONObjBuilderEb+0x1046) [0x861e196]
/usr/bin/mongod(_ZN5mongo12_runCommandsEPKcRNS_7BSONObjERNS_11_BufBuilderINS_16TrivialAllocatorEEERNS_14BSONObjBuilderEbi+0x6b9) [0x8620579]
/usr/bin/mongod(ZN5mongo11newRunQueryERNS_7MessageERNS_12QueryMessageERNS_5CurOpES1+0x2557) [0x896e267]
/usr/bin/mongod() [0x879f797]
/usr/bin/mongod(_ZN5mongo16assembleResponseERNS_7MessageERNS_10DbResponseERKNS_11HostAndPortE+0x620) [0x87a10d0]
/usr/bin/mongod(_ZN5mongo16MyMessageHandler7processERNS_7MessageEPNS_21AbstractMessagingPortEPNS_9LastErrorE+0x87) [0x8351957]
/usr/bin/mongod(_ZN5mongo17PortMessageServer17handleIncomingMsgEPv+0x541) [0x8ddf9a1]
/lib/i386-linux-gnu/libpthread.so.0(+0x6d78) [0xb75bad78]
2015-05-20T09:43:44.399+0530 [conn2] warning database /var/lib/mongodb AlohaTest could not be opened
2015-05-20T09:43:44.399+0530 [conn2] DBException 16966: _extentManager.init failed: InternalError DataFile::openExisting - mmf.open failed
2015-05-20T09:44:06.526+0530 [clientcursormon] mem (MB) res:252 virt:2468
2015-05-20T09:44:06.527+0530 [clientcursormon] mapped (incl journal view):2304
2015-05-20T09:44:06.527+0530 [clientcursormon] connections:1

Comment by Pankaj Agrawal [X] [ 20/May/15 ]

From mongodb log file -

2015-05-19T17:02:51.409+0530 [initandlisten]
2015-05-19T17:02:51.409+0530 [initandlisten] ** NOTE: This is a 32 bit MongoDB binary.
2015-05-19T17:02:51.409+0530 [initandlisten] ** 32 bit builds are limited to less than 2GB of data (or less with --journal).
2015-05-19T17:02:51.409+0530 [initandlisten] ** Note that journaling defaults to off for 32 bit and is currently off.
2015-05-19T17:02:51.409+0530 [initandlisten] ** See http://dochub.mongodb.org/core/32bit
2015-05-19T17:02:51.410+0530 [initandlisten]
2015-05-19T17:02:51.410+0530 [initandlisten] db version v2.6.4
2015-05-19T17:02:51.410+0530 [initandlisten] git version: 3a830be0eb92d772aa855ebb711ac91d658ee910
2015-05-19T17:02:51.410+0530 [initandlisten] build info: Linux ip-10-71-131-187 2.6.18-194.32.1.el5xen #1 SMP Mon Dec 20 11:08:09 EST 2010 i686 BOOST_LIB_VERSION=1_49
2015-05-19T17:02:51.410+0530 [initandlisten] allocator: system
2015-05-19T17:02:51.410+0530 [initandlisten] options: { config: "/etc/mongod.conf", net:

{ bindIp: "127.0.0.1" }

, storage:

{ dbPath: "/var/lib/mongodb" }

, systemLog:

{ destination: "file", logAppend: true, path: "/var/log/mongodb/mongod.log" }

}
2015-05-19T17:02:51.453+0530 [initandlisten] exception in initAndListen: 13597 can't start without --journal enabled when journal/ files are present, terminating
2015-05-19T17:02:51.453+0530 [initandlisten] dbexit:
2015-05-19T17:02:51.453+0530 [initandlisten] shutdown: going to close listening sockets...
2015-05-19T17:02:51.453+0530 [initandlisten] shutdown: going to flush diaglog...
2015-05-19T17:02:51.453+0530 [initandlisten] shutdown: going to close sockets...
2015-05-19T17:02:51.453+0530 [initandlisten] shutdown: waiting for fs preallocator...
2015-05-19T17:02:51.453+0530 [initandlisten] shutdown: closing all files...
2015-05-19T17:02:51.454+0530 [initandlisten] closeAllFiles() finished
2015-05-19T17:02:51.454+0530 [initandlisten] shutdown: removing fs lock...
2015-05-19T17:02:51.454+0530 [initandlisten] dbexit: really exiting now

Comment by Pankaj Agrawal [X] [ 20/May/15 ]

MongoDB shell version: 2.6.4
connecting to: test
Server has startup warnings:
2015-05-20T09:43:02.469+0530 [initandlisten]
2015-05-20T09:43:02.469+0530 [initandlisten] ** NOTE: This is a 32 bit MongoDB binary.
2015-05-20T09:43:02.469+0530 [initandlisten] ** 32 bit builds are limited to less than 2GB of data (or less with --journal).
2015-05-20T09:43:02.469+0530 [initandlisten] ** See http://dochub.mongodb.org/core/32bit
2015-05-20T09:43:02.469+0530 [initandlisten]
> shod dbs
2015-05-20T09:43:39.015+0530 SyntaxError: Unexpected identifier
> show dbs
2015-05-20T09:43:44.414+0530 listDatabases failed:

{ "errmsg" : "exception: _extentManager.init failed: InternalError DataFile::openExisting - mmf.open failed", "code" : 16966, "ok" : 0 }

at src/mongo/shell/mongo.js:47
>

Please see the error above . I am getting in console

Comment by Kaloian Manassiev [ 19/May/15 ]

Hi Pankaj,

I presume based on the message that you are getting that this is from a 3.0 server.

What this error means is that in the data directory there is a corrupted/partial database file, which MongoDB is unable to open. The log file should contain the reason the file could not be opened. Would you be able to compress and attach it?

-Kal.

Comment by Pankaj Agrawal [X] [ 19/May/15 ]

can you please tell me how to resolve this issue on linux.

2015-05-19T16:06:33.749+0530 listDatabases failed:

{ "errmsg" : "exception: _extentManager.init failed: InternalError DataFile::openExisting - mmf.open failed", "code" : 16966, "ok" : 0 }

at src/mongo/shell/mongo.js:47

Generated at Thu Feb 08 03:48:04 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.