[SERVER-5273] Corrupted database list on a Mongo Server. Created: 09/Mar/12  Updated: 15/Aug/12  Resolved: 15/Jun/12

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

Type: Bug Priority: Major - P3
Reporter: Donny Bailey Assignee: Unassigned
Resolution: Incomplete Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

debian squeeze running Mongo 1.8.2


Operating System: Linux
Participants:

 Description   

When I use the command line mongo environment and run show dbs it returns this message.

Fri Mar 09 16:22:14 decode failed. probably invalid utf-8 string [Ç]
Fri Mar 09 16:22:14 why: TypeError: malformed UTF-8 character sequence at o
ffset 0
Fri Mar 09 16:22:14 Error: invalid utf8 shell/utils.js:1108

So I used the web interface to look closer at the data when I did list databases (http://10.1.50.21:15002/listDatabases?text=1) it returns the normal databases correctly, then there are 1462 entries that look like this:

{ "name" : "*", "sizeOnDisk" : 1, "empty" : true }

,

{ "name" : "1", "sizeOnDisk" : 1, "empty" : true }

,

{ "name" : "10", "sizeOnDisk" : 1, "empty" : true }

,

{ "name" : "2", "sizeOnDisk" : 1, "empty" : true }

,

{ "name" : "3", "sizeOnDisk" : 1, "empty" : true }

,

{ "name" : "4", "sizeOnDisk" : 1, "empty" : true }

,

{ "name" : "4images", "sizeOnDisk" : 1, "empty" : true }

,

{ "name" : "5", "sizeOnDisk" : 1, "empty" : true }

,

{ "name" : "6", "sizeOnDisk" : 1, "empty" : true }

,

{ "name" : "7", "sizeOnDisk" : 1, "empty" : true }

,

{ "name" : "8", "sizeOnDisk" : 1, "empty" : true }

,

{ "name" : "9", "sizeOnDisk" : 1, "empty" : true }

,

I don't know if something in our code messed up and created these or if something internal in mongo did it.

When I do a use admin then > db.databases.find(). It returns a list that is only the real databases.

We've got replica sets and sharding. The list appears the same on all shard.

Any Ideas what is going on and how to fix it? This is a production system and is running fine so far, but this definitely worries me.



 Comments   
Comment by Scott Hernandez (Inactive) [ 10/Mar/12 ]

Are you a CS customer? Do you need this escalated via that support contract?

Comment by Scott Hernandez (Inactive) [ 09/Mar/12 ]

It sounds like you might have accidentally created some dbs with chars that javascript can't print/decode.

Also, for the dump you only need to run mongodump -h 10.1.50.21:14001 -d config and it will just dump that db in a dump/config directory with files for each collection.

Comment by Donny Bailey [ 09/Mar/12 ]

All 6 shards return the same error when I run show dbs

Fri Mar 09 18:36:18 decode failed. probably invalid utf-8 string [Ç]
Fri Mar 09 18:36:18 why: TypeError: malformed UTF-8 character sequence at offset 0
Fri Mar 09 18:36:18 Error: invalid utf8 shell/utils.js:1108

I'm dumping the config database now with the following command:
mongodump -h 10.1.50.21:14001 -d config --directoryperdb -out Config.out

I'll forward it when it's complete.

Donny Bailey
Senior Program Developer

OrcaTec LLC
3200 Cobb Galleria Parkway, Suite 200, Atlanta, GA 30339
Tel: 770.650.7706 Ext 337 | Mob: 404.550.7035 | Fax: 678.306.1856
Email: Donny.Bailey@OrcaTec.com

Visualize a New Concept in Document Decisioning

Comment by Scott Hernandez (Inactive) [ 09/Mar/12 ]

Can you dump your config database with mongodump and attach it? Also, please run this on each replica set (shard):

PRIMARY> show dbs

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