[SERVER-32473] Error loading history file on first shell usage Created: 28/Dec/17  Updated: 30/Oct/23  Resolved: 07/Jan/18

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: 3.6.0
Fix Version/s: 3.6.3, 3.7.1

Type: Bug Priority: Minor - P4
Reporter: Tomislav Plavcic Assignee: Kevin Pulo
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File mongo-installation-error.png    
Issue Links:
Backports
Related
related to SERVER-26871 Fix shell history file error handling Closed
Backwards Compatibility: Minor Change
Operating System: ALL
Backport Requested:
v3.6
Sprint: Sharding 2018-01-15
Participants:

 Description   

When using mongo shell for the first time the message:

"[main] Error loading history file: FileOpenFailed: Unable to fopen() file /home/ubuntu/.dbshell: No such file or directory" is visible.

Most probably that should not be displayed since it seems that everything is fine, the file is not there before starting but it is created after the session. The message is misleading and the user might think that something is wrong with his environment.

I think this links to SERVER-26871

Here's how it looks:

```ubuntu@t-ubuntu1604-64:~$ mongo
MongoDB shell version v3.6.1
connecting to: mongodb://127.0.0.1:27017
MongoDB server version: 3.6.1
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, see
        http://docs.mongodb.org/
Questions? Try the support group
        http://groups.google.com/group/mongodb-user
Server has startup warnings:
2017-12-28T15:29:37.461+0000 I STORAGE  [initandlisten]
2017-12-28T15:29:37.461+0000 I STORAGE  [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
2017-12-28T15:29:37.461+0000 I STORAGE  [initandlisten] **          See http://dochub.mongodb.org/core/prodnotes-filesystem
2017-12-28T15:29:37.471+0000 I CONTROL  [initandlisten]
2017-12-28T15:29:37.471+0000 I CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database.
2017-12-28T15:29:37.471+0000 I CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted.
2017-12-28T15:29:37.471+0000 I CONTROL  [initandlisten]
2017-12-28T15:29:37.471+0000 I CONTROL  [initandlisten]
2017-12-28T15:29:37.471+0000 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2017-12-28T15:29:37.471+0000 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
2017-12-28T15:29:37.471+0000 I CONTROL  [initandlisten]
2017-12-28T15:29:37.471+0000 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
2017-12-28T15:29:37.471+0000 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
2017-12-28T15:29:37.471+0000 I CONTROL  [initandlisten]
2017-12-28T15:29:48.677+0000 E -        [main] Error loading history file: FileOpenFailed: Unable to fopen() file /home/ubuntu/.dbshell: No such file or directory```

File is there after first session:

```ubuntu@t-ubuntu1604-64:~$ ls -alh|grep db
-rw------- 1 ubuntu ubuntu    0 Dec 28 15:30 .dbshell```

Shell re-run:

```ubuntu@t-ubuntu1604-64:~$ mongo
MongoDB shell version v3.6.1
connecting to: mongodb://127.0.0.1:27017
MongoDB server version: 3.6.1
Server has startup warnings:
2017-12-28T15:29:37.461+0000 I STORAGE  [initandlisten]
2017-12-28T15:29:37.461+0000 I STORAGE  [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
2017-12-28T15:29:37.461+0000 I STORAGE  [initandlisten] **          See http://dochub.mongodb.org/core/prodnotes-filesystem
2017-12-28T15:29:37.471+0000 I CONTROL  [initandlisten]
2017-12-28T15:29:37.471+0000 I CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database.
2017-12-28T15:29:37.471+0000 I CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted.
2017-12-28T15:29:37.471+0000 I CONTROL  [initandlisten]
2017-12-28T15:29:37.471+0000 I CONTROL  [initandlisten]
2017-12-28T15:29:37.471+0000 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2017-12-28T15:29:37.471+0000 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
2017-12-28T15:29:37.471+0000 I CONTROL  [initandlisten]
2017-12-28T15:29:37.471+0000 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
2017-12-28T15:29:37.471+0000 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
2017-12-28T15:29:37.471+0000 I CONTROL  [initandlisten]```



 Comments   
Comment by Kevin Pulo [ 26/Feb/18 ]

This is fixed in MongoDB 3.6.3, which has now been released. Please update to prevent this (harmless) error from occurring.

Comment by Ganesh [ 13/Feb/18 ]

Team ,
I am facing same issue with latest version mongodb-win32-x86_64-enterprise-windows-64-3.6.2.
Please let me know if there is any workaround.

Thanks
Ganesh

Comment by ankur joshi [ 10/Feb/18 ]

Hi,

I am still facing this error. Also i tried getting the 3.6.3 version, wasn't able to locate it. Is it released yet? Kindly help me with a work around.

Comment by Kelsey Schubert [ 24/Jan/18 ]

Hi ggangwar,

This fix will be included in the next release of MongoDB 3.6 stable branch, 3.6.3.

Kind regards,
Kelsey

Comment by anonymous user [ 24/Jan/18 ]

In which release, fix will be available?

Comment by Githook User [ 11/Jan/18 ]

Author:

{'email': 'kevin.pulo@mongodb.com', 'name': 'Kevin Pulo', 'username': 'devkev'}

Message: SERVER-32473 don't output an error on shell startup if no history file

(cherry picked from commit 4e51bb975ba8b1d2e5faa396543f16eff2ecdee5)
Branch: v3.6
https://github.com/mongodb/mongo/commit/06002a6b47800a57dafdafad5e0343876f979b7b

Comment by Githook User [ 07/Jan/18 ]

Author:

{'name': 'Kevin Pulo', 'username': 'devkev', 'email': 'kevin.pulo@mongodb.com'}

Message: SERVER-32473 don't output an error on shell startup if no history file
Branch: master
https://github.com/mongodb/mongo/commit/4e51bb975ba8b1d2e5faa396543f16eff2ecdee5

Comment by Kelsey Schubert [ 02/Jan/18 ]

Thanks for reporting this issue, tplavcic. I can reproduce this behavior, which was introduced by SERVER-26871.

Comment by Tomislav Plavcic [ 28/Dec/17 ]

Sorry about the markup, seems I can't edit it now...

Generated at Thu Feb 08 04:30:21 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.