com.mongodb.MongoTimeoutException: Timed out after 30000 ms while waiting for a server that matches PrimaryServerSelector. Client view of cluster state is {type=REPLICA_SET, servers=[{address=localhost:27017, type=REPLICA_SET_SECONDARY, roundTripTime=10.6 ms, state=CONNECTED}]

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

via JIRA by Ratan Sebastian, 1 year ago
Timed out after 30000 ms while waiting for a server that matches PrimaryServerSelector. Client view of cluster state is {type=REPLICA_SET, servers=[{address=localhost:27017, type=REPLICA_SET_SECONDARY, roundTripTime=10.6 ms, state=CONNECTED}]
via JIRA by Ratan Sebastian, 1 year ago
Timed out after 30000 ms while waiting for a server that matches PrimaryServerSelector. Client view of cluster state is {type=REPLICA_SET, servers=[{address=localhost:27017, type=REPLICA_SET_SECONDARY, roundTripTime=10.6 ms, state=CONNECTED}]
via Stack Overflow by Michael Dussere
, 9 months ago
Timed out after 30000 ms while waiting for a server that matches PrimaryServerSelector. Client view of cluster state is {type=REPLICA_SET, servers=[{address=XX.XXX.109.38:26016, type=REPLICA_SET_SECONDARY, roundTripTime=0.5 ms, state=CONNECTED}]
via JIRA by Daniel Gottlieb, 1 year ago
Timed out after 30000 ms while waiting for a server that matches WritableServerSelector. Client view of cluster state is {type=REPLICA_SET, servers=[{address=scrubbedProblemHost:scrubbedPort, type=UNKNOWN, state=CONNECTING}, {address=scrubbedArbiter
via Stack Overflow by RafiChozhan
, 1 year ago
Timed out after 30000 ms while waiting for a server that matches WritableServerSelector. Client view of cluster state is {type=UNKNOWN, servers=[{address=ds019468.mlab.com:19468, type=UNKNOWN, state=CONNECTING, exception
via Google Groups by Tam Truong, 5 months ago
Timed out after 30000 ms while wai ting for a server that matches ReadPreferenceServerSelector{readPreference=prima ry}. Client view of cluster state is {type=UNKNOWN, servers=[{address=locahost:2 7017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketExceptio n: locahost}, *caused by* {java.net.UnknownHostException: locahost}}]
com.mongodb.MongoTimeoutException: Timed out after 30000 ms while waiting for a server that matches PrimaryServerSelector. Client view of cluster state is {type=REPLICA_SET, servers=[{address=localhost:27017, type=REPLICA_SET_SECONDARY, roundTripTime=10.6 ms, state=CONNECTED}]
at com.mongodb.connection.BaseCluster.createTimeoutException(BaseCluster.java:370)
at com.mongodb.connection.BaseCluster.selectServer(BaseCluster.java:101)
at com.mongodb.binding.ClusterBinding$ClusterBindingConnectionSource.(ClusterBinding.java:75)
at com.mongodb.binding.ClusterBinding$ClusterBindingConnectionSource.(ClusterBinding.java:71)
at com.mongodb.binding.ClusterBinding.getWriteConnectionSource(ClusterBinding.java:68)
at com.mongodb.operation.CommandOperationHelper.executeWrappedCommandProtocol(CommandOperationHelper.java:104)
at com.mongodb.operation.CommandOperationHelper.executeWrappedCommandProtocol(CommandOperationHelper.java:97)
at com.mongodb.operation.CommandOperationHelper.executeWrappedCommandProtocol(CommandOperationHelper.java:85)
at com.mongodb.operation.CommandWriteOperation.execute(CommandWriteOperation.java:55)
at com.mongodb.Mongo.execute(Mongo.java:745)
at com.mongodb.Mongo$2.execute(Mongo.java:728)
at com.mongodb.DB.executeCommand(DB.java:583)
at com.mongodb.DBCollection.getStats(DBCollection.java:1858)
at com.mongodb.hadoop.splitter.MongoSplitterFactory.getSplitterByStats(MongoSplitterFactory.java:73)
at com.mongodb.hadoop.splitter.MongoSplitterFactory.getSplitter(MongoSplitterFactory.java:113)

Users with the same issue

6 times, 1 day ago
Once, 3 weeks ago
Once, 1 month ago
Once, 1 month ago
Once, 3 months ago
20 more bugmates

Know the solutions? Share your knowledge to help other developers to debug faster.