[SERVER-13313] mongodump: Reserved characters in NTFS cause problems Created: 21/Mar/14  Updated: 10/Dec/14  Resolved: 25/Mar/14

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

Type: Bug Priority: Major - P3
Reporter: Jason R. Coombs Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: fieldname, ntfs
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates TOOLS-14 Mongodump handling characters in coll... Closed
Backwards Compatibility: Fully Compatible
Operating System: Windows
Participants:

 Description   

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.



 Comments   
Comment by Daniel Pasette (Inactive) [ 25/Mar/14 ]

dupliate: SERVER-3894

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