[SERVER-7496] Mongo.exe client crashes when username of home directory contains a unicode character Created: 28/Oct/12  Updated: 02/Aug/18  Resolved: 18/Mar/13

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: 2.2.1
Fix Version/s: 2.5.0

Type: Task Priority: Minor - P4
Reporter: Ronan O'Brien Assignee: Gregory McKeon (Inactive)
Resolution: Done Votes: 0
Labels: Windows
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows 7


Issue Links:
Related
is related to SERVER-5099 Non-ASCII text on the command line is... Closed
is related to SERVER-5333 Issues with non-ASCII characters in f... Closed
Backwards Compatibility: Fully Compatible
Participants:

 Description   

When connecting with the client the first time, everything works ok. When I disconnected, and reconnected, I got the error below.

Deleting the existing .mongo.js is one (drastic) workaround.
Another workaround is to change the default path in the shell before executing the mongo.exe client.
e.g.
set HOMEPATH=C:\users

C:\mongodb1\bin>mongo -port 27000
MongoDB shell version: 2.2.1-rc1
connecting to: 127.0.0.1:27000/test
Thu Oct 25 22:10:42 Create/Open File failed C:\Users\Rán\.mongorc.js errno:3 The system cannot find the path specified.
Thu Oct 25 22:10:42   Assertion failure fo <= 0x7ffffffe src\mongo\scripting\engine.cpp 136
Thu Oct 25 22:10:42 mongo.exe       ???
Thu Oct 25 22:10:42 mongo.exe       ???
Thu Oct 25 22:10:42 mongo.exe       ???
Thu Oct 25 22:10:42 mongo.exe       ???
Thu Oct 25 22:10:42 mongo.exe       ???
Thu Oct 25 22:10:42 mongo.exe       ???
Thu Oct 25 22:10:42 kernel32.dll    BaseThreadInitThunk+0xd
exception: assertion src\mongo\scripting\engine.cpp:136



 Comments   
Comment by auto [ 18/Mar/13 ]

Author:

{u'date': u'2013-03-18T14:27:51Z', u'name': u'Tad Marshall', u'email': u'tad@10gen.com'}

Message: SERVER-7496 Handle non-ASCII JavaScript filespecs better in Windows

In Windows, read Unicode environment variables for HOMEDRIVE and HOMEPATH,
use Unicode functions to check for file existence in the shell, use Unicode
functions to parse filespecs when trying to execute JavaScript files, use
Unicode function to create empty '.mongorc.js' on first run of the shell.
Branch: master
https://github.com/mongodb/mongo/commit/34d0cb83c50a621ad8073fcb19bc96f5a6b8e858

Comment by Tad Marshall [ 28/Oct/12 ]

Hi Ronan,

I've duplicated your problem. Actually, it was a little worse for me; the filename wasn't even displayed correctly in my test.

There are some known shortcomings in MongoDB's handling of non-ASCII text on the command line in Windows, and I've linked some related issues. Your issue is distinct because the non-ASCII text wasn't specified on the command line, it was derived from the user account you were using.

There is an additional problem; even if the path to the file is specified on the command line, it still doesn't work because the shell converts the command line text to UTF-8 but doesn't translate it into UTF-16 (Windows Unicode) before using it.

The workaround you mentioned is probably the easiest one until we fix this.

Tad

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