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

Fix shell history file error handling

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.5.10
    • Component/s: Shell
    • Labels:
      None
    • Backwards Compatibility:
      Minor Change

      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
      

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: