moped icon indicating copy to clipboard operation
moped copied to clipboard

authentication failed failed with error 13: "not authorized for insert on mongose_development.people

Open rajcybage opened this issue 9 years ago • 5 comments

After mongod.cnf auth=true

I got

Moped::Errors::OperationFailure: The operation: #<Moped::Protocol::Command
  @length=83
  @request_id=5
  @response_to=0
  @op_code=2004
  @flags=[]
  @full_collection_name="mongose_development.$cmd"
  @skip=0
  @limit=-1
  @selector={:getlasterror=>1, :w=>1}
  @fields=nil>
failed with error 13: "not authorized for insert on mongose_development.people"

See https://github.com/mongodb/mongo/blob/master/docs/errors.md
for details about this error.
    from /home/rajarshi/.rbenv/versions/2.1.4/lib/ruby/gems/2.1.0/bundler/gems/moped-10abbf3eac37/lib/moped/operation/read.rb:50:in `block in execute'
    from /home/rajarshi/.rbenv/versions/2.1.4/lib/ruby/gems/2.1.0/bundler/gems/moped-10abbf3eac37/lib/moped/node.rb:594:in `[]'
    from /home/rajarshi/.rbenv/versions/2.1.4/lib/ruby/gems/2.1.0/bundler/gems/moped-10abbf3eac37/lib/moped/node.rb:594:in `block (2 levels) in flush'
    from /home/rajarshi/.rbenv/versions/2.1.4/lib/ruby/gems/2.1.0/bundler/gems/moped-10abbf3eac37/lib/moped/node.rb:593:in `map'
    from /home/rajarshi/.rbenv/versions/2.1.4/lib/ruby/gems/2.1.0/bundler/gems/moped-10abbf3eac37/lib/moped/node.rb:593:in `block in flush'
    from /home/rajarshi/.rbenv/versions/2.1.4/lib/ruby/gems/2.1.0/bundler/gems/moped-10abbf3eac37/lib/moped/node.rb:617:in `block in logging'
    from /home/rajarshi/.rbenv/versions/2.1.4/lib/ruby/gems/2.1.0/gems/activesupport-4.2.0/lib/active_support/notifications.rb:164:in `block in instrument'
    from /home/rajarshi/.rbenv/versions/2.1.4/lib/ruby/gems/2.1.0/gems/activesupport-4.2.0/lib/active_support/notifications/instrumenter.rb:20:in `instrumen

I have user with dbowner permission

and I am using the username and password.

It did not throw error in

mono shell there it is working fine

rajcybage avatar May 15 '15 16:05 rajcybage

the error had been fixed on https://github.com/mongoid/moped/commit/8a7719fdb70da16462da5df750422d16b0786539 but now it came back again

rajcybage avatar May 15 '15 16:05 rajcybage

+1

lmancilla avatar May 15 '15 20:05 lmancilla

+1

This happens to me on Mongo 3+. It is fine with Mongo 2.

KnownSubset avatar May 26 '15 14:05 KnownSubset

Why this issue wasn't fixed yet? I think, this is EXTREME IMPORTANT.

mayatskiy avatar Jun 25 '15 20:06 mayatskiy

If you want it fixed quickly, then submit a pull request please. Since Moped is end of life on the next Mongoid release at the end of the month there is no focused developement on Moped at the moment, and will not be in the future. Otherwise wait until next week and upgrade - the switch back to the core Ruby driver will address most of the issues here, including this one.

durran avatar Jun 25 '15 22:06 durran