[SERVER-45296] In installing mongodb, Error loading history file: FileOpenFailed: Unable to fopen() file C:\Users\김영민\.dbshell Created: 24/Dec/19  Updated: 09/Aug/21  Resolved: 09/Aug/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Kim Youngmin Assignee: Edwin Zhou
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File 1.PNG     PNG File 캡처.PNG    
Operating System: ALL
Participants:

 Description   

I'm installing mongDB. but I got a erroe message like this.

please help me brothers, I don't understand why it is.

 

C:\Program Files\MongoDB\Server\4.2\bin>mongo
MongoDB shell version v4.2.2
connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
Implicit session: session \{ "id" : UUID("c6cccaa6-4ba4-48fc-aa9a-40002d24a732") }
MongoDB server version: 4.2.2
Server has startup warnings:
2019-12-24T13:25:24.592+0900 I CONTROL [initandlisten]
2019-12-24T13:25:24.592+0900 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
2019-12-24T13:25:24.593+0900 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.
2019-12-24T13:25:24.593+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-12-24T13:54:37.063+0900 E - [main] Error loading history file: FileOpenFailed: Unable to fopen() file C:\Users\김영민\.dbshell: 대상 멀티바이트 코드페이지에 유니코드 문자의 매핑이 없습니다.

 

My mongod works correctly. it's just problem just mongo



 Comments   
Comment by Edwin Zhou [ 09/Aug/21 ]

Hi caca4616@naver.com,

We haven’t heard back from you for some time, so I’m going to close this ticket. If this is still an issue for you, please provide additional information and we will reopen the ticket.

Best,
Edwin

Comment by Edwin Zhou [ 02/Aug/21 ]

Hi caca4616@naver.com,

We still need additional information to diagnose the problem. If this is still an issue for you, would you please help narrow down the source of this issue?

Can you help investigate if there are multibyte unicode characters in the .dbshell file by:

  1. Creating a backup of the file and removing it.
  2. Launching the mongo and running a new command.
  3. Relaunching the mongo shell to verifying whether the problem persists.

To help confirm that the this problem is affected by multibyte unicode characters in the filepath for .dbshell, can you

  1. Try opening the mongo shell from a new user whose username doesn't include multibyte unicode in its username?
  2. Launch the mongo and run a new command.
  3. Relaunch the mongo shell to verify whether the problem persists.

Best,
Edwin

Comment by Edwin Zhou [ 19/Jul/21 ]

Hi caca4616@naver.com,

We appreciate your patience while we investigate this issue. We suspect this may be a Windows specific issue, the history file .dbshell may contains multibyte unicode (i.e. Hangul) and the code page is likely C or US-ASCII or something else vanilla leading to this error. It may also be the multibyte unicode characters in the .dbshell filepath itself.

Please note that the legacy version of the mongo shell has been deprecated in MongoDB v5.0. I recommend you first try using the newest version of MongoDB Shell and see if this problem persists.

After some investigation, it appears since SERVER-3912 the .dbshell filepath in the legacy mongo shell is hard set to be in the user's home directory.
https://github.com/mongodb/mongo/blob/66f3c41018ac1850c98c0bef87eda74ff95a00de/src/mongo/shell/shell_utils.cpp#L112

Can you help investigate if there are multibyte unicode characters in the .dbshell file by:

  1. Creating a backup of the file and removing it.
  2. Launching the mongo and running a new command.
  3. Relaunching the mongo shell to verifying whether the problem persists.

To help confirm that the this problem is affected by multibyte unicode characters in the filepath for .dbshell, can you

  1. Try opening the mongo shell from a new user whose username doesn't include multibyte unicode in its username?
  2. Launch the mongo and run a new command.
  3. Relaunch the mongo shell to verify whether the problem persists.

Best,

Edwin

Comment by Danny Hatcher (Inactive) [ 27/Dec/19 ]

Can you please confirm that you can still run commands via the shell? The only problem is that you can't load the shell history?

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