0

I've been working on a Spark Streaming application which interfaces with MongoDB via the reactivemongo connector. However, the Spark job is hitting the following exception

16:53:23.153 [ForkJoinPool-4-worker-5] ERROR reactivemongo.api.Failover2 - Got an error, no more attempts to do. Completing with a failure... reactivemongo.core.errors.ConnectionNotInitialized: MongoError['Connection is missing metadata (like protocol version, etc.) The connection pool is probably being initialized.']     at reactivemongo.core.errors.ConnectionNotInitialized$.MissingMetadata(errors.scala:67)

I couldn't find online references to debugging this exception. Has anyone encountered this before? If so, any ideas on what could possibly throwing this exception?

Snippet of my code:

...
val driver = MongoDriver()
val connection = driver.connection(List("10.211.55.10"))
val db = connection("wordCountDB")
val collection = db[BSONCollection]("counts")
...

Thanks in advance

jithinpt
  • 1,204
  • 2
  • 16
  • 33
  • Have you tried this code outside of the Spark job? To check whether thre is an issue related to its task management? – cchantep Jul 16 '15 at 17:11
  • @cchantep I also encountered this problem. We're using Docker in our tests where a fresh MongoDB instance is started before the tests are fired up. Currently we're hitting that problem every other time. Additionally, there's a `TimeoutException: Futures timed out after [10 seconds]` at MongoApi.scala:84 error when executing the stop hook. – cbley Jul 23 '15 at 10:08
  • @cchantep me too, running tests with the Play2 plugin (play 2.3), with a standalone mongo running on localhost. Oddly it only happens when I enable debug logging. – Keeth Aug 10 '15 at 20:18

0 Answers0