[SERVER-42969] Handle non-ascii characters in`USERPROFILE` environment variable. Created: 22/Aug/19  Updated: 29/Oct/23  Resolved: 29/Aug/19

Status: Closed
Project: Core Server
Component/s: Admin, Diagnostics, Shell
Affects Version/s: None
Fix Version/s: 4.2.1, 4.3.1

Type: Bug Priority: Major - P3
Reporter: Johan Suárez Assignee: ADAM Martin (Inactive)
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File 4.2019-08-22T16-27-41.mdmp     PNG File errorDB.PNG    
Issue Links:
Backports
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.2
Sprint: Dev Tools 2019-08-26, Dev Tools 2019-09-09
Participants:

 Description   

Hello!

Could you please help me? I have a problem when I am opening Mongo.exe:

 

2019-08-22T11:27:41.166-0500 F CONTROL [main] *** unhandled exception 0xE06D7363 at 0x00007FFA0FAC9129, terminating
2019-08-22T11:27:41.167-0500 F CONTROL [main] *** stack trace for unhandled exception:
2019-08-22T11:27:41.173-0500 I - [main] KERNELBASE.dll RaiseException+0x69
VCRUNTIME140.dll CxxThrowException+0xad
mongo.exe MallocExtension::GetEstimatedAllocatedSize+0x175210
mongo.exe MallocExtension::GetEstimatedAllocatedSize+0x174fef
mongo.exe tc_mallopt+0xa52c
mongo.exe mozilla::detail::MutexImpl::~MutexImpl+0x866f
mongo.exe mozilla::detail::MutexImpl::~MutexImpl+0x2317
mongo.exe mozilla::detail::MutexImpl::~MutexImpl+0x8de5
mongo.exe tcmalloc::Log+0xaaf04
KERNEL32.DLL BaseThreadInitThunk+0x14
2019-08-22T11:27:41.176-0500 I CONTROL [main] writing minidump diagnostic file C:\Program Files\MongoDB\Server\4.2019-08-22T16-27-41.mdmp
2019-08-22T11:27:41.421-0500 F CONTROL [main] *** immediate exit due to unhandled exception

 

Afer this the process finalize

4.2019-08-22T16-27-41.mdmp

 



 Comments   
Comment by Githook User [ 12/Sep/19 ]

Author:

{'name': 'ADAM Martin', 'username': 'adamlsd', 'email': 'adam.martin@mongodb.com'}

Message: SERVER-42969 Fix handling of Unicode strings in windows `USERPROFILE` environment variable.

(cherry picked from commit c27c4a843018761c32013810e39fd3838aa229b8)
Branch: v4.2
https://github.com/mongodb/mongo/commit/0ace133fc77c0b19330ed4720479d9c222a4e161

Comment by Githook User [ 29/Aug/19 ]

Author:

{'name': 'ADAM Martin', 'username': 'adamlsd', 'email': 'adam.martin@mongodb.com'}

Message: SERVER-42969 Fix handling of Unicode strings in windows `USERPROFILE` environment variable.
Branch: master
https://github.com/mongodb/mongo/commit/c27c4a843018761c32013810e39fd3838aa229b8

Comment by Danny Hatcher (Inactive) [ 23/Aug/19 ]

set USERPROFILE

in the command line will display the current value of the variable.

Comment by Johan Suárez [ 23/Aug/19 ]

@Daniel Hatcher how can I get the "{{USERPROFILE}}environment variable"?

Comment by Mark Benvenuto [ 23/Aug/19 ]

You can work around this bug by unsetting USERPROFILE before invoking the mongo shell. The issue is that ANSI text is being treated as UTF-8. In the case of the original reporter, Johan Suárez, the á glyph triggered the bug since we internally tried to treat the ANSI á (i.e. 0xE1) as UTF-8.

Comment by Danny Hatcher (Inactive) [ 23/Aug/19 ]

For anyone who is experiencing this problem, can you please provide your USERPROFILE environment variable?

Comment by Danny Hatcher (Inactive) [ 23/Aug/19 ]

Thank you everyone for your comments. We'll take a look.

Comment by Kyoseung Koo [ 23/Aug/19 ]

I know that supporting distributed transaction is the main differences,, but

