com.mongodb.MongoSocketOpenException

Exception opening socket

Samebug tips4

Check if your MongoDB is available.


Check if your server (or a proxy server) is not going up and down. There might be something between a proxy and a client sending intermittent requests to non-functioning hosts as well. There might as well be too many requests in a short amount of time.

Don't give up yet. Our experts can help. Paste your full stack trace to get a solution.

Solutions on the web90

  • via JIRA by Attila Tőkés, 1 year ago
    Exception opening socket
  • via JIRA by Junwei Zhuge, 1 year ago
    Exception opening socket
  • via GitHub by shilpsl1
    , 6 months ago
    Exception opening socket
  • Stack trace

    • com.mongodb.MongoSocketOpenException: Exception opening socket at com.mongodb.connection.SocketStream.open(SocketStream.java:63)[mongodb-driver-core-3.2.2.jar!/:na] at com.mongodb.connection.InternalStreamConnection.open(InternalStreamConnection.java:114)[mongodb-driver-core-3.2.2.jar!/:na] at com.mongodb.connection.DefaultServerMonitor$ServerMonitorRunnable.run(DefaultServerMonitor.java:128)[mongodb-driver-core-3.2.2.jar!/:na] at java.lang.Thread.run(Thread.java:745)[na:1.8.0_111] Caused by: java.net.ConnectException: Connection refused (Connection refused) at java.net.PlainSocketImpl.socketConnect(Native Method)[na:1.8.0_111]

    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

    6 times, 3 weeks ago
    37 times, 7 months ago
    Unknown user
    Once, 1 year ago
    85 times, 1 year ago
    3 times, 10 months ago
    277 more bugmates