[CSHARP-3216] EndOfStreamException An exception occurred while receiving a message from the server. Attempted to read past the end of the stream. Created: 28/Sep/20  Updated: 27/Oct/23  Resolved: 19/Oct/20

Status: Closed
Project: C# Driver
Component/s: Connectivity
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Pritee Bhandari Assignee: Unassigned
Resolution: Gone away Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to CSHARP-2495 EndOfStreamException: Attempted to re... Closed

 Comments   
Comment by Esha Bhargava [ 19/Oct/20 ]

There hasn't been any recent activity on this ticket, so we're resolving it. Thanks for reaching out! Please comment on this ticket if you can provide the requested information.

Comment by Esha Bhargava [ 28/Sep/20 ]

pritibhandari.11@gmail.com Thanks for reporting this! Looking at the logs, it's not clear what might be causing this bug. Can you please provide us with a minimal reproducible code? This link describes how you can create a reproducible example. Once we have that, we can investigate further.

Comment by Pritee Bhandari [ 28/Sep/20 ]

Hi Team,

Even I got above error but it occurs sometimes. But it is very critical from my project perspective.
We are using .net framework 4.6.1 and Nuget package for mongocsharpdriver, MongoDB.Bson,MongoDB.Driver - Version is 2.8.1 .

Following is the exception logs:

MongoDB.Driver.MongoConnectionException:
at MongoDB.Driver.Core.Connections.BinaryConnection.ReceiveBuffer (MongoDB.Driver.Core, Version=2.8.1.0, Culture=neutral, PublicKeyToken=null)
at MongoDB.Driver.Core.Connections.BinaryConnection.ReceiveBuffer (MongoDB.Driver.Core, Version=2.8.1.0, Culture=neutral, PublicKeyToken=null)
at MongoDB.Driver.Core.Connections.BinaryConnection.ReceiveMessage (MongoDB.Driver.Core, Version=2.8.1.0, Culture=neutral, PublicKeyToken=null)
at MongoDB.Driver.Core.ConnectionPools.ExclusiveConnectionPool+AcquiredConnection.ReceiveMessage (MongoDB.Driver.Core, Version=2.8.1.0, Culture=neutral, PublicKeyToken=null)
at MongoDB.Driver.Core.WireProtocol.CommandUsingQueryMessageWireProtocol`1.Execute (MongoDB.Driver.Core, Version=2.8.1.0, Culture=neutral, PublicKeyToken=null)
at MongoDB.Driver.Core.WireProtocol.CommandWireProtocol`1.Execute (MongoDB.Driver.Core, Version=2.8.1.0, Culture=neutral, PublicKeyToken=null)
at MongoDB.Driver.Core.Servers.Server+ServerChannel.ExecuteProtocol (MongoDB.Driver.Core, Version=2.8.1.0, Culture=neutral, PublicKeyToken=null)
at MongoDB.Driver.Core.Servers.Server+ServerChannel.Command (MongoDB.Driver.Core, Version=2.8.1.0, Culture=neutral, PublicKeyToken=null)
at MongoDB.Driver.Core.Operations.CommandOperationBase`1.ExecuteProtocol (MongoDB.Driver.Core, Version=2.8.1.0, Culture=neutral, PublicKeyToken=null)
at MongoDB.Driver.Core.Operations.CommandOperationBase`1.ExecuteProtocol (MongoDB.Driver.Core, Version=2.8.1.0, Culture=neutral, PublicKeyToken=null)
at MongoDB.Driver.Core.Operations.ReadCommandOperation`1.Execute (MongoDB.Driver.Core, Version=2.8.1.0, Culture=neutral, PublicKeyToken=null)
at MongoDB.Driver.Core.Operations.FindCommandOperation`1.Execute (MongoDB.Driver.Core, Version=2.8.1.0, Culture=neutral, PublicKeyToken=null)
at MongoDB.Driver.Core.Operations.FindOperation`1.Execute (MongoDB.Driver.Core, Version=2.8.1.0, Culture=neutral, PublicKeyToken=null)
at MongoDB.Driver.OperationExecutor.ExecuteReadOperation (MongoDB.Driver, Version=2.8.1.0, Culture=neutral, PublicKeyToken=null)
at MongoDB.Driver.MongoCollectionImpl`1.ExecuteReadOperation (MongoDB.Driver, Version=2.8.1.0, Culture=neutral, PublicKeyToken=null)
at MongoDB.Driver.MongoCollectionImpl`1.ExecuteReadOperation (MongoDB.Driver, Version=2.8.1.0, Culture=neutral, PublicKeyToken=null)
at MongoDB.Driver.MongoCollectionImpl`1.FindSync (MongoDB.Driver, Version=2.8.1.0, Culture=neutral, PublicKeyToken=null)
at MongoDB.Driver.MongoCollectionImpl`1+<>c_DisplayClass41_0`1.<FindSync>b_0 (MongoDB.Driver, Version=2.8.1.0, Culture=neutral, PublicKeyToken=null)
at MongoDB.Driver.MongoCollectionImpl`1.UsingImplicitSession (MongoDB.Driver, Version=2.8.1.0, Culture=neutral, PublicKeyToken=null)
at MongoDB.Driver.MongoCollectionImpl`1.FindSync (MongoDB.Driver, Version=2.8.1.0, Culture=neutral, PublicKeyToken=null)
at MongoDB.Driver.FindFluent`2.ToCursor (MongoDB.Driver, Version=2.8.1.0, Culture=neutral, PublicKeyToken=null)
at MongoDB.Driver.IAsyncCursorSourceExtensions.FirstOrDefault (MongoDB.Driver.Core, Version=2.8.1.0, Culture=neutral, PublicKeyToken=null)
at MongoDB.Driver.IFindFluentExtensions.FirstOrDefault (MongoDB.Driver, Version=2.8.1.0, Culture=neutral, PublicKeyToken=null)

Inner exception System.IO.EndOfStreamException handled at MongoDB.Driver.Core.Connections.BinaryConnection.ReceiveBuffer:
at MongoDB.Driver.Core.Misc.StreamExtensionMethods.ReadBytes (MongoDB.Driver.Core, Version=2.8.1.0, Culture=neutral, PublicKeyToken=null)
at MongoDB.Driver.Core.Connections.BinaryConnection.ReceiveBuffer (MongoDB.Driver.Core, Version=2.8.1.0, Culture=neutral, PublicKeyToken=null)

 

Please help me on this asap.

Generated at Wed Feb 07 21:44:42 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.