0

I have a play scala app and i have an atlas cluster which i am trying to connect. According to the ReactiveMongo this is possible. I can add my connection string gotten from Atlas to my app via

mongodb.uri

In my application.conf file. I have tried everything based on the instructions from reactivemongo and atlas db but i am still unable to connect to the cluster. using my mongoshell however, i am able to connect and have access to my db but it simply refuses to connect via my app. Mongo simply returns an error "MongoError['No primary node is available! (Supervisor-13/Connection-14)']" } and logs a warning in my console Some options were ignored because they are not supported (yet): w, retryWrites. I am using scala version 2.12 and reactivemongo 0.12.6 with play 2.6. My connection string is mongodb+srv://<username>:<password>@my-cluster.abo25.mongodb.net/my-db?retryWrites=true&w=majority

Any info or help would be greatly appreciated.

cchantep
  • 9,118
  • 3
  • 30
  • 41
stainlessbaby
  • 23
  • 1
  • 8
  • Verify you can connect using non-SRV URI, then enable diagnostics in your driver to obtain output like the one at the end of https://docs.mongodb.com/ruby-driver/master/tutorials/ruby-driver-monitoring/#server-discovery-and-monitoring and add to the question. – D. SM Jul 15 '20 at 17:42
  • I found my problem. I will post it in the answer below. Thanks – stainlessbaby Jul 15 '20 at 22:58

1 Answers1

1

Solved my problem. It turns out the +srv string format works seamlessly from reactivemongo version 0.17 and i was initially on 0.16. After i upgraded (and also upgraded my code), i was able to connect to my cluster. I also found out one of the user credentials i was using was wrong so that plus the upgrade got me up and running.

stainlessbaby
  • 23
  • 1
  • 8