[CSHARP-2495] EndOfStreamException: Attempted to read past the end of the stream. Created: 30/Jan/19 Updated: 28/Sep/20 Resolved: 25/Jun/20 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | Connectivity |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Critical - P2 |
| Reporter: | Jonas Kamsker | Assignee: | Wan Bachtiar |
| Resolution: | Done | Votes: | 2 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
C#.NET, Mongodb ATLAS |
||
| Issue Links: |
|
||||||||
| Description |
|
When I am trying to run multiple asynchronous requests against the server, I get following error:
Affected Library Code:
Affected Usercode:
If you have any questions please dont hesitate to ask. |
| Comments |
| Comment by Pritee Bhandari [ 27/Sep/20 ] | ||||||||||||||||||
|
Hi Team, Even I got above error but it occurs sometimes. But it is very critical from my project perspective. Following is the exception logs: MongoDB.Driver.MongoConnectionException: Inner exception System.IO.EndOfStreamException handled at MongoDB.Driver.Core.Connections.BinaryConnection.ReceiveBuffer:
Please help me on this asap. | ||||||||||||||||||
| Comment by Rachelle Palmer [ 25/Jun/20 ] | ||||||||||||||||||
|
Hi there, thank you for reaching out to MongoDB. As this sounds more like a support issue, I wanted to give you some resources to get this question answered more quickly:
Thank you! | ||||||||||||||||||
| Comment by Adam Friedland [ 17/Feb/20 ] | ||||||||||||||||||
|
Is there any update regarding this specific issue? I'm struggling with this exact problem which I seem to only encounter when deploying to an Azure Kubernetes Service. I've followed the production guidelines and set the net.ipv4.tcp_keepalive_time to 120 on both the database pod and the API querying from it. This didn't seem to help at all. I'm using a single dedicated instance as well, nothing fancy with replica sets.
Update: For anyone experiencing the same mind-numbing issue that I have, it appears that it was due to having mongo-express running on the same cluster. I can only assume it was holding random connections to my mongo container. | ||||||||||||||||||
| Comment by Olivier Quirion [ 18/Apr/19 ] | ||||||||||||||||||
|
I'm getting this error while reading from oplog and replicaset changes primary server. Here's my code :
MongoDB .Net Driver version : 2.7.2 MongoDB Server : 4.0.4 Regards, | ||||||||||||||||||
| Comment by Jonas Kamsker [ 18/Apr/19 ] | ||||||||||||||||||
|
Hey Wan, currently im not able to reproduce this as im little in time but i will get this done asap. What i can say for now is, that i was querying the database recursively. That means that one query resulted in multiple other queries i executed and so on.. On the end there were several thousand queries at a time. One possible solution would be to allow the user to set a artificial rate limit (per [milli-]second/ timespan). I used https://github.com/David-Desmaisons/RateLimiter to accomplish this | ||||||||||||||||||
| Comment by Wan Bachtiar [ 12/Apr/19 ] | ||||||||||||||||||
|
Hi, Generally this is an exception that's caused by the lost of an expected server's response.
Regards, |