# mongo
MongoDB shell version: 1.6.4
Fri Mar 16 11:55:46 *** warning: spider monkey build without utf8 support. consider rebuilding with utf8 support
connecting to: test
Mongo Server seems to handle the utf8 characters fine, as well as my php-mongo-client driver.
But when I try to query a record that has a utf8 character from the mongo command line client I get:
> db.Users.find({age:33});
error:non ascii character detected
Fri Mar 16 11:55:43 mongo got signal 11 (Segmentation fault), stack trace:
Fri Mar 16 11:55:43 0x440b50 0x3664c302d0 0x3f47e7b6e0 0x3f47e83bbd 0x3f47e254f3 0x3f47e25660 0x3f47e256ee 0x3f47e25792 0x3f47e2876e 0x4b031d 0x443b72 0x445476 0x3664c1d994 0x43fd39
mongo(_Z12quitAbruptlyi+0x3b0) [0x440b50]
/lib64/libc.so.6 [0x3664c302d0]
/usr/lib64/libjs.so.1 [0x3f47e7b6e0]
/usr/lib64/libjs.so.1(js_CompileTokenStream+0x3d) [0x3f47e83bbd]
/usr/lib64/libjs.so.1 [0x3f47e254f3]
/usr/lib64/libjs.so.1(JS_CompileUCScriptForPrincipals+0x60) [0x3f47e25660]
/usr/lib64/libjs.so.1(JS_EvaluateUCScriptForPrincipals+0x3e) [0x3f47e256ee]
/usr/lib64/libjs.so.1(JS_EvaluateUCScript+0x22) [0x3f47e25792]
/usr/lib64/libjs.so.1(JS_EvaluateScript+0x6e) [0x3f47e2876e]
mongo(_ZN5mongo7SMScope4execERKSsS2_bbbi+0xed) [0x4b031d]
mongo(_Z5_mainiPPc+0x14a2) [0x443b72]
mongo(main+0x26) [0x445476]
/lib64/libc.so.6(__libc_start_main+0xf4) [0x3664c1d994]
mongo(__gxx_personality_v0+0x269) [0x43fd39]
Any ideas or suggestions would be welcome
The mongo version 1.6.4 was installed by the package management system, which includes the mongo init scripts.
The solution I came up with was to download the newest Mongo(2.0.3) binaries from http://www.mongodb.org/downloads. Then I replaced all the binaries from the rpm
/usr/bin
with the ones I downloaded.Everything now works perfectly!
Just had the same issue. MongoDB shell version: 1.8.2 on Ubuntu (EC2)
Checked which version of MongoDB I was running by issuing the command:
Confirm if mongo is currently running:
To Shutdown MongoDB
Then upgraded following these instructions: How to Install MongoDB on Ubuntu
Add the 10 Gen (creators of MongoDB) public key to apt-get so you trust their package:
Update your packages:
install 10gen's MongoDB Debian/Ubuntu package:
If you get an error, try:
once you have the new version of MongoDB the "non ascii" character issue should be gone.
(p.s. I know this question relates to RHEL but people running other versions of Linux will come up against this issue so I thought a Ubuntu/Debian answer was relevant. Feel free to remove
Take a look at:
http://www.mongodb.org/display/DOCS/Building+Spider+Monkey#BuildingSpiderMonkey-Build
"SpiderMonkey does not use UTF-8 by default, so we enable before building."
So, you'll need to rebuild SpiderMonkey.