title: Connecting to MongoDB in scala
body: <p>I was trying to connect my play-scala application to mongo db through ReactiveMongo dependencies/ libraries  that I found in play framework documentation.</p>
  
  <p>I have added in my conf file like this</p>
  
  <pre><code>play.modules.enabled += "play.modules.reactivemongo.ReactiveMongoModule"
  mongodb.uri = "mongodb://ege:ege123@localhost:27017/smug-studio"
  </code></pre>
  
  <p>but after running my application, when I am trying to access the database through postman api it throws me an exception like </p>
  
  <pre><code>{
      "Code": 0,
      "ERROR": "MongoError['Connection is missing metadata (like protocol version, etc.) The connection pool is probably being initialized.']"
  }
  </code></pre>
  
  <p>in the logs I could find like this</p>
  
  <pre><code>[warn] r.c.a.MongoDBSystem - [Supervisor-1/Connection-2] Error while processing getNonce response #1000
  [error] r.c.a.MongoDBSystem - [Supervisor-1/Connection-2] Authentication failure
  reactivemongo.core.commands.FailedAuthentication: BSONCommandError['Error while processing getNonce response #1000']
      at reactivemongo.core.actors.MongoScramSha1Authentication$$anonfun$authReceive$1.$anonfun$applyOrElse$5(MongoScramSha1Authentication.scala:46)
      at reactivemongo.core.actors.MongoDBSystem.$anonfun$authenticationResponse$1(MongoDBSystem.scala:1009)
      at reactivemongo.core.actors.MongoDBSystem.updateNodeSet(MongoDBSystem.scala:971)
      at reactivemongo.core.actors.MongoDBSystem.updateNodeSet$(MongoDBSystem.scala:965)
      at reactivemongo.core.actors.StandardDBSystem.updateNodeSet(MongoDBSystem.scala:1337)
      at reactivemongo.core.actors.MongoDBSystem.authenticationResponse(MongoDBSystem.scala:1002)
      at reactivemongo.core.actors.MongoDBSystem.authenticationResponse$(MongoDBSystem.scala:998)
      at reactivemongo.core.actors.StandardDBSystem.authenticationResponse(MongoDBSystem.scala:1337)
      at reactivemongo.core.actors.MongoScramSha1Authentication$$anonfun$authReceive$1.$anonfun$applyOrElse$1(MongoScramSha1Authentication.scala:46)
      at scala.util.Either.fold(Either.scala:189)
  [warn] r.c.a.MongoDBSystem - [Supervisor-1/Connection-2] Error while processing getNonce response #1001
  [error] r.c.a.MongoDBSystem - [Supervisor-1/Connection-2] Authentication failure
  reactivemongo.core.commands.FailedAuthentication: BSONCommandError['Error while processing getNonce response #1001']
      at reactivemongo.core.actors.MongoScramSha1Authentication$$anonfun$authReceive$1.$anonfun$applyOrElse$5(MongoScramSha1Authentication.scala:46)
      at reactivemongo.core.actors.MongoDBSystem.$anonfun$authenticationResponse$1(MongoDBSystem.scala:1009)
      at reactivemongo.core.actors.MongoDBSystem.updateNodeSet(MongoDBSystem.scala:971)
      at reactivemongo.core.actors.MongoDBSystem.updateNodeSet$(MongoDBSystem.scala:965)
      at reactivemongo.core.actors.StandardDBSystem.updateNodeSet(MongoDBSystem.scala:1337)
      at reactivemongo.core.actors.MongoDBSystem.authenticationResponse(MongoDBSystem.scala:1002)
      at reactivemongo.core.actors.MongoDBSystem.authenticationResponse$(MongoDBSystem.scala:998)
      at reactivemongo.core.actors.StandardDBSystem.authenticationResponse(MongoDBSystem.scala:1337)
      at reactivemongo.core.actors.MongoScramSha1Authentication$$anonfun$authReceive$1.$anonfun$applyOrElse$1(MongoScramSha1Authentication.scala:46)
      at scala.util.Either.fold(Either.scala:189)
  </code></pre>
  
  <p>What should I required to do to fix the issue?</p>