com.mongodb.MongoTimeoutException: Timed out after 30000 ms while wa iting for a server that matches ReadPreferenceServerSelector{readPreference=prim ary}. Client view of cluster state is {type=UNKNOWN, servers=[{address=locahost: 27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketExcepti on: locahost},* caused by* {java.net.UnknownHostException: locahost}}]]]


Solutions on the web1

Solution icon of googlegroups
via Google Groups by Tam Truong, 4 months ago
Timed out after 30000 ms while wa iting for a server that matches ReadPreferenceServerSelector{readPreference=prim ary}. Client view of cluster state is {type=UNKNOWN, servers=[{address=locahost: 27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketExcepti on: locahost},* caused by* {java.net.UnknownHostException: locahost}}]]]

Stack trace

com.mongodb.MongoTimeoutException: Timed out after 30000 ms 
while wa
iting for a server that matches 
ReadPreferenceServerSelector{readPreference=prim
ary}. Client view of cluster state is {type=UNKNOWN, 
servers=[{address=locahost:
27017, type=UNKNOWN, state=CONNECTING, 
exception={com.mongodb.MongoSocketExcepti
on: locahost},* caused by* {java.net.UnknownHostException: locahost}}]]]
	at play.api.http.HttpErrorHandlerExceptions$.throwableToUsefulException(HttpErrorHandler.scala:293)
	at play.api.http.DefaultHttpErrorHandler.onServerError(HttpErrorHandler.scala:220)
	at play.api.GlobalSettings$class.onError(GlobalSettings.scala:160)
	at play.api.DefaultGlobal$.onError(GlobalSettings.scala:188)
	at play.api.http.GlobalSettingsHttpErrorHandler.onServerError(HttpErrorHandler.scala:100)
	at play.core.server.netty.PlayRequestHandler$$anonfun$2$$anonfun$apply$1.applyOrElse(PlayRequestHandler.scala:100)
	at play.core.server.netty.PlayRequestHandler$$anonfun$2$$anonfun$apply$1.applyOrElse(PlayRequestHandler.scala:99)
	at scala.concurrent.Future$$anonfun$recoverWith$1.apply(Future.scala:344)
	at scala.concurrent.Future$$anonfun$recoverWith$1.apply(Future.scala:343)
	at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32)

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

You are the first who have seen this exception. Write a tip to help other users and build your expert profile.