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

MongoDB 3.4 'mongo' shell quit() not working

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.4.0, 3.4.1
    • Fix Version/s: 3.4.2, 3.5.2
    • Component/s: Shell
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v3.4
    • Steps To Reproduce:
      1. Download MongoDB 3.4.0 or 3.4.1.
      2. Connect to a MongoDB server using 3.4 'mongo' shell.
      3. Run "quit()" function.
      4. Notice the shell does not exit.
    • Sprint:
      Platforms 2017-01-23

      Description

      Hey guys,

      Hopefully this isn't a duplicate. On MongoDB 3.4.0 and 3.4.1 I am noticing the 'quit()' shell function no longer works. The function still exists in the shell but does nothing.

      I have confirmed this does not occur when using the 3.2.11 'mongo' shell.

      I have reproduced this with several server versions and the problem seems to be unrelated to the server version.

      Issue repro using 3.4.1 'mongo' shell (had to CTRL+C to quit the shell):

      $ ./mongodb3.4/mongodb-linux-x86_64-3.4.1/bin/mongo; echo $?
      MongoDB shell version v3.4.1
      connecting to: mongodb://127.0.0.1:27017
      MongoDB server version: 3.4.1
      Server has startup warnings: 
      2017-01-04T14:52:34.465+0100 I CONTROL  [initandlisten] 
      2017-01-04T14:52:34.465+0100 I CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database.
      2017-01-04T14:52:34.465+0100 I CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted.
      2017-01-04T14:52:34.465+0100 I CONTROL  [initandlisten] 
      > 
      > quit()
      > quit()
      > quit()
      > quit
      function quit() {
          [native code]
      }
      > ^C
      bye
      0
      $ ./mongodb3.4/mongodb-linux-x86_64-3.4.1/bin/mongo --version
      MongoDB shell version v3.4.1
      git version: 5e103c4f5583e2566a45d740225dc250baacfbd7
      allocator: tcmalloc
      modules: none
      build environment:
          distarch: x86_64
          target_arch: x86_64
      

      To compare, 3.2.11 is working as expected:

      $ ./mongodb3.2/mongodb-linux-x86_64-3.2.11/bin/mongo; echo $?
      MongoDB shell version: 3.2.11
      connecting to: test
      Server has startup warnings: 
      2017-01-04T14:52:34.465+0100 I CONTROL  [initandlisten] 
      2017-01-04T14:52:34.465+0100 I CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database.
      2017-01-04T14:52:34.465+0100 I CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted.
      2017-01-04T14:52:34.465+0100 I CONTROL  [initandlisten] 
      > quit()
      0
      $ ./mongodb3.2/mongodb-linux-x86_64-3.2.11/bin/mongo --version
      MongoDB shell version: 3.2.11
      

      And 3.0 is working too:

      $ /opt/mongodb3.0/bin/mongo
      MongoDB shell version: 3.0.12-15-gc0066f6
      connecting to: test
      Server has startup warnings: 
      2017-01-04T14:52:34.465+0100 I CONTROL  [initandlisten] 
      2017-01-04T14:52:34.465+0100 I CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database.
      2017-01-04T14:52:34.465+0100 I CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted.
      2017-01-04T14:52:34.465+0100 I CONTROL  [initandlisten] 
      > quit()
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                11 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: