Warn on handshake and auth failures

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Major - P3
    • 2.8.0.rc0
    • Affects Version/s: None
    • Component/s: Auth
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      I think we can warn whenever there is a network error during handshake or auth. It is my impression that these generally should not happen, therefore warning shouldn't add much log output and it may help to diagnose issues.

      To help with this:

      RSpec::Expectations::ExpectationNotMetError: expected Mongo::Auth::Unauthorized with "User foo (mechanism: scram) is not authorized to access admin (used mechanism: SCRAM-SHA-1)", got #<Mongo::Error::SocketError: EOFError: end of file reached> with backtrace:
        # ./lib/mongo/socket.rb:299:in `rescue in handle_errors'
        # ./lib/mongo/socket.rb:293:in `handle_errors'
        # ./lib/mongo/socket.rb:125:in `read'
        # ./lib/mongo/protocol/message.rb:139:in `deserialize'
        # ./lib/mongo/server/connection.rb:224:in `block (2 levels) in handshake!'
        # ./lib/mongo/server/round_trip_time_averager.rb:36:in `measure'
        # ./lib/mongo/server/connection.rb:222:in `block in handshake!'
        # ./lib/mongo/server.rb:342:in `handle_handshake_failure!'
        # ./lib/mongo/server/connection.rb:220:in `handshake!'
        # ./lib/mongo/server/connection.rb:133:in `connect!'
        # ./spec/integration/auth_spec.rb:28:in `block (7 levels) in <top (required)>'
        # ./spec/integration/auth_spec.rb:27:in `block (6 levels) in <top (required)>'
        # ./spec/lite_spec_helper.rb:115:in `block (3 levels) in <top (required)>'
        # ./spec/lite_spec_helper.rb:114:in `block (2 levels) in <top (required)>'
        # ./spec/lite_spec_helper.rb:102:in `block (2 levels) in <top (required)>'
      

            Assignee:
            Oleg Pudeyev (Inactive)
            Reporter:
            Oleg Pudeyev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: