java.io.IOException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • Our application runs on machines that are sometimes moved between networks or has its IP address changed. When we create the Mongo instance it is done using the "localhost" host for the Mongo server. The Mongo driver appears to always resolve to an IP on the local subnet. "192.168.0.10" for example. When the network chances however, our applications starts failing with errors like the following because it can no longer connect: jvm 1 | java.io.IOException: couldn't connect to [io/192.168.0.10:27017] bc:java.net.ConnectException: Operation timed out jvm 1 | at com.mongodb.DBPort._open(DBPort.java:205) jvm 1 | at com.mongodb.DBPort.go(DBPort.java:94) jvm 1 | at com.mongodb.DBPort.go(DBPort.java:75) jvm 1 | at com.mongodb.DBPort.call(DBPort.java:65) jvm 1 | at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:215) jvm 1 | at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:295) jvm 1 | at com.mongodb.DBCursor._check(DBCursor.java:354) jvm 1 | at com.mongodb.DBCursor._hasNext(DBCursor.java:484) jvm 1 | at com.mongodb.DBCursor.hasNext(DBCursor.java:509) jvm 1 | at com.mongodb.jdbc.MongoResultSet.next(MongoResultSet.java:640) ... I have configured the Mongo instance to automatically try to reconnect, but the conversion from "localhost" to "192.168.0.10" only happens once. The only way to get Mongo to reconnect is to restart the Java instance. I assume that there is a reason why the IP is being resolved, but would it be possible to make the driver re-resolve the IP when doing a reconnect? Thanks in advance, Leif
    via by Leif Mortenson,
  • Our application runs on machines that are sometimes moved between networks or has its IP address changed. When we create the Mongo instance it is done using the "localhost" host for the Mongo server. The Mongo driver appears to always resolve to an IP on the local subnet. "192.168.0.10" for example. When the network chances however, our applications starts failing with errors like the following because it can no longer connect: jvm 1 | java.io.IOException: couldn't connect to [io/192.168.0.10:27017] bc:java.net.ConnectException: Operation timed out jvm 1 | at com.mongodb.DBPort._open(DBPort.java:205) jvm 1 | at com.mongodb.DBPort.go(DBPort.java:94) jvm 1 | at com.mongodb.DBPort.go(DBPort.java:75) jvm 1 | at com.mongodb.DBPort.call(DBPort.java:65) jvm 1 | at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:215) jvm 1 | at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:295) jvm 1 | at com.mongodb.DBCursor._check(DBCursor.java:354) jvm 1 | at com.mongodb.DBCursor._hasNext(DBCursor.java:484) jvm 1 | at com.mongodb.DBCursor.hasNext(DBCursor.java:509) jvm 1 | at com.mongodb.jdbc.MongoResultSet.next(MongoResultSet.java:640) ... I have configured the Mongo instance to automatically try to reconnect, but the conversion from "localhost" to "192.168.0.10" only happens once. The only way to get Mongo to reconnect is to restart the Java instance. I assume that there is a reason why the IP is being resolved, but would it be possible to make the driver re-resolve the IP when doing a reconnect? Thanks in advance, Leif
    via by Leif Mortenson,
  • Weird error with MongoDb + Java driver
    via Stack Overflow by Kane Nguyen
    ,
  • MongoDB with Java, cannot get Collection
    via Stack Overflow by Caveman
    ,
  • Plugin fails without mongodb
    via GitHub by ignatov
    ,
    • java.io.IOException: couldn't connect to [io/192.168.0.10:27017] bc:java.net.ConnectException: Operation timed out at com.mongodb.DBPort._open(DBPort.java:205) at com.mongodb.DBPort.go(DBPort.java:94) at com.mongodb.DBPort.go(DBPort.java:75) at com.mongodb.DBPort.call(DBPort.java:65) at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:215) at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:295) at com.mongodb.DBCursor._check(DBCursor.java:354) at com.mongodb.DBCursor._hasNext(DBCursor.java:484) at com.mongodb.DBCursor.hasNext(DBCursor.java:509) at com.mongodb.jdbc.MongoResultSet.next(MongoResultSet.java:640)

    Users with the same issue

    abrazenebabrazeneb
    688 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor2 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,