maybe release note is better than me.

https://docs.mongodb.com/manual/release-notes/4.2/

Comment by Johan Suárez [ 23/Aug/19 ]

Hello Mr. Koo, thanks for your comment!

 

Do you know if 4.0.12 version has significant differences with 4.2 version?

Comment by Kyoseung Koo [ 23/Aug/19 ]

Hello, I have the same issue.

I think it is a MongoShell issue (not mongod) because I can access my database using MongoDB Compass.

This is my MongoShell output which is written below is exactly same with Johan Suárez.

In my case, downgrading from 4.2 to 4.0.12 is working perfectly.

2019-08-22T11:41:59.729+0900 I  CONTROL  [initandlisten]
2019-08-22T11:41:59.729+0900 I  CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database.
2019-08-22T11:41:59.729+0900 I  CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted.
2019-08-22T11:41:59.729+0900 I  CONTROL  [initandlisten]
---
Enable MongoDB's free cloud-based monitoring service, which will then receive and display
metrics about your deployment (disk utilization, CPU, operation statistics, etc).The monitoring data will be available on a MongoDB website with a unique URL accessible to you
and anyone you share the URL with. MongoDB may use this information to make product
improvements and to suggest MongoDB products and deployment options to you.To enable free monitoring, run the following command: db.enableFreeMonitoring()
To permanently disable this reminder, run the following command: db.disableFreeMonitoring()
---2019-08-23T09:04:54.637+0900 F  CONTROL  [main] *** unhandled exception 0xE06D7363 at 0x00007FFB1B59A388, terminating
2019-08-23T09:04:54.637+0900 F  CONTROL  [main] *** stack trace for unhandled exception:
2019-08-23T09:04:54.639+0900 I  -        [main] KERNELBASE.dll      RaiseException+0x68
VCRUNTIME140.dll    CxxThrowException+0xad
mongo.exe           MallocExtension::GetEstimatedAllocatedSize+0x175210
mongo.exe           MallocExtension::GetEstimatedAllocatedSize+0x174fef
mongo.exe           tc_mallopt+0xa52c
mongo.exe           mozilla::detail::MutexImpl::~MutexImpl+0x866f
mongo.exe           mozilla::detail::MutexImpl::~MutexImpl+0x2317
mongo.exe           mozilla::detail::MutexImpl::~MutexImpl+0x8de5
mongo.exe           tcmalloc::Log+0xaaf04
KERNEL32.DLL        BaseThreadInitThunk+0x14
2019-08-23T09:04:54.640+0900 I  CONTROL  [main] failed to open minidump file C:\Program Files\MongoDB\Server\4.2019-08-23T00-04-54.mdmp : 액세스가 거부되었습니다.
2019-08-23T09:04:54.640+0900 F  CONTROL  [main] *** immediate exit due to unhandled exception

 

 

Comment by Johan Suárez [ 22/Aug/19 ]

Hello, this is the lastest log since I executed it: 

 

2019-08-22T17:31:48.132-0500 I NETWORK [listener] connection accepted from 127.0.0.1:50109 #1 (1 connection now open)
2019-08-22T17:31:48.154-0500 I NETWORK [conn1] received client metadata from 127.0.0.1:50109 conn1: { application:

{ name: "MongoDB Shell" }

, driver: { name: "MongoDB Internal Client", version: "4.2.0" }, os: { type: "Windows", name: "Microsoft Windows 10", architecture: "x86_64", version: "10.0 (build 17763)" } }
2019-08-22T17:31:48.734-0500 I NETWORK [conn1] end connection 127.0.0.1:50109 (0 connections now open)

 

Additionally I have installed the program 3 times and always shows the same error.

Comment by Danny Hatcher (Inactive) [ 22/Aug/19 ]

Additionally, if you uninstall the tool and then re-install it using the supplied installer, do you still receive the same error?

Comment by Danny Hatcher (Inactive) [ 22/Aug/19 ]

Can you please provide the full mongod log file from the last startup up until you experienced the error?

Comment by Johan Suárez [ 22/Aug/19 ]

The Operating System is Windows 10 and the version Mongo is the lastest (4.2)

Generated at Thu Feb 08 05:01:55 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.