[JAVA-2957] Prematurely reached end of stream Created: 03/Sep/18 Updated: 27/Oct/23 Resolved: 07/Sep/18 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Yogesh VR | Assignee: | Ross Lawley |
| Resolution: | Works as Designed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
| Description |
|
We are getting the error "com.mongodb.MongoSocketReadException: Prematurely reached end of stream" even for simple find/update queries that would normally take few milliseconds. Can you please let us know if some kind of connection config on either server or driver would resolve this ? Mongodb version: 3.6.6 |
| Comments |
| Comment by Pradeep Ghanto [ 30/Jul/21 ] |
|
Ross Lawley, Could you please elaborate on the fix for this issue here? (com.mongodb.MongoSocketReadException: Prematurely reached end of stream) |
| Comment by Yogesh VR [ 07/Sep/18 ] |
|
Hi Ross Lawley, Thanks, we had a deployment at the error timestamp, I think this confirms your hypothesis. Yogesh VR |
| Comment by Ross Lawley [ 07/Sep/18 ] |
|
Hi yogeshvr, Looking at the logs, my hypothesis is the server was shutdown and as the Mongo Java Driver was reading from the server at the time, it couldn't read the expected data and threw the Prematurely reached end of stream error. I hope that helps, Ross |
| Comment by Yogesh VR [ 03/Sep/18 ] |
|
Hi Ross Lawley, |
| Comment by Ross Lawley [ 03/Sep/18 ] |
|
Hi yogeshvr, This error occurs when the driver fails to read data from the InputStream when its expected to be there. Providing more information either the full stacktrace or reviewing the server logs for the cause should provide more insight. Kind Regards, Ross |