[SERVER-4413] Mongodump segfaults on certain collection names Created: 02/Dec/11 Updated: 06/Apr/23 Resolved: 09/Dec/11 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Tools |
| Affects Version/s: | 2.0.1 |
| Fix Version/s: | 2.1.0 |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Aristarkh Zagorodnikov | Assignee: | Kevin Matulef |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||
| Operating System: | ALL | ||||||||||||||||||||
| Participants: | |||||||||||||||||||||
| Description |
|
We (by accident) have a collection named "'>./././". Mongodump fails to dump it, segfaulting in the process: |
| Comments |
| Comment by Jared D. Cottrell [ 28/Jun/12 ] | |||||||
|
Yes, confirmed that the mongodump 2.1.2 behavior is:
Would really prefer an error on the front end telling the user that slashes (and nulls, I guess) really aren't allowed in collection names. But this can probably get us by. | |||||||
| Comment by Kevin Matulef [ 27/Jun/12 ] | |||||||
|
@Jared yeah, I realize it's unclear from the comments above. That option was discussed back in Dec, but at that time we decided not to change any existing behavior in terms of what's allowed/disallowed. We might reconsider if lots of users are hitting a wall. | |||||||
| Comment by Jared D. Cottrell [ 27/Jun/12 ] | |||||||
|
Ah, sorry. I thought that based on the comments the fix was going to be to disallow the creation of collections with those characters in the first place. Testing now with 2.1.2 mongodump. | |||||||
| Comment by Kevin Matulef [ 27/Jun/12 ] | |||||||
|
Hi Jared, can you verify that you are using the newer version of mongodump as well? (see comment in CS-3680) | |||||||
| Comment by Jared D. Cottrell [ 27/Jun/12 ] | |||||||
|
I have verified that this issue still exists in MongoDB for Linux 2.1.2 64-bit. I created a collection called "foo/" and attempted to mongodump the server on which it was being hosted.
| |||||||
| Comment by Kevin Matulef [ 29/May/12 ] | |||||||
|
I'm not sure that using a placeholder character like "_" is the best solution, since this can cause name collisions if a user has one collection named "a/b" and another named "a_b" (the same is true of any other fixed placeholder char). It seems better to me to allow the user to resolve the issue by renaming their collection. Another possibility is to prohibit "/" from appearing in collection names at all. This is related to | |||||||
| Comment by Benjamin Flesch [ 26/May/12 ] | |||||||
|
+1, This issue is still alive. This has to do with filename restrictions on most operating systems, as the "/" char is not allowed when creating a new file. A fix should be easy as in replacing all occurences of "/" with a placeholder character of your choice, for example "_". | |||||||
| Comment by Kevin Matulef [ 09/Dec/11 ] | |||||||
|
The problem occurs because mongodump tries to create a file with the collection name in the filename. This breaks with collections with '/' in their name. I've modified the behavior of mongodump to log an error when this happens, and dump all other collections gracefully. For the time being, if you want to dump a collection with a '/' in the name, you will need to rename it as above. Fixed by this commit (and few subsequent ones): | |||||||
| Comment by Kevin Matulef [ 05/Dec/11 ] | |||||||
|
Looking at this issue. In the meantime, a workaround is just to rename the collection: use admin ) |