[SERVER-26871] Fix shell history file error handling Created: 02/Nov/16  Updated: 02/Jan/18  Resolved: 28/Jun/17

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

Type: Improvement Priority: Major - P3
Reporter: Kevin Pulo Assignee: Kevin Pulo
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-26489 mongo shell no longer records history... Closed
is related to SERVER-32473 Error loading history file on first s... Closed
is related to SERVER-26872 Add shell history testing Closed
Backwards Compatibility: Minor Change
Participants:

 Description   

Currently the shell does not check or report at all if there were any problems reading or writing the .dbshell history file. Users should be notified when this occurs, although the shell must otherwise continue working as normal (ie. failure to read/write shell history is not a serious enough error for the shell to abort).

Current behaviour:

$ chmod 0 ~/.dbshell
$ mongo --nodb --norc
MongoDB shell version v3.2.10
> exit
bye
$ chmod 600 ~/.dbshell

Desired behaviour (for example):

$ chmod 0 ~/.dbshell
$ mongo --nodb --norc
MongoDB shell version v3.4.0-rc1-95-g558e10f
2016-11-01T00:30:39.983+0000 E -        [main] Error loading history file: FileOpenFailed: Unable to fopen() file /home/kev/.dbshell: Permission denied
> exit
bye
2016-11-01T00:30:39.983+0000 E -        [main] Error saving history file: FileOpenFailed: Unable to open() file /home/kev/.dbshell: Permission denied
$ chmod 600 ~/.dbshell



 Comments   
Comment by Githook User [ 28/Jun/17 ]

Author:

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

Message: SERVER-26871 report failures when handling shell history file
Branch: master
https://github.com/mongodb/mongo/commit/0ab7f732e0bee535383dd6dcda400999a1eee6b2

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