com.mongodb.MongoTimeoutException

Timed out after 30000 ms while waiting for a server that matches ReadPreferenceServerSelector{readPreference=primary}. Client view of cluster state is {type=UNKNOWN, servers=[{address=localhost:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketOpenException: Exception opening socket}, caused by {java.net.SocketTimeoutException: connect timed out}}]

Solutions on the web110

  • via oschina.net by Unknown author, 1 year ago
    Timed out after 30000 ms while waiting for a server that matches ReadPreferenceServerSelector{readPreference=primary}. Client view of cluster state is {type=REPLICA_SET, servers=[{address=10.96.0.18:27017, type=UNKNOWN, state=CONNECTING, exception
  • via GitHub by BTGBIMobile
    , 5 months ago
    Timed out after 30000 ms while waiting for a server that matches ReadPreferenceServerSelector{readPreference=primary}. Client view of cluster state is {type=UNKNOWN, servers=[{address=localhost:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketOpenException: Exception opening socket}, caused by {java.net.SocketTimeoutException: connect timed out}}]
  • via csdn.net by Unknown author, 1 year ago
    Timed out after 30000 ms while waiting for a server that matches ReadPreferenceServerSelector{readPreference=primary}. Client view of cluster state is {type=UNKNOWN, servers=[{address=192.168.0.4:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketOpenException: Exception opening socket}, caused by {java.net.SocketTimeoutException: connect timed out}}]
  • Stack trace

    • com.mongodb.MongoTimeoutException: Timed out after 30000 ms while waiting for a server that matches ReadPreferenceServerSelector{readPreference=primary}. Client view of cluster state is {type=UNKNOWN, servers=[{address=localhost:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketOpenException: Exception opening socket}, caused by {java.net.SocketTimeoutException: connect timed out}}] at com.mongodb.connection.BaseCluster.createTimeoutException(BaseCluster.java:375) at com.mongodb.connection.BaseCluster.selectServer(BaseCluster.java:104) at com.mongodb.binding.ClusterBinding$ClusterBindingConnectionSource.<init>(ClusterBinding.java:75) at com.mongodb.binding.ClusterBinding$ClusterBindingConnectionSource.<init>(ClusterBinding.java:71) at com.mongodb.binding.ClusterBinding.getReadConnectionSource(ClusterBinding.java:63) at com.mongodb.operation.OperationHelper.withConnection(OperationHelper.java:212) at com.mongodb.operation.FindOperation.execute(FindOperation.java:483) at com.mongodb.operation.FindOperation.execute(FindOperation.java:80) at com.mongodb.Mongo.execute(Mongo.java:818) at com.mongodb.Mongo$2.execute(Mongo.java:805) at com.mongodb.FindIterableImpl$FindOperationIterable.first(FindIterableImpl.java:207) at com.mongodb.FindIterableImpl.first(FindIterableImpl.java:148) at com.aventstack.extentreports.reporter.ExtentXReporter.setupProject(ExtentXReporter.java:199) at com.aventstack.extentreports.reporter.ExtentXReporter.start(ExtentXReporter.java:165) at com.aventstack.extentreports.Report.attach(Report.java:51) at java.util.Spliterators$ArraySpliterator.forEachRemaining(Unknown Source) at java.util.stream.ReferencePipeline$Head.forEach(Unknown Source) at com.aventstack.extentreports.ExtentReports.attachReporter(ExtentReports.java:66)

    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

    Unknown user
    Once, 11 months ago
    Once, 1 year ago
    Unknown user
    Once, 1 year ago
    Once, 3 weeks ago
    2 times, 1 month ago
    17 more bugmates