show dbs fails

565 views
Skip to first unread message

Philippe DAVID

unread,
Jan 24, 2012, 4:31:05 AM1/24/12
to mongod...@googlegroups.com
Hi,
I'm using mongo 2.0.2 in a replica set environnement.
For some reason, I can't "show dbs" anymore:
mongo
MongoDB shell version: 2.0.2
connecting to: test
PRIMARY> show dbs
Tue Jan 24 10:19:13 decode failed. probably invalid utf-8 string [��1�]
Tue Jan 24 10:19:13 why: TypeError: malformed UTF-8 character
sequence at offset 0
Tue Jan 24 10:19:13 Error: invalid utf8 shell/utils.js:1237

Same thing on a secondary:
mongo
MongoDB shell version: 2.0.2
connecting to: test
shoSECONDARY> show dbs
Tue Jan 24 10:19:56 decode failed. probably invalid utf-8 string [�]
Tue Jan 24 10:19:56 why: TypeError: malformed UTF-8 character
sequence at offset 1
Tue Jan 24 10:19:56 Error: invalid utf8 shell/utils.js:1237

Any idea how I can fix that ? (and eventually how is that possible in
the first place ? )

Thanks,

--
Philippe
Allgoob SA

Nat

unread,
Jan 24, 2012, 5:09:23 AM1/24/12
to mongod...@googlegroups.com
Did you create any db/collections with non-ascii names?
--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com.
To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.

Bill Hayward

unread,
Jan 24, 2012, 8:28:09 AM1/24/12
to mongodb-user
Try running - db.getMongo().getDBs() - from the mongo shell. Let's see
if that provides a list so that we can determine which is/are the
culprit.

Andy Stanberry

unread,
Jan 24, 2012, 8:43:51 AM1/24/12
to mongod...@googlegroups.com, mongodb-user
This happened to us when mongo was not shutdown cleanly and we weren't using a journal. We had to take the db offline and run a repair.

--
Πίστις, ἐλπίς, ἀγάπη

Philippe DAVID

unread,
Jan 24, 2012, 9:20:16 AM1/24/12
to mongod...@googlegroups.com
Hi,
@Nat
I can't tell for sure that we never created a collection with
non-ascii names since this db is used by several developers. But I
guess the collection creation is protected against the obvious
attempts to do so.

@Bill
Same result unfortunately:

$ mongo


MongoDB shell version: 2.0.2
connecting to: test

PRIMARY> db.getMongo().getDBs()
Tue Jan 24 14:58:53 decode failed. probably invalid utf-8 string [��1�]
Tue Jan 24 14:58:53 why: TypeError: malformed UTF-8 character
sequence at offset 0
Tue Jan 24 14:58:53 Error: invalid utf8 shell/utils.js:925

$ mongo


MongoDB shell version: 2.0.2
connecting to: test

SECONDARY> db.getMongo().getDBs()
Tue Jan 24 14:58:55 decode failed. probably invalid utf-8 string [�]
Tue Jan 24 14:58:55 why: TypeError: malformed UTF-8 character
sequence at offset 1
Tue Jan 24 14:58:55 Error: invalid utf8 shell/utils.js:925

I might have found something interesting though:
- the problem is present on the (current) pimary
- it's also present on a secondary, but as you can see the malformed
UTF-8 string is not the same.
- we have a second secondary server, and on this one I could issue
both "show dbs" and db.getMongo().getDBs(). The databases in the list
are the ones I expected, nothing more.

@Andy
I am 100% sure this problem appeared with journaling enabled in our case.
My only guess is that we had several network issues in the last few
weeks, and the primary role changed frequently, with rollbacks and so
on. So we might have encountered a race condition in the code.
Unfortunately I cannot tell precisely what happened, when, nor
reproduce it...

Since at least one of the secondary is working, I can try to repair
the one with the error, and see if it fixes the problem. Switch the
primary and repair it too.

Philippe

Philippe DAVID

unread,
Jan 24, 2012, 11:49:23 AM1/24/12
to mongod...@googlegroups.com
Yep, --repair fixed my problem on the secondary...

--
Philippe
Allgoob SA

Reply all
Reply to author
Forward
0 new messages