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

Mongo::Auth::Unauthorized after mongoS restart after setting FCV 4.0

    • Type: Icon: Task Task
    • Resolution: Incomplete
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 2.10.0
    • Component/s: None
    • Labels:
      None

      We've been upgrading our 3.6.8 instances to MongoDB 4.0.12. There is no impact to us at all during the upgrade and mongoS restarts for the binary replacements. However, when we run

      db.adminCommand(

      { setFeatureCompatibilityVersion: "4.0" }

      )

      and then restart mongoS, we get Mongo::Auth::Unauthorized errors that occur sporadically. It seems to recover shortly after the restarts (and we also restart our application and from then on we stop seeing it entirely), but I wanted to file this for awareness.

      Mongo::Auth::Unauthorized: User users (mechanism: mongodb_cr) is not authorized to access DATABASE_NAME_HERE (used mechanism: MONGODB-CR)
      from mongo/auth/cr/conversation.rb:134:in `validate!'
      from mongo/auth/cr/conversation.rb:61:in `continue'
      from mongo/auth/cr.rb:62:in `login'
      from mongo/server/connection.rb:368:in `block in authenticate!'
      from mongo/server.rb:428:in `handle_auth_failure!'
      from mongo/server/connection.rb:366:in `authenticate!'
      from mongo/server/connection.rb:190:in `do_connect'
      from mongo/server/connection.rb:171:in `connect!'
      from mongo/server/connection_pool.rb:724:in `connect_connection'
      from mongo/server/connection_pool.rb:354:in `check_out'
      from mongo/server/connection_pool.rb:549:in `with_connection'
      from mongo/server.rb:401:in `with_connection'
      from mongo/operation/shared/executable.rb:51:in `dispatch_message'
      from mongo/operation/shared/executable.rb:46:in `get_result'
      from mongo/operation/shared/executable.rb:26:in `block (2 levels) in do_execute'
      from mongo/operation/shared/specifiable.rb:587:in `add_error_labels'
      from mongo/operation/shared/executable.rb:25:in `block in do_execute'
      from mongo/operation/shared/unpinnable.rb:30:in `unpin_maybe'
      from mongo/operation/shared/executable.rb:24:in `do_execute'
      from mongo/operation/shared/executable.rb:34:in `execute'
      from mongo/operation/shared/op_msg_or_find_command.rb:28:in `execute'
      from mongo/collection/view/iterable.rb:89:in `send_initial_query'
      from mongo/collection/view/iterable.rb:46:in `block in each'
      from mongo/retryable.rb:61:in `block in read_with_retry_cursor'
      from mongo/retryable.rb:317:in `legacy_read_with_retry'
      from mongo/retryable.rb:119:in `read_with_retry'
      from mongo/retryable.rb:60:in `read_with_retry_cursor'
      from forwardable.rb:230:in `read_with_retry_cursor'
      from mongo/collection/view/iterable.rb:45:in `each'
      from mongoid/query_cache.rb:222:in `each'
      from mongoid/contextual/mongo.rb:133:in `each'
      from mongoid/contextual.rb:20:in `each'

            Assignee:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Reporter:
            jonhyman Jon Hyman
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: