# Mongo::Auth::Unauthorized: User rhone is not authorized to access rhone\_log

**URL:** <https://discuss.elastic.co/t/mongo-auth-unauthorized-user-rhone-is-not-authorized-to-access-rhone-log/37733>\
**Category:** Logstash\
**Created:** [December 22, 2015, 5:30am UTC](https://discuss.elastic.co/t/mongo-auth-unauthorized-user-rhone-is-not-authorized-to-access-rhone-log/37733 "2015-12-22T05:30:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dabing](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dabing/32/6713_2.png) [@dabing](https://discuss.elastic.co/u/dabing)\
**Post date:** [December 22, 2015, 5:30am UTC](https://discuss.elastic.co/t/mongo-auth-unauthorized-user-rhone-is-not-authorized-to-access-rhone-log/37733/1 "2015-12-22T05:30:20Z")

</div>

who can help me?  
I config the mongo output like this:  
mongodb {  
collection =\> "%{indexCollection}"  
database =\> "rhone\_log"  
uri =\> "mongodb://rhone:hDBWc^AvInzM&7@10.4.72.171:20700,10.4.72.172:20700,10.4.70.248:20700/rhone\_log?"  
workers =\> 20  
}

but sometimes has this error like this:  
exception=\>Mongo::Auth::Unauthorized: User rhone is not authorized to access rhone\_log, :backtrace=\>["/opt/meituan/logstash/logstash-2.1.1/vendor/bundle/jruby/1.9/gems/mongo-2.0.6/lib/mongo/auth/scram/conversation.rb:445:in `validate!'", "/opt/meituan/logstash/logstash-2.1.1/vendor/bundle/jruby/1.9/gems/mongo-2.0.6/lib/mongo/auth/scram/conversation.rb:433:in`validate\_final\_message!'", "/opt/meituan/logstash/logstash-2.1.1/vendor/bundle/jruby/1.9/gems/mongo-2.0.6/lib/mongo/auth/scram/conversation.rb:134:in `finalize'", "/opt/meituan/logstash/logstash-2.1.1/vendor/bundle/jruby/1.9/gems/mongo-2.0.6/lib/mongo/auth/scram.rb:61:in`login'", "/opt/meituan/logstash/logstash-2.1.1/vendor/bundle/jruby/1.9/gems/mongo-2.0.6/lib/mongo/server/connection.rb:64:in `connect!'", "/opt/meituan/logstash/logstash-2.1.1/vendor/bundle/jruby/1.9/gems/mongo-2.0.6/lib/mongo/server/connectable.rb:93:in`ensure\_connected'", "/opt/meituan/logstash/logstash-2.1.1/vendor/bundle/jruby/1.9/gems/mongo-2.0.6/lib/mongo/server/connection.rb:130:in `write'", "/opt/meituan/logstash/logstash-2.1.1/vendor/bundle/jruby/1.9/gems/mongo-2.0.6/lib/mongo/server/connectable.rb:66:in`dispatch'", "/opt/meituan/logstash/logstash-2.1.1/vendor/bundle/jruby/1.9/gems/mongo-2.0.6/lib/mongo/loggable.rb:44:in `log'", "/opt/meituan/logstash/logstash-2.1.1/vendor/bundle/jruby/1.9/gems/mongo-2.0.6/lib/mongo/loggable.rb:43:in`log'", "/opt/meituan/logstash/logstash-2.1.1/vendor/bundle/jruby/1.9/gems/mongo-2.0.6/lib/mongo/loggable.rb:67:in `log_debug'", "/opt/meituan/logstash/logstash-2.1.1/vendor/bundle/jruby/1.9/gems/mongo-2.0.6/lib/mongo/server/connectable.rb:65:in`dispatch'", "/opt/meituan/logstash/logstash-2.1.1/vendor/bundle/jruby/1.9/gems/mongo-2.0.6/lib/mongo/operation/executable.rb:35:in `execute'", "/opt/meituan/logstash/logstash-2.1.1/vendor/bundle/jruby/1.9/gems/mongo-2.0.6/lib/mongo/server/connection_pool.rb:99:in`with\_connection'", "/opt/meituan/logstash/logstash-2.1.1/vendor/bundle/jruby/1.9/gems/mongo-2.0.6/lib/mongo/server/context.rb:63:in `with_connection'", "/opt/meituan/logstash/logstash-2.1.1/vendor/bundle/jruby/1.9/gems/mongo-2.0.6/lib/mongo/operation/executable.rb:34:in`execute'", "/opt/meituan/logstash/logstash-2.1.1/vendor/bundle/jruby/1.9/gems/mongo-2.0.6/lib/mongo/operation/write/insert.rb:72:in `execute_write_command'", "/opt/meituan/logstash/logstash-2.1.1/vendor/bundle/jruby/1.9/gems/mongo-2.0.6/lib/mongo/operation/write/insert.rb:62:in`execute'", "/opt/meituan/logstash/logstash-2.1.1/vendor/bundle/jruby/1.9/gems/mongo-2.0.6/lib/mongo/collection.rb:190:in `insert\_many'",:Shared connection to [relay.sankuai.com](http://relay.sankuai.com) closed

when i restart the logstash, work is ok, when occur this error,then will never output to the mongo, error log is above!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 5:17am UTC](https://discuss.elastic.co/t/mongo-auth-unauthorized-user-rhone-is-not-authorized-to-access-rhone-log/37733/2 "2017-07-06T05:17:36Z")

</div>


