Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-1970

"InvalidOperationException: Sequence contains no elements" in MongoDB.Driver.GridFS.GridFSForwardOnlyDownloadStream`1.GetNextBatchFromCursor(Boolean hasMore)

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Critical - P2 Critical - P2
    • 2.4.4
    • Affects Version/s: 2.4.2
    • Component/s: GridFS
    • Environment:
      OS : Windows Server 2008 R2
      Sharding Environment

      We are running load test with MongoDB V3.2.11 and below mentioned error is thrown when reading the binary file from GridFS.
      Size of binary file is 2 GB.

      Type:InvalidOperationException,Message:Sequence contains no elements
         場所 System.Linq.Enumerable.Last[TSource](IEnumerable`1 source)
         場所 MongoDB.Driver.GridFS.GridFSForwardOnlyDownloadStream`1.GetNextBatchFromCursor(Boolean hasMore)
         場所 MongoDB.Driver.GridFS.GridFSForwardOnlyDownloadStream`1.GetFirstBatch(CancellationToken cancellationToken)
         場所 MongoDB.Driver.GridFS.GridFSForwardOnlyDownloadStream`1.GetSegment(CancellationToken cancellationToken)
         場所 MongoDB.Driver.GridFS.GridFSForwardOnlyDownloadStream`1.Read(Byte[] buffer, Int32 offset, Int32 count)

      We are using below code for downloading the binary file

      documentBucket.OpenDownloadStream(file.Id, downloadOptions)

      Do you have any clue about above error?

      Thanks in advance.

            robert@mongodb.com Robert Stam
            ummerirshadk@gmail.com Ummer Irshad
            0 Vote for this issue
            2 Start watching this issue