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

Mongod doesn't start with --keyFile option on windows

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Blocker - P1 Blocker - P1
    • None
    • 2.4.6
    • Security
    • None
    • ALL
    • ALL
    • Hide

      -- On powershell 
      -- Generate key file
       
      PS C:\> openssl rand -base64 60 > c:\key_file
      Loading 'screen' into random state - done
       
      -- Start mongod using --keyFile
       
      PS C:\> mongod --dbpath 1 --keyFile C:\key_file
      Sat Aug 24 10:17:26.230 invalid char in key file C:\key_file: ?

      We can verify key_file contents:

      PS C:\> type c:\key_file
      QC4wVN/ad/vTskKtZ0lysAAG4GEoGFCd7FyStRlu3ZUn+ayAakEuP1Jtj7RFKPRS
      RVeZS/lhYz6oYrSr

      Show
      -- On powershell -- Generate key file   PS C:\> openssl rand -base64 60 > c:\key_file Loading 'screen' into random state - done   -- Start mongod using --keyFile   PS C:\> mongod --dbpath 1 --keyFile C:\key_file Sat Aug 24 10:17:26.230 invalid char in key file C:\key_file: ? We can verify key_file contents: PS C:\> type c:\key_file QC4wVN/ad/vTskKtZ0lysAAG4GEoGFCd7FyStRlu3ZUn+ayAakEuP1Jtj7RFKPRS RVeZS/lhYz6oYrSr

    Description

      Mongod refuse to start when --keyFile option is used:

      -- On powershell 
      -- Generate key file
       
      PS C:\> openssl rand -base64 60 > c:\key_file
      Loading 'screen' into random state - done
       
      -- Start mongod using --keyFile
       
      PS C:\> mongod --dbpath 1 --keyFile C:\key_file
      Sat Aug 24 10:17:26.230 invalid char in key file C:\key_file: ?

      We can verify key_file contents:

      PS C:\> type c:\key_file
      QC4wVN/ad/vTskKtZ0lysAAG4GEoGFCd7FyStRlu3ZUn+ayAakEuP1Jtj7RFKPRS
      RVeZS/lhYz6oYrSr

      Mongod starts without a problem when --keyFile option is not specified:

      PS C:\> mongod --dbpath 1
      Sat Aug 24 10:24:53.596 [initandlisten] MongoDB starting : pid=3616 port=27017 dbpath=1 64-bit host=aftab-HP
      Sat Aug 24 10:24:53.599 [initandlisten] db version v2.4.5
      Sat Aug 24 10:24:53.600 [initandlisten] git version: a2ddc68ba7c9cee17bfe69ed840383ec3506602b
      Sat Aug 24 10:24:53.602 [initandlisten] build info: windows sys.getwindowsversion(major=6, minor=1, build=7601, platform
      =2, service_pack='Service Pack 1') BOOST_LIB_VERSION=1_49
      Sat Aug 24 10:24:53.604 [initandlisten] allocator: system
      Sat Aug 24 10:24:53.606 [initandlisten] options: { dbpath: "1" }
      Sat Aug 24 10:24:53.623 [initandlisten] journal dir=1\journal
      Sat Aug 24 10:24:53.624 [initandlisten] recover : no journal files present, no recovery needed
      Sat Aug 24 10:24:53.958 [initandlisten] waiting for connections on port 27017
      Sat Aug 24 10:24:53.958 [websvr] admin web console waiting for connections on port 28017

      Attachments

        Activity

          People

            schwerin@mongodb.com Andy Schwerin
            akhangd aftab khan
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: