Question

I am new to the Play/Scala/ReactiveMongo stack and am struggling to understand a [warn] I see in my logs and see if I can figure out how to work around it or make it go away. The issue is with using ReactiveMongo on a replset. For some reason, at app startup time, the driver logs the following unsettling [warn]...

[debug] play - Plugin [play.api.cache.EhCachePlugin] is disabled
[info] application - ReactiveMongoPlugin starting...
[info] application - ReactiveMongoPlugin successfully started with db 'reactivemongo_app'! Servers:
        [cheetah1.local:27017]
        [cheetah2.local:27018]
[info] play - Application started (Dev)
[warn] r.api.Failover - Got an error, retrying... (try #1 is scheduled in 500 ms)
reactivemongo.core.actors.Exceptions$PrimaryUnavailableException$: MongoError['No primary node is available!']
    at reactivemongo.core.actors.Exceptions$PrimaryUnavailableException$.<clinit>(actors.scala) ~[reactivemongo_2.10-0.9.jar:0.9]
    at reactivemongo.core.actors.MongoDBSystem$$anonfun$pickChannel$5.apply(actors.scala:385) ~[reactivemongo_2.10-0.9.jar:0.9]
    at reactivemongo.core.actors.MongoDBSystem$$anonfun$pickChannel$5.apply(actors.scala:385) ~[reactivemongo_2.10-0.9.jar:0.9]
    at scala.Option.toRight(Option.scala:280) ~[scala-library.jar:na]
    at reactivemongo.core.actors.MongoDBSystem.pickChannel(actors.scala:385) ~[reactivemongo_2.10-0.9.jar:0.9]
    at reactivemongo.core.actors.MongoDBSystem$$anonfun$receive$1.applyOrElse(actors.scala:154) ~[reactivemongo_2.10-0.9.jar:0.9]
[info] a.e.s.Slf4jEventHandler - Slf4jEventHandler started
[debug] play - java.nio.channels.ClosedChannelException
[info] application - Checked index, result is Success(true)

Checking the replSet itself with a Mongo shell reveals no problems there and the application works fine. I am fairly certain that these exceptions are "false positive".

My conf/application.conf is like

# Simple configuration (by URI)
# The URI syntax supports the following format: mongodb://[username:password@]host1[:port1][,hostN[:portN]]/dbName
mongodb.uri = "mongodb://cheetah1.local:27017,cheetah2.local:27018/reactivemongo_app"

The appDependency is

val appDependencies = Seq("org.reactivemongo" %% "play2-reactivemongo" % "0.9")

There is a conf/play.plugins file

400:play.modules.reactivemongo.ReactiveMongoPlugin

The app itself runs fine from startup on, reading and writing Mongo Documents without issue. Which is why I assert that the early [warn] is "false positive". Is this warning normal and is there something I can do to make it go away?

Was it helpful?

Solution

Its seems this is "just the normal noises in here": https://groups.google.com/d/msg/reactivemongo/orwHB09OW58/IUhODHcmmI8J

Its just a [warn] and not an [error] and the infrastructure recovers immediately. The "word on the street" is don't worry about it so I won't.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top