[SERVER-3898] Unknown DB Created: 19/Sep/11  Updated: 29/Feb/12  Resolved: 21/Oct/11

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

Type: Question Priority: Major - P3
Reporter: L.Ankhbayar Assignee: Aaron Staple
Resolution: Duplicate Votes: 0
Labels: DB, Name
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

MongoDB
Ubuntu 11.04


Issue Links:
Duplicate
duplicates SERVER-4113 shell should validate database name p... Closed
Participants:

 Description   

What is * db. !!!!.

$ mongo *
MongoDB shell version: 2.0.0
connecting to: *
> show collections
> db.stats()
{
"db" : "*",
"collections" : 0,
"objects" : 0,
"avgObjSize" : 0,
"dataSize" : 0,
"storageSize" : 0,
"numExtents" : 0,
"indexes" : 0,
"indexSize" : 0,
"fileSize" : 0,
"nsSizeMB" : 0,
"ok" : 1
}
> show dbs

  • (empty)
    admin 0.203125GB
    .....
    >


 Comments   
Comment by Aaron Staple [ 21/Oct/11 ]

Just wanted to summarize what may have happened above:

1) mongo * (or similar command) created a db named '*'.
2) The *.0, *.ns, etc files were deleted but mongod was not restarted, causing the * db to be marked as empty but present.
3) The mongod binary was restarted, causing the * database to no longer appear.

If this sequence of events is known to be incorrect, please reopen this ticket.

I filed SERVER-4113 to handle validation of the db name specified via the shell's command line.

Comment by L.Ankhbayar [ 20/Sep/11 ]

I restarted today mongodb.
Now db * not shown. Mongodb running over 1 hour.

mongodb

$ mongo
MongoDB shell version: 2.0.0
connecting to: test
> show dbs
admin	0.203125GB
........
> use *
... 
... ;
error2:basic_string::substr
> exit
$ mongo \*
MongoDB shell version: 2.0.0
connecting to: *
> show dbs
admin	0.203125GB
......
>
 

Comment by L.Ankhbayar [ 19/Sep/11 ]

No. I am upgrade to Mongodb2.0.

Mongodb running over 5 days.

2 days ago drop this * db.
But this re created.

silently running any Injection code!

Comment by Scott Hernandez (Inactive) [ 19/Sep/11 ]

Have you restarted your mongodb server since this problem started? Can you update load the logs from when you did that?

Comment by L.Ankhbayar [ 19/Sep/11 ]

This is my production server. Some information should hide.
Now shown any * file.

ls -lah /to/mongo/db/path

drwxr-xr-x 5 mongodb mongodb 4.0K 2011-09-18 13:01 .
drwxr-xr-x 5 root    root    4.0K 2011-04-30 18:20 ..
-rw------- 1 mongodb nogroup  64M 2011-08-03 18:17 admin.0
-rw------- 1 mongodb nogroup 128M 2011-08-16 12:03 admin.1
...........
drwxr-xr-x 2 mongodb nogroup 4.0K 2011-09-16 21:36 journal
-rw------- 1 mongodb nogroup  64M 2011-08-03 17:34 local.0
-rw------- 1 mongodb nogroup 128M 2011-08-16 12:03 local.1
-rw------- 1 mongodb nogroup  16M 2011-08-03 17:34 local.ns
...........
drwxr-xr-x 2 mongodb nogroup 4.0K 2011-09-14 15:40 xxxxxxx_db
...........
drwxr-xr-x 2 mongodb nogroup 4.0K 2011-09-18 13:01 _tmp
...........

Comment by Scott Hernandez (Inactive) [ 19/Sep/11 ]

It looks like you passed in a character with mongo <db-name> which is not valid but not checked. What does ls -lah show in your dbpath directory?

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