Mongodb: `com.mongodb.MongoSocketReadException: llegó prematuramente al final del flujo` con morphia
Tengo una estructura de datos simple (elTransaction
referenciado a continuación) para ser insertado en mongodb:
{"amount":111,"debitAcc":"588188286231743e7d5c923d","type":"CHARGE"}
Y obtuve la siguiente pila de errores:
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)
Mi versión mongodb es3.4.2
.
Lo interesante es que no tengo el problema en mi entorno de desarrollo local (mint linux 18.1). Pero simplemente no puede funcionar en mi entorno SIT, que es un ubuntu 16.04
¿Alguna idea?
Actualizaciones con código para insertar el documento.
DóndetransactionDao.save(...)
la implementación se puede encontrar en:
actualización 2
El sistema funciona con otras escrituras (incluso con registros mucho más grandes)