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]```
- related to
-
SERVER-26871 Fix shell history file error handling
- Closed