Uploaded image for project: 'Ruby Driver'
  1. Ruby Driver
  2. RUBY-884

Authentication with SCRAM failed with 'initialize: unitialized constant SecureRandom'

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical - P2
    • Resolution: Fixed
    • Affects Version/s: 2.0.1
    • Fix Version/s: 2.0.2, 1.12.1
    • Component/s: Authentication
    • Labels:
    • Environment:
      Mac OS X 10.10.2, MRI 2.1.1, MRI 2.2.2, MongoDB 3.0.

      Description

      Simple default SCRAM login with:

      test.rb

      m = Mongo::Client.new(['127.0.0.1:27017'], :database => "admin", :user => "admin", :password => "XXXXX")
      

      Gives error:

      /Users/andrew/.rvm/gems/ruby-2.2-head/gems/mongo-2.0.1/lib/mongo/auth/scram/conversation.rb:182:in `initialize': uninitialized constant Mongo::Auth::SCRAM::Conversation::SecureRandom (NameError)
      	from /Users/andrew/.rvm/gems/ruby-2.2-head/gems/mongo-2.0.1/lib/mongo/auth/scram.rb:43:in `new'
      	from /Users/andrew/.rvm/gems/ruby-2.2-head/gems/mongo-2.0.1/lib/mongo/auth/scram.rb:43:in `login'
      	from /Users/andrew/.rvm/gems/ruby-2.2-head/gems/mongo-2.0.1/lib/mongo/server/connection.rb:64:in `connect!'
      	from /Users/andrew/.rvm/gems/ruby-2.2-head/gems/mongo-2.0.1/lib/mongo/server/connectable.rb:89:in `ensure_connected'
      	from /Users/andrew/.rvm/gems/ruby-2.2-head/gems/mongo-2.0.1/lib/mongo/server/connection.rb:130:in `write'
      	from /Users/andrew/.rvm/gems/ruby-2.2-head/gems/mongo-2.0.1/lib/mongo/server/connectable.rb:66:in `block in dispatch'
      	from /Users/andrew/.rvm/gems/ruby-2.2-head/gems/mongo-2.0.1/lib/mongo/loggable.rb:44:in `log'
      	from /Users/andrew/.rvm/gems/ruby-2.2-head/gems/mongo-2.0.1/lib/mongo/loggable.rb:65:in `log_debug'
      	from /Users/andrew/.rvm/gems/ruby-2.2-head/gems/mongo-2.0.1/lib/mongo/server/connectable.rb:65:in `dispatch'
      	from /Users/andrew/.rvm/gems/ruby-2.2-head/gems/mongo-2.0.1/lib/mongo/operation/read/query.rb:61:in `block in execute_message'
      	from /Users/andrew/.rvm/gems/ruby-2.2-head/gems/mongo-2.0.1/lib/mongo/server/connection_pool.rb:99:in `with_connection'
      	from /Users/andrew/.rvm/gems/ruby-2.2-head/gems/mongo-2.0.1/lib/mongo/server/context.rb:62:in `with_connection'
      	from /Users/andrew/.rvm/gems/ruby-2.2-head/gems/mongo-2.0.1/lib/mongo/operation/read/query.rb:60:in `execute_message'
      	from /Users/andrew/.rvm/gems/ruby-2.2-head/gems/mongo-2.0.1/lib/mongo/operation/read/query.rb:54:in `execute'
      	from /Users/andrew/.rvm/gems/ruby-2.2-head/gems/mongo-2.0.1/lib/mongo/collection/view.rb:163:in `send_initial_query'
      	from /Users/andrew/.rvm/gems/ruby-2.2-head/gems/mongo-2.0.1/lib/mongo/collection/view/iterable.rb:39:in `each'
      

      Requiring 'securerandom' in 'lib/mongo/auth/scram/conversation.rb' seems to fix the problem.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: