[SERVER-2973] Namespace length past 79 characters results in an assertion error in mongodb 1.8 and prevents dumping of data using mongodump Created: 21/Apr/11  Updated: 12/Jul/16  Resolved: 17/Aug/11

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: 1.8.0, 1.8.1
Fix Version/s: 1.9.1

Type: Bug Priority: Blocker - P1
Reporter: sam winterton Assignee: Spencer Brody (Inactive)
Resolution: Done Votes: 5
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

OSX 1.6.7 64bit untested under other OS's;


Issue Links:
Depends
Operating System: ALL
Participants:

 Description   

Commands to Reproduce

[1] mongo commands with failure
$ mongo
$ use customername_productname_environment
$ db.a_collection_that_should_have_a_shorter_name.insert(

{name: 'Wintesa'}

)

  1. New Shell
    $ mongodump -d customername_productname_environment

[2] mongodump commands, mongodump demonstrating workaround
$ mongo
$ use customername_productname_environment
$ db.a_collection_that_should_have_a_shorter_name.renameCollection("a_collection_that_should_have_a_shor")

  1. New Shell
    $ mongodump -d customername_productname_environment

Logs

mongod (-vvvvv) - Run Mongo Commands [1]

Thu Apr 21 10:29:52 [conn12] query: customername_productname_environment.system.indexes{ query: {}, $snapshot: true }
Thu Apr 21 10:29:52 [conn12] used cursor: 0x100b26850
Thu Apr 21 10:29:52 [conn12] query customername_productname_environment.system.indexes reslen:172 nreturned:1 0ms
Thu Apr 21 10:29:52 [conn12] query: customername_productname_environment.$cmd{ count: "a_collection_that_should_have_a_shorter_name.$id", query: {} }
Thu Apr 21 10:29:52 [conn12] run command customername_productname_environment.$cmd { count: "a_collection_that_should_have_a_shorter_name.$id", query: {} }
Thu Apr 21 10:29:52 [conn12] query customername_productname_environment.$cmd ntoreturn:1 command: { count: "a_collection_that_should_have_a_shorter_name.$id", query: {} } reslen:64 0ms
Thu Apr 21 10:29:52 [conn12] query: customername_productname_environment.a_collection_that_should_have_a_shorter_name.$id{ query: {}, $snapshot: true }
Thu Apr 21 10:29:52 [conn12] warning: no id index on $snapshot query, ns:customername_productname_environment.a_collection_that_should_have_a_shorter_name.$_id
Thu Apr 21 10:29:52 [conn12] Assertion: 10334:Invalid BSONObj size: -1 (0xFFFFFFFF) first element: EOO
0x10008de9b 0x10000d3f3 0x1002f1788 0x10019c65b 0x1002f9476 0x100300cc8 0x100307964 0x100309ab1 0x10030a99a 0x100182c78 0x1002b9e89 0x1002c3f18 0x100433888 0x100446d74 0x7fff811894f6 0x7fff811893a9
0 mongod 0x000000010008de9b _ZN5mongo11msgassertedEiPKc + 315
1 mongod 0x000000010000d3f3 _ZNK5mongo7BSONObj14_assertInvalidEv + 1059
2 mongod 0x00000001002f1788 _ZN5mongo11BasicCursor7currentEv + 104
3 mongod 0x000000010019c65b _ZN5mongo11UserQueryOp4nextEv + 5867
4 mongod 0x00000001002f9476 _ZN5mongo12QueryPlanSet6Runner6nextOpERNS_7QueryOpE + 70
5 mongod 0x0000000100300cc8 _ZN5mongo12QueryPlanSet6Runner3runEv + 1720
6 mongod 0x0000000100307964 _ZN5mongo12QueryPlanSet5runOpERNS_7QueryOpE + 868
7 mongod 0x0000000100309ab1 _ZN5mongo16MultiPlanScanner9runOpOnceERNS_7QueryOpE + 113
8 mongod 0x000000010030a99a _ZN5mongo16MultiPlanScanner5runOpERNS_7QueryOpE + 26
9 mongod 0x0000000100182c78 ZN5mongo8runQueryERNS_7MessageERNS_12QueryMessageERNS_5CurOpES1 + 3976
10 mongod 0x00000001002b9e89 _ZN5mongo13receivedQueryERNS_6ClientERNS_10DbResponseERNS_7MessageE + 569
11 mongod 0x00000001002c3f18 _ZN5mongo16assembleResponseERNS_7MessageERNS_10DbResponseERKNS_8SockAddrE + 1528
12 mongod 0x0000000100433888 _ZN5mongo10connThreadEPNS_13MessagingPortE + 616
13 mongod 0x0000000100446d74 thread_proxy + 132
14 libSystem.B.dylib 0x00007fff811894f6 _pthread_start + 331
15 libSystem.B.dylib 0x00007fff811893a9 thread_start + 13
Thu Apr 21 10:29:52 [conn12] assertion 10334 Invalid BSONObj size: -1 (0xFFFFFFFF) first element: EOO ns:customername_productname_environment.a_collection_that_should_have_a_shorter_name.$id query:{ query: {}, $snapshot: true }
Thu Apr 21 10:29:52 [conn12] query customername_productname_environment.a_collection_that_should_have_a_shorter_name.$id exception 1ms
Thu Apr 21 10:29:52 [conn12] MessagingPort recv() conn closed? 127.0.0.1:50588
Thu Apr 21 10:29:52 [conn12] SocketException: remote: error: 9001 socket exception [0]
Thu Apr 21 10:29:52 [conn12] end connection 127.0.0.1:50588

mongod (-vvvvv) - Rename Collection and run mongodump [2]

Thu Apr 21 10:30:32 [initandlisten] connection accepted from 127.0.0.1:50590 #14
Thu Apr 21 10:30:32 [conn14] query: admin.$cmd

{ whatsmyuri: 1 }

Thu Apr 21 10:30:32 [conn14] run command admin.$cmd

{ whatsmyuri: 1 }

Thu Apr 21 10:30:32 [conn14] query admin.$cmd ntoreturn:1 command:

{ whatsmyuri: 1 }

reslen:78 0ms
Thu Apr 21 10:30:32 [conn14] query: admin.$cmd

{ replSetGetStatus: 1, forShell: 1 }

Thu Apr 21 10:30:32 [conn14] run command admin.$cmd

{ replSetGetStatus: 1, forShell: 1 }

Thu Apr 21 10:30:32 [conn14] command:

{ replSetGetStatus: 1, forShell: 1 }

Thu Apr 21 10:30:32 [conn14] query admin.$cmd ntoreturn:1 command:

{ replSetGetStatus: 1, forShell: 1 }

reslen:92 0ms
Thu Apr 21 10:30:38 [conn14] query: admin.$cmd

{ replSetGetStatus: 1, forShell: 1 }

Thu Apr 21 10:30:38 [conn14] run command admin.$cmd

{ replSetGetStatus: 1, forShell: 1 }

Thu Apr 21 10:30:38 [conn14] command:

{ replSetGetStatus: 1, forShell: 1 }

Thu Apr 21 10:30:38 [conn14] query admin.$cmd ntoreturn:1 command:

{ replSetGetStatus: 1, forShell: 1 }

reslen:92 0ms
Thu Apr 21 10:30:48 [conn14] query: customername_productname_environment.system.namespaces{}
Thu Apr 21 10:30:48 [conn14] used cursor: 0x100e06950
Thu Apr 21 10:30:48 [conn14] query customername_productname_environment.system.namespaces reslen:303 nreturned:3 0ms
Thu Apr 21 10:30:48 [conn14] query: customername_productname_environment.system.namespaces{}
Thu Apr 21 10:30:48 [conn14] used cursor: 0x100c0b030
Thu Apr 21 10:30:48 [conn14] query customername_productname_environment.system.namespaces reslen:303 nreturned:3 0ms
Thu Apr 21 10:30:49 [conn14] query: customername_productname_environment.system.namespaces{}
Thu Apr 21 10:30:49 [conn14] used cursor: 0x100c0b9f0
Thu Apr 21 10:30:49 [conn14] query customername_productname_environment.system.namespaces reslen:303 nreturned:3 0ms
Thu Apr 21 10:30:50 [conn14] query: customername_productname_environment.system.namespaces{}
Thu Apr 21 10:30:50 [conn14] used cursor: 0x100c0ae80
Thu Apr 21 10:30:50 [conn14] query customername_productname_environment.system.namespaces reslen:303 nreturned:3 0ms
Thu Apr 21 10:31:10 [conn14] query: admin.$cmd

{ renameCollection: "customername_productname_environment.a_collection_that_should_have_a_s...", to: "customername_productname_environment.a_collection_that_should_have_a_shor", dropTarget: undefined }

Thu Apr 21 10:31:10 [conn14] run command admin.$cmd

{ renameCollection: "customername_productname_environment.a_collection_that_should_have_a_s...", to: "customername_productname_environment.a_collection_that_should_have_a_shor", dropTarget: undefined }

Thu Apr 21 10:31:10 [conn14] command:

{ renameCollection: "customername_productname_environment.a_collection_that_should_have_a_s...", to: "customername_productname_environment.a_collection_that_should_have_a_shor", dropTarget: undefined }

Thu Apr 21 10:31:10 [conn14] New namespace: customername_productname_environment.a_collection_that_should_have_a_shor
New namespace: customername_productname_environment.a_collection_that_should_have_a_shor.$id
query admin.$cmd ntoreturn:1 command:

{ renameCollection: "customername_productname_environment.a_collection_that_should_have_a_s...", to: "customername_productname_environment.a_collection_that_should_have_a_shor", dropTarget: undefined }

reslen:53 1ms
Thu Apr 21 10:31:10 [conn14] query: admin.$cmd

{ replSetGetStatus: 1, forShell: 1 }

Thu Apr 21 10:31:10 [conn14] run command admin.$cmd

{ replSetGetStatus: 1, forShell: 1 }

Thu Apr 21 10:31:10 [conn14] command:

{ replSetGetStatus: 1, forShell: 1 }

Thu Apr 21 10:31:10 [conn14] query admin.$cmd ntoreturn:1 command:

{ replSetGetStatus: 1, forShell: 1 }

reslen:92 0ms
Thu Apr 21 10:31:14 [initandlisten] connection accepted from 127.0.0.1:50594 #15
Thu Apr 21 10:31:14 [conn15] query: admin.$cmd

{ isdbgrid: 1 }

Thu Apr 21 10:31:14 [conn15] run command admin.$cmd

{ isdbgrid: 1 }

Thu Apr 21 10:31:14 [conn15] query admin.$cmd ntoreturn:1 command:

{ isdbgrid: 1 }

reslen:115 0ms
Thu Apr 21 10:31:14 [conn15] query: customername_productname_environment.system.namespaces{}
Thu Apr 21 10:31:14 [conn15] used cursor: 0x100b15640
Thu Apr 21 10:31:14 [conn15] query customername_productname_environment.system.namespaces reslen:287 nreturned:3 0ms
Thu Apr 21 10:31:14 [conn15] query: customername_productname_environment.$cmd{ count: "system.indexes", query: {} }
Thu Apr 21 10:31:14 [conn15] run command customername_productname_environment.$cmd { count: "system.indexes", query: {} }
Thu Apr 21 10:31:14 [conn15] query customername_productname_environment.$cmd ntoreturn:1 command: { count: "system.indexes", query: {} } reslen:64 0ms
Thu Apr 21 10:31:14 [conn15] query: admin.$cmd

{ availablequeryoptions: 1 }

Thu Apr 21 10:31:14 [conn15] run command admin.$cmd

{ availablequeryoptions: 1 }

Thu Apr 21 10:31:14 [conn15] query admin.$cmd ntoreturn:1 command:

