com.mongodb.MongoSocketReadException

Prematurely reached end of stream


Samebug tips1

Check if your server is listening to the the same adress you're trying to connect to.

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


Solutions on the web22

Solution icon of github
via GitHub by anildes
, 1 year ago
Prematurely reached end of stream

Solution icon of github
via GitHub by satishc1
, 3 months ago
Prematurely reached end of stream

Solution icon of stackoverflow
Prematurely reached end of stream

Solution icon of googlegroups
via Google Groups by Keamas M, 1 year ago
Prematurely reached end of stream

Solution icon of web
via JIRA by Dharshan Rangegowda, 1 year ago
Prematurely reached end of stream

Solution icon of stackoverflow
Prematurely reached end of stream

Solution icon of github
Prematurely reached end of stream

Solution icon of github
Prematurely reached end of stream

Solution icon of stackoverflow
Prematurely reached end of stream

Solution icon of github
Prematurely reached end of stream

Stack trace

  • com.mongodb.MongoSocketReadException: Prematurely reached end of stream at com.mongodb.connection.SocketStream.read(SocketStream.java:88) at com.mongodb.connection.InternalStreamConnection.receiveResponseBuffers(InternalStreamConnection.java:494) at com.mongodb.connection.InternalStreamConnection.receiveMessage(InternalStreamConnection.java:224) at com.mongodb.connection.UsageTrackingInternalConnection.receiveMessage(UsageTrackingInternalConnection.java:96) at com.mongodb.connection.DefaultConnectionPool$PooledConnection.receiveMessage(DefaultConnectionPool.java:440) at com.mongodb.connection.WriteCommandProtocol.receiveMessage(WriteCommandProtocol.java:262) at com.mongodb.connection.WriteCommandProtocol.execute(WriteCommandProtocol.java:104) at com.mongodb.connection.InsertCommandProtocol.execute(InsertCommandProtocol.java:67) at com.mongodb.connection.InsertCommandProtocol.execute(InsertCommandProtocol.java:37) at com.mongodb.connection.DefaultServer$DefaultServerProtocolExecutor.execute(DefaultServer.java:168) at com.mongodb.connection.DefaultServerConnection.executeProtocol(DefaultServerConnection.java:289) at com.mongodb.connection.DefaultServerConnection.insertCommand(DefaultServerConnection.java:118) at com.mongodb.operation.InsertOperation.executeCommandProtocol(InsertOperation.java:76) at com.mongodb.operation.BaseWriteOperation$1.call(BaseWriteOperation.java:139) at com.mongodb.operation.BaseWriteOperation$1.call(BaseWriteOperation.java:133) at com.mongodb.operation.OperationHelper.withConnectionSource(OperationHelper.java:422) at com.mongodb.operation.OperationHelper.withConnection(OperationHelper.java:413) at com.mongodb.operation.BaseWriteOperation.execute(BaseWriteOperation.java:133) at com.mongodb.operation.BaseWriteOperation.execute(BaseWriteOperation.java:60) at com.mongodb.Mongo.execute(Mongo.java:845) at com.mongodb.Mongo$2.execute(Mongo.java:828) at com.mongodb.DBCollection.executeWriteOperation(DBCollection.java:342) at com.mongodb.DBCollection.insert(DBCollection.java:337) at com.mongodb.DBCollection.insert(DBCollection.java:328) at org.mongodb.morphia.DatastoreImpl.saveDocument(DatastoreImpl.java:1297) at org.mongodb.morphia.DatastoreImpl.tryVersionedUpdate(DatastoreImpl.java:1340) at org.mongodb.morphia.DatastoreImpl.save(DatastoreImpl.java:1286) at org.mongodb.morphia.DatastoreImpl.save(DatastoreImpl.java:775) at org.mongodb.morphia.DatastoreImpl.save(DatastoreImpl.java:758)

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

2 times, 6 months ago
Once, 10 months ago
Samebug visitor profile picture
Unknown user
2 times, 11 months ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
9 more bugmates