Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-5333

Issues with non-ASCII characters in filenames and paths in Windows

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Shell
    • Environment:
      Tested in Windows 7 with code page 437
    • Windows

      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
      

            Assignee:
            backlog-server-platform DO NOT USE - Backlog - Platform Team
            Reporter:
            tad Tad Marshall
            Votes:
            4 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: