2011-11-02 53 views
5

我已經使用了mongodb幾天,它一直工作得很好,直到今天。MongoDB - 聲明失敗isOk()db/pdfile.h

查詢數據庫時出錯。

Wed Nov 2 17:56:44 [initandlisten] connection accepted from 127.0.0.1:49234 #1 
Wed Nov 2 17:56:45 [conn1] command admin.$cmd command: { listDatabases: 1 } ntoreturn:1 reslen:338 813ms 
Wed Nov 2 17:56:46 [conn1] admin.system.namespaces Assertion failure isOk() db/pdfile.h 300 
0x10007d703 0x100087eec 0x1004165e4 0x10040774b 0x100410823 0x100437df9 0x1004b3006 0x100426693 0x100426b53 0x100429f45 0x10042d8f0 0x10043109e 0x10043353b 0x10043662a 0x1004a13ca 0x1003d5e0f 0x1003e298a 0x100603394 0x100148d8c 0x10060a554 
0 mongod        0x000000010007d703 _ZN5mongo12sayDbContextEPKc + 195 
1 mongod        0x0000000100087eec _ZN5mongo8assertedEPKcS1_j + 300 
2 mongod        0x00000001004165e4 _ZN5mongo11DataFileMgr9getExtentERKNS_7DiskLocE + 148 
3 mongod        0x000000010040774b _ZN5mongo11DataFileMgr7findAllEPKcRKNS_7DiskLocE + 75 
4 mongod        0x0000000100410823 _ZN5mongo13findTableScanEPKcRKNS_7BSONObjERKNS_7DiskLocE + 131 
5 mongod        0x0000000100437df9 _ZNK5mongo9QueryPlan9newCursorERKNS_7DiskLocEi + 1081 
6 mongod        0x00000001004b3006 _ZN5mongo11UserQueryOp5_initEv + 214 
7 mongod        0x0000000100426693 _ZN5mongo7QueryOp4initEv + 323 
8 mongod        0x0000000100426b53 _ZN5mongo12QueryPlanSet6Runner6initOpERNS_7QueryOpE + 35 
9 mongod        0x0000000100429f45 _ZN5mongo12QueryPlanSet6Runner4initEv + 245 
10 mongod        0x000000010042d8f0 _ZN5mongo12QueryPlanSet6Runner22runUntilFirstCompletesEv + 32 
11 mongod        0x000000010043109e _ZN5mongo12QueryPlanSet5runOpERNS_7QueryOpE + 334 
12 mongod        0x000000010043353b _ZN5mongo16MultiPlanScanner9runOpOnceERNS_7QueryOpE + 1115 
13 mongod        0x000000010043662a _ZN5mongo16MultiPlanScanner5runOpERNS_7QueryOpE + 26 
14 mongod        0x00000001004a13ca _ZN5mongo8runQueryERNS_7MessageERNS_12QueryMessageERNS_5CurOpES1_ + 3194 
15 mongod        0x00000001003d5e0f _ZN5mongo13receivedQueryERNS_6ClientERNS_10DbResponseERNS_7MessageE + 623 
16 mongod        0x00000001003e298a _ZN5mongo16assembleResponseERNS_7MessageERNS_10DbResponseERKNS_11HostAndPortE + 1402 
17 mongod        0x0000000100603394 _ZN5mongo16MyMessageHandler7processERNS_7MessageEPNS_21AbstractMessagingPortEPNS_9LastErrorE + 148 
18 mongod        0x0000000100148d8c _ZN5mongo3pms9threadRunEPNS_13MessagingPortE + 700 
19 mongod        0x000000010060a554 thread_proxy + 132 
Wed Nov 2 17:56:46 [conn1] assertion 0 assertion db/pdfile.h:300 ns:admin.system.namespaces query:{} 
Wed Nov 2 17:56:51 [conn1] end connection 127.0.0.1:49234 

我重新啓動了mongod進程,但沒有任何幫助。

我試圖修復數據庫,但也得到了錯誤。

bin: $ ./mongod --repair --dbpath ../data/db 
Wed Nov 2 18:10:51 [initandlisten] MongoDB starting : pid=678 port=27017 dbpath=../data/db 64-bit host=KTs-MacBook-Pro.local 
Wed Nov 2 18:10:51 [initandlisten] db version v2.0.0, pdfile version 4.5 
Wed Nov 2 18:10:51 [initandlisten] git version: 695c67dff0ffc361b8568a13366f027caa406222 
Wed Nov 2 18:10:51 [initandlisten] build info: Darwin erh2.10gen.cc 9.6.0 Darwin Kernel Version 9.6.0: Mon Nov 24 17:37:00 PST 2008; root:xnu-1228.9.59~1/RELEASE_I386 i386 BOOST_LIB_VERSION=1_40 
Wed Nov 2 18:10:51 [initandlisten] options: { dbpath: "../data/db", repair: true } 
Wed Nov 2 18:10:51 [initandlisten] journal dir=../data/db/journal 
Wed Nov 2 18:10:51 [initandlisten] recover : no journal files present, no recovery needed 
Wed Nov 2 18:10:51 [initandlisten] **** 
Wed Nov 2 18:10:51 [initandlisten] **** 
Wed Nov 2 18:10:51 [initandlisten] need to upgrade database admin with pdfile version 4.5, new version: 4.5 
Wed Nov 2 18:10:51 [initandlisten]  starting upgrade 
Wed Nov 2 18:10:51 [initandlisten] admin repairDatabase admin 
Wed Nov 2 18:10:51 [initandlisten] removeJournalFiles 
Wed Nov 2 18:10:51 [initandlisten] admin.system.namespaces Assertion failure isOk() db/pdfile.h 300 
0x10007d703 0x100087eec 0x1004165e4 0x10040774b 0x100410823 0x100437df9 0x1004b3006 0x100426693 0x100426b53 0x100429f45 0x10042d8f0 0x10043109e 0x10043353b 0x10043662a 0x1004a13ca 0x1003d5e0f 0x1003e298a 0x1003e480f 0x1000ed8ec 0x1000c8b73 
0 mongod        0x000000010007d703 _ZN5mongo12sayDbContextEPKc + 195 
1 mongod        0x0000000100087eec _ZN5mongo8assertedEPKcS1_j + 300 
2 mongod        0x00000001004165e4 _ZN5mongo11DataFileMgr9getExtentERKNS_7DiskLocE + 148 
3 mongod        0x000000010040774b _ZN5mongo11DataFileMgr7findAllEPKcRKNS_7DiskLocE + 75 
4 mongod        0x0000000100410823 _ZN5mongo13findTableScanEPKcRKNS_7BSONObjERKNS_7DiskLocE + 131 
5 mongod        0x0000000100437df9 _ZNK5mongo9QueryPlan9newCursorERKNS_7DiskLocEi + 1081 
6 mongod        0x00000001004b3006 _ZN5mongo11UserQueryOp5_initEv + 214 
7 mongod        0x0000000100426693 _ZN5mongo7QueryOp4initEv + 323 
8 mongod        0x0000000100426b53 _ZN5mongo12QueryPlanSet6Runner6initOpERNS_7QueryOpE + 35 
9 mongod        0x0000000100429f45 _ZN5mongo12QueryPlanSet6Runner4initEv + 245 
10 mongod        0x000000010042d8f0 _ZN5mongo12QueryPlanSet6Runner22runUntilFirstCompletesEv + 32 
11 mongod        0x000000010043109e _ZN5mongo12QueryPlanSet5runOpERNS_7QueryOpE + 334 
12 mongod        0x000000010043353b _ZN5mongo16MultiPlanScanner9runOpOnceERNS_7QueryOpE + 1115 
13 mongod        0x000000010043662a _ZN5mongo16MultiPlanScanner5runOpERNS_7QueryOpE + 26 
14 mongod        0x00000001004a13ca _ZN5mongo8runQueryERNS_7MessageERNS_12QueryMessageERNS_5CurOpES1_ + 3194 
15 mongod        0x00000001003d5e0f _ZN5mongo13receivedQueryERNS_6ClientERNS_10DbResponseERNS_7MessageE + 623 
16 mongod        0x00000001003e298a _ZN5mongo16assembleResponseERNS_7MessageERNS_10DbResponseERKNS_11HostAndPortE + 1402 
17 mongod        0x00000001003e480f _ZN5mongo14DBDirectClient4callERNS_7MessageES2_bPSs + 111 
18 mongod        0x00000001000ed8ec _ZN5mongo14DBClientCursor4initEv + 76 
19 mongod        0x00000001000c8b73 _ZN5mongo12DBClientBase5queryERKSsNS_5QueryEiiPKNS_7BSONObjEii + 739 
Wed Nov 2 18:10:51 [initandlisten] assertion 0 assertion db/pdfile.h:300 ns:admin.system.namespaces query:{} 
Wed Nov 2 18:10:51 [initandlisten] admin clone failed for admin with error: query failed admin.system.namespaces 
Wed Nov 2 18:10:51 [initandlisten] removeJournalFiles 
Wed Nov 2 18:10:51 [initandlisten] admin Assertion failure doDBUpgrade(dbName , errmsg , h) db/db.cpp 298 
0x10007d703 0x100087eec 0x1005f4f2f 0x1005f5c3c 0x1005f6274 0x1005f7d6f 0x1000013c4 
0 mongod        0x000000010007d703 _ZN5mongo12sayDbContextEPKc + 195 
1 mongod        0x0000000100087eec _ZN5mongo8assertedEPKcS1_j + 300 
2 mongod        0x00000001005f4f2f _ZN5mongo30repairDatabasesAndCheckVersionEv + 2063 
3 mongod        0x00000001005f5c3c _ZN5mongo14_initAndListenEi + 1036 
4 mongod        0x00000001005f6274 _ZN5mongo13initAndListenEi + 36 
5 mongod        0x00000001005f7d6f main + 3647 
6 mongod        0x00000001000013c4 start + 52 
Wed Nov 2 18:10:51 [initandlisten] exception in initAndListen: 0 assertion db/db.cpp:298, terminating 
Wed Nov 2 18:10:51 dbexit: 
Wed Nov 2 18:10:51 [initandlisten] shutdown: going to close listening sockets... 
Wed Nov 2 18:10:51 [initandlisten] shutdown: going to flush diaglog... 
Wed Nov 2 18:10:51 [initandlisten] shutdown: going to close sockets... 
Wed Nov 2 18:10:51 [initandlisten] shutdown: waiting for fs preallocator... 
Wed Nov 2 18:10:51 [initandlisten] shutdown: lock for final commit... 
Wed Nov 2 18:10:51 [initandlisten] shutdown: final commit... 
Wed Nov 2 18:10:51 [initandlisten] shutdown: closing all files... 
Wed Nov 2 18:10:51 [initandlisten] closeAllFiles() finished 
Wed Nov 2 18:10:51 [initandlisten] journalCleanup... 
Wed Nov 2 18:10:51 [initandlisten] removeJournalFiles 
Wed Nov 2 18:10:51 [initandlisten] shutdown: removing fs lock... 
Wed Nov 2 18:10:51 dbexit: really exiting now 

MongoDB的版本是V2.0.0,pdfile版本是4.5,Git版本是695c67dff0ffc361b8568a13366f027caa406222。

mongodb中有5個數據庫,但只有一個數據庫出錯。

我也嘗試通過mongodump恢復數據,但得到空的bson文件。

任何想法?由於

+0

我也有同樣的問題 –

+0

ME來!必須是新版本,導致它在升級前都工作得很好 – Harry

回答

0

MongoDB的JIRA票鏈接https://jira.mongodb.org/browse/SERVER-4198

正如票的意見,通過移除主= true設置然後運行修復解決問題。

我還沒有嘗試過這種方法,只是作爲參考。

+3

什麼是master =真實設置? –

+0

沒有幫助我。在'/ etc/mongodb.conf'中有'master = true',但是它已經被註釋掉了(@TomRoggero也解釋了它的作用:> [在複製的mongo數據庫中,在這裏指定這是一個slave還是master 'slave =真' 或 'master = true'] )。 – laggingreflex

1

我能夠將我的數據目錄來解決這個問題(在上面的例子中是

/data/db 

,並刪除所有jicd.x和local.x文件

如果鎖定文件不是0字節大小你可能想刪除那一個以及