MongoTimeoutException

Hello,

I am using MongoDB Atlas with my Java application. Currently, I am using MongoDB driver version 4.2.0 and whenever I try to insert a document into my collection I receive this exception:

com.mongodb.MongoTimeoutException: Timed out after 30000 ms while waiting for a server that matches com.mongodb.client.internal.MongoClientDelegate$1@4e41089d. Client view of cluster state is {type=REPLICA_SET, servers=[{address:27017=cluster0-shard-00-01.rnnax.mongodb.net, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketWriteException: Exception sending message}, caused by {javax.net.ssl.SSLHandshakeException: extension (5) should not be presented in certificate_request}}, {address:27017=cluster0-shard-00-00.rnnax.mongodb.net, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketWriteException: Exception sending message}, caused by {javax.net.ssl.SSLHandshakeException: extension (5) should not be presented in certificate_request}}, {address:27017=cluster0-shard-00-02.rnnax.mongodb.net, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketWriteException: Exception sending message}, caused by {javax.net.ssl.SSLHandshakeException: extension (5) should not be presented in certificate_request}}]
at com.mongodb.internal.connection.BaseCluster.createTimeoutException(BaseCluster.java:404)
at com.mongodb.internal.connection.BaseCluster.selectServer(BaseCluster.java:123)
at com.mongodb.internal.connection.AbstractMultiServerCluster.selectServer(AbstractMultiServerCluster.java:54)
at com.mongodb.client.internal.MongoClientDelegate.getConnectedClusterDescription(MongoClientDelegate.java:147)
at com.mongodb.client.internal.MongoClientDelegate.createClientSession(MongoClientDelegate.java:100)
at com.mongodb.client.internal.MongoClientDelegate$DelegateOperationExecutor.getClientSession(MongoClientDelegate.java:277)
at com.mongodb.client.internal.MongoClientDelegate$DelegateOperationExecutor.execute(MongoClientDelegate.java:201)
at com.mongodb.client.internal.MongoCollectionImpl.executeSingleWriteRequest(MongoCollectionImpl.java:1048)
at com.mongodb.client.internal.MongoCollectionImpl.executeInsertOne(MongoCollectionImpl.java:498)
at com.mongodb.client.internal.MongoCollectionImpl.insertOne(MongoCollectionImpl.java:482)
at com.mongodb.client.internal.MongoCollectionImpl.insertOne(MongoCollectionImpl.java:476)
at me.skhanal.StockDweebs.MongoDB.main(MongoDB.java:24)

I have ensured that the credentials for the MongoClient is correct and that I am using the correct driver version. Does anyone know what is causing this issue?

Did you whitelist your client IP addr on Atlas via the “Network Access” settings?

Yes my client IP address is currently whitelisted

Sorry to hear that you’re having trouble. What is the exact version of the JDK you are using? I wonder if you’re running into a bug like https://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8236039?

Regards,
Jeff

I am currently using version 13.0.2.8

Please try with 13.0.3, as the JDK bug I linked to has been fixed in that patch.

Sorry for the late response, this fixed the issue!

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.