Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-13313

mongodump: Reserved characters in NTFS cause problems

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Tools
    • Fully Compatible
    • Windows

      The colon character is reserved in NTFS and cannot be used in a filename. MongoDB encounters irregular and strange errors in various situations involving colons in collection names, which allow colons.

      We recently had a dump of a database with collection names like "500:backfill:2047". That dump won't copy to a Windows volume.

      Attempting to dump a database with collections containing a single colon will create corrupted dumps with the colon indicating an alternate data stream:

      C:\Users\jaraco\projects\public\keyring [default tip]> mongo
      MongoDB shell version: 2.4.9
      connecting to: test
      > db.getCollection("bar:baz").insert({"a": 1})
      >
      bye
      C:\Users\jaraco\projects\public\keyring [default tip]> mongodump -d test
      connected to: 127.0.0.1
      Fri Mar 21 11:52:38.245 DATABASE: test   to     dump\test
      Fri Mar 21 11:52:38.247         test.system.indexes to dump\test\system.indexes.bson
      Fri Mar 21 11:52:38.250                  3 objects
      Fri Mar 21 11:52:38.252         test.tabs to dump\test\tabs.bson
      Fri Mar 21 11:52:38.265                  1 objects
      Fri Mar 21 11:52:38.267         Metadata for test.tabs to dump\test\tabs.metadata.json
      Fri Mar 21 11:52:38.270         test.bar:baz to dump\test\bar:baz.bson
      Fri Mar 21 11:52:38.273                  1 objects
      Fri Mar 21 11:52:38.275         Metadata for test.bar:baz to dump\test\bar:baz.metadata.json
      C:\Users\jaraco\projects\public\keyring [default ?4 tip]> dir dump\test
      
      
          Directory: C:\Users\jaraco\projects\public\keyring\dump\test
      
      
      Mode                LastWriteTime     Length Name
      ----                -------------     ------ ----
      -a---       21-Mar-2014     11:52          0 bar
      -a---       21-Mar-2014     11:52        237 system.indexes.bson
      -a---       21-Mar-2014     11:52        158 tabs.bson
      -a---       21-Mar-2014     11:52        200 tabs.metadata.json
      
      

      Add another colon to the collection name will cause mongodump to crash.

      C:\Users\jaraco\projects\public\keyring [default tip]> mongo
      MongoDB shell version: 2.4.9
      connecting to: test
      > db.getCollection("bar:baz:bing").insert({"b": 2})
      >
      bye
      C:\Users\jaraco\projects\public\keyring [default tip]> mongodump -d test
      connected to: 127.0.0.1
      Fri Mar 21 16:11:17.549 DATABASE: test   to     dump\test
      Fri Mar 21 16:11:17.550         test.system.indexes to dump\test\system.indexes.bson
      Fri Mar 21 16:11:17.551                  4 objects
      Fri Mar 21 16:11:17.553         test.tabs to dump\test\tabs.bson
      Fri Mar 21 16:11:17.553                  1 objects
      Fri Mar 21 16:11:17.555         Metadata for test.tabs to dump\test\tabs.metadata.json
      Fri Mar 21 16:11:17.558         test.bar:baz to dump\test\bar:baz.bson
      Fri Mar 21 16:11:17.559                  1 objects
      Fri Mar 21 16:11:17.561         Metadata for test.bar:baz to dump\test\bar:baz.metadata.json
      Fri Mar 21 16:11:17.563         test.bar:baz:bing to dump\test\bar:baz:bing.bson
      <-- crash happens here
      

      Mongodump should dump to a file format that's compatible with Windows.

            Assignee:
            Unassigned Unassigned
            Reporter:
            jason.coombs@yougov.com Jason R. Coombs
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: