Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-26871

Fix shell history file error handling

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.5.10
    • Affects Version/s: None
    • Component/s: Shell
    • None
    • Minor Change

      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
      

            Assignee:
            kevin.pulo@mongodb.com Kevin Pulo
            Reporter:
            kevin.pulo@mongodb.com Kevin Pulo
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: