If the path specified in --dbpath contains non-ASCII characters, the display of the path is wrong in Windows and the shell gets a "bad utf8" error when trying to display the response from "db.serverCmdLineOpts()". A customer on the mongodb-user group got errors in mongod.exe in his test, but he hasn't provided the path he used and I couldn't verify his problem with the simple path I picked.
Using a subdirectory with the single-character name U+00E1:
mongod --dbpath c:\data\á // ... snip ... Mon Mar 19 08:42:28 [initandlisten] options: { dbpath: "c:\data\ß" } // ... server is now running ...
The shell has problems displaying these options:
> db.serverCmdLineOpts() Mon Mar 19 08:51:00 decode failed. probably invalid utf-8 string [c:\data\ß] Mon Mar 19 08:51:00 why: InternalError: buffer too small Mon Mar 19 08:51:00 Error: invalid utf8 src/mongo/shell/utils.js:1010
The customer's problem is described at http://groups.google.com/group/mongodb-user/browse_thread/thread/703eebc432e8f925 .
mongod.exe --dbpath "\Users\test\NON-ASCII\data\db" --port 27017 --logappend --logpath "\Users\test\NON-ASCII\logs\mongod.log" --rest --vvvvv and the log shows Mon Mar 19 16:59:47 [initandlisten] User Assertion: 13518:couldn't open file /Users/test/NON-ASCII/data/db/journal/tempLatencyTest for writing errno:3 Mon Mar 19 16:59:47 [initandlisten] info preallocateIsFaster couldn't run; returning false Mon Mar 19 16:59:47 [initandlisten] User Assertion: 13518:couldn't open file /Users/test/NON-ASCII/data/db/journal/j._0 for writing errno: 3 Mon Mar 19 16:59:47 [initandlisten] exception in initAndListen: 13518 couldn't open file /Users/test/NON-ASCII/data/db/journal/j._0 for writing errno:3 terminating and if I replace the path with ASCII words, it works fine
- depends on
-
SERVER-5099 Non-ASCII text on the command line isn't handled well in Windows
- Closed
- duplicates
-
SERVER-16725 Incorrect character conversion between UTF-8 and UTF-16
- Closed
- related to
-
SERVER-7496 Mongo.exe client crashes when username of home directory contains a unicode character
- Closed