[SERVER-4229] mongodump creates a database named * (asterisk) that cannot subsequently be deleted Created: 08/Nov/11  Updated: 25/Aug/12  Resolved: 17/Dec/11

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

Type: Bug Priority: Major - P3
Reporter: Doug Donohoe Assignee: Brandon Diamond
Resolution: Duplicate Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

CentOS 5.5 64bit


Issue Links:
Depends
is depended on by SERVER-4122 Validate database and collection name... Closed
Related
Operating System: Linux
Participants:

 Description   

When I run mongodump --host localhost --out $TMP_TARGET to backup all databases, for some reason mongodump auto-creates a database named * (asterisk).

After this, I can't delete this database because use * doesn't work.



 Comments   
Comment by Ian Whalen (Inactive) [ 26/Jul/12 ]

Chad, you're correct that this fix was made for the 2.1 branch (https://github.com/mongodb/mongo/commit/413a07d12c4a318c7be92af9625b595a95f92942) but not for 2.0.

Comment by Chad Kreimendahl [ 26/Jul/12 ]

This does not appear to be fixed in 2.0.6. mongodump is still creating a database named "*" in 2.0.6

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

SERVER-4122

Comment by Brandon Diamond [ 14/Dec/11 ]

It looks like this bug was fixed by SERVER-4122 which is scheduled for 2.1. I'll see if we can backport that patch.

Comment by Michael D [ 14/Dec/11 ]

The same thing happens on Windows 2008R2 64 bit for 2.0.1 version.

 
M:\mongodb\bin>mongo
MongoDB shell version: 2.0.1
connecting to: test
PRIMARY> show dbs
config  (empty)
local   6.0751953125GB
test    0.078125GB
PRIMARY> exit
bye
 
M:\mongodb\bin>mongodump --oplog
connected to: 127.0.0.1
all dbs
DATABASE: test   to     dump/test
        test.foo to dump/test/foo.bson
                 1 objects
        test.system.indexes to dump/test/system.indexes.bson
                 1 objects
DATABASE: *      to     dump/*
error: boost::filesystem::create_directory: The filename, directory name, or volume label syntax is incorrect: "dump\*"
 
M:\mongodb\bin>mongo *
MongoDB shell version: 2.0.1
connecting to: *
PRIMARY> db.dropDatabase()
{ "dropped" : "*", "ok" : 1 }
PRIMARY> exit
bye

Comment by Brandon Diamond [ 12/Dec/11 ]

Very interesting – I'll investigate. Thanks for the additional information.

Comment by Gleb [ 12/Dec/11 ]

I got this database by running "mongodump --port 29000". Maybe this could be somehow caused by running on non-standart port? DB is created at the very beginning of the dump.

FreeBSD 8.1 (mongodb built by scons not from ports - the one from ports crashes randomly for me)

Comment by Doug Donohoe [ 12/Dec/11 ]

Hi Brandon. TMP_TARGET is set like this:

DAY=`date +%a`
TMP_FILE=mongo-backup.$DAY
TMP=/tmp
TMP_TARGET=$TMP/$TMP_FILE

Thanks for the tip on dropping the database. It is not worth bothering since it will get recreated next time mongodump runs.

Comment by Brandon Diamond [ 12/Dec/11 ]

As an temporary workaround, you should be able run to the following command to remove the database:

db.getSiblingDB("*").dropDatabase()

What is the value of TMP_TARGET when you invoke the mongodump command?

Comment by Doug Donohoe [ 08/Nov/11 ]

Based on the description, I think this may be what caused the issue reported in SERVER-4122.

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