{ availablequeryoptions: 1 }

reslen:66 0ms
Thu Apr 21 10:31:14 [conn15] query: customername_productname_environment.system.indexes{ query: {}, $snapshot: true }
Thu Apr 21 10:31:14 [conn15] used cursor: 0x100b39c30
Thu Apr 21 10:31:14 [conn15] query customername_productname_environment.system.indexes reslen:164 nreturned:1 0ms
Thu Apr 21 10:31:14 [conn15] query: customername_productname_environment.$cmd{ count: "a_collection_that_should_have_a_shor", query: {} }
Thu Apr 21 10:31:14 [conn15] run command customername_productname_environment.$cmd { count: "a_collection_that_should_have_a_shor", query: {} }
Thu Apr 21 10:31:14 [conn15] query customername_productname_environment.$cmd ntoreturn:1 command: { count: "a_collection_that_should_have_a_shor", query: {} } reslen:64 0ms
Thu Apr 21 10:31:14 [conn15] query: customername_productname_environment.a_collection_that_should_have_a_shor{ query: {}, $snapshot: true }
Thu Apr 21 10:31:14 [conn15] used cursor: 0x100e12ae0
Thu Apr 21 10:31:14 [conn15] query customername_productname_environment.a_collection_that_should_have_a_shor reslen:76 nreturned:1 0ms
Thu Apr 21 10:31:14 [conn15] MessagingPort recv() conn closed? 127.0.0.1:50594
Thu Apr 21 10:31:14 [conn15] SocketException: remote: error: 9001 socket exception [0]
Thu Apr 21 10:31:14 [conn15] end connection 127.0.0.1:50594
Thu Apr 21 10:31:15 [DataFileSync] flushing mmap took 60ms for 13 files

mongodump

Fails:
Mac-i5:Desktop peter$ mongodump -d customername_productname_environment
connected to: 127.0.0.1
DATABASE: customername_productname_environment to dump/customername_productname_environment
customername_productname_environment.a_collection_that_should_have_a_shorter_name to dump/customername_productname_environment/a_collection_that_should_have_a_shorter_name.bson
1 objects
customername_productname_environment.system.indexes to dump/customername_productname_environment/system.indexes.bson
1 objects
customername_productname_environment.a_collection_that_should_have_a_shorter_name.$id to dump/customername_productname_environment/a_collection_that_should_have_a_shorter_name.$id.bson
assertion: 13106 nextSafe():

{ $err: "Invalid BSONObj size: -1 (0xFFFFFFFF) first element: EOO", code: 10334 }

Works:
Mac-i5:Desktop peter$ mongodump -d customername_productname_environment
connected to: 127.0.0.1
DATABASE: customername_productname_environment to dump/customername_productname_environment
customername_productname_environment.system.indexes to dump/customername_productname_environment/system.indexes.bson
1 objects
customername_productname_environment.a_collection_that_should_have_a_shor to dump/customername_productname_environment/a_collection_that_should_have_a_shor.bson
1 objects



 Comments   
Comment by Spencer Brody (Inactive) [ 17/Aug/11 ]

There were no backwards-breaking changes to mongodump in 1.9.1, so it should be fine to use a 1.9.1 mongodump with a 1.8 mongod.

Comment by Ralf Kistner [ 17/Aug/11 ]

I can also confirm that the issue is with mongodump, not mongod. It works with mongodump from 1.9.1 and mongod from 1.8.x, but not with mongodump from 1.8.x and mongod from 1.9.1.

Is it generally safe to use mongodump (or other utilities such as mongoexport) with a server of a different version?

Comment by Eliot Horowitz (Inactive) [ 17/Aug/11 ]

It will be in 2.0 when it comes out

Comment by Ralf Kistner [ 17/Aug/11 ]

I'm getting the same issue (tested on Ubuntu 11.04 64bit), MongoDB 1.8.1. It seems to be fixed in 1.9.1. Any idea when this will be fixed in a stable release? This is a major issue for me, as I use mongodump for backups, and have some long collection names.

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