just-ai/jaicf-kotlin

MongoSocketOpenException: Exception opening socket

hram opened this issue · 2 comments

hram commented

Hi

Can you help me please.
I was trying to connect to mongodb from test.
My code is as an example https://github.com/just-ai/jaicf-kotlin/blob/master/managers/mongo/src/test/kotlin/com/justai/jaicf/context/manager/test/MongoBotContextManagerTest.kt
My test is dfferent only by connection string. In my case I use heroku:

mongodb://$login:$password@ds055762.mlab.com:55762/heroku_9w2h7mvv

I get error wen rut test:
[Test worker] INFO org.mongodb.driver.cluster - Cluster description not yet available. Waiting for 30000 ms before timing out [cluster-ClusterId{value='5e9d4c755f914205c037beff', description='null'}-ds055762.mlab.com:55762] INFO org.mongodb.driver.cluster - Exception in monitor thread while connecting to server ds055762.mlab.com:55762 com.mongodb.MongoSocketOpenException: Exception opening socket at com.mongodb.connection.SocketStream.open(SocketStream.java:62) at com.mongodb.connection.InternalStreamConnection.open(InternalStreamConnection.java:126) at com.mongodb.connection.DefaultServerMonitor$ServerMonitorRunnable.run(DefaultServerMonitor.java:114) at java.base/java.lang.Thread.run(Thread.java:832) Caused by: java.net.SocketTimeoutException: Connect timed out

Are you sure your test fails? Sometimes these types of exceptions from mongo just signal that there are some issues with cluster connection. But a single connection works at the same time .

hram commented

It seems that my PS had network connection error.
I changed PC and issue is gone.
Issue can be closed.