Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-2558

Unable to connect to application collection without connecting to system collection

    • Type: Icon: Task Task
    • Resolution: Done
    • 3.0.15
    • Affects Version/s: None
    • Component/s: None
    • Labels:

      We are trying to use the Mongoid v3 driver in a cluster where the user we are connecting as only exists in the collection/database we are hitting, and not the system collection. We are using the following config to set up the Mongoid connection:

      Mongoid.configure do |config|
      config.sessions = {
      :default => {
      :hosts => ["#

      {hosts}

      "],
      :database => "#

      {db}

      ",
      :username => "#

      {user}

      ",
      :password => "#

      {pass}

      "
      }
      }
      config.options = {
      :skip_version_check => true
      }
      end

      The mongo logs show the following:

      Thu Nov 15 18:16:20 [initandlisten] connection accepted from x.x.x.x:46785 #656121
      Thu Nov 15 18:16:20 [conn656121] authenticate:

      { authenticate: 1, nonce: "ee340837e00cb4d1", user: "hghhgh_user", key: "d9b325de880dfd0d99c9daea13bb113d" }

      Thu Nov 15 18:16:20 [conn656121] auth: couldn't find user hghhgh_user, system.system.users
      Thu Nov 15 18:16:20 [conn656121] end connection x.x.x.x:46785

      In my application log, I see an exception that notes:
      'execution expired'

      and references the moped driver.

      I would like the Mongoid driver to NOT attempt to connect to the system collection at all.

      Is there any reason it has to connect to the system collection?

      Can I skip the system collection connect? Is there a way to change the config to enable me to connect to my collection, or is this a bug?

      Can I initiate the database authentication explicitly like I could in the v2 driver?????

      example:

      Mongoid.database = Mongo::Connection.new(host,port).db(db)

      Mongoid.database.authenticate(user,pass)

      Chris

            Assignee:
            Unassigned Unassigned
            Reporter:
            wchrisjohnson wchrisjohnson
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: