[CSHARP-1970] "InvalidOperationException: Sequence contains no elements" in MongoDB.Driver.GridFS.GridFSForwardOnlyDownloadStream`1.GetNextBatchFromCursor(Boolean hasMore) Created: 25/Apr/17 Updated: 28/Oct/23 Resolved: 28/Apr/17 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | GridFS |
| Affects Version/s: | 2.4.2 |
| Fix Version/s: | 2.4.4 |
| Type: | Bug | Priority: | Critical - P2 |
| Reporter: | Ummer Irshad | Assignee: | Robert Stam |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | driver | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
OS : Windows Server 2008 R2 |
||
| Description |
|
We are running load test with MongoDB V3.2.11 and below mentioned error is thrown when reading the binary file from GridFS.
We are using below code for downloading the binary file
Do you have any clue about above error? Thanks in advance. |
| Comments |
| Comment by Ummer Irshad [ 02/May/17 ] | ||||||||||||||||||||||||||
|
Dear Team, Thank you very much for a quick fix Please let us know the release date of MongoDB Driver 2.4.4. It will be of great help, if you can release the same within this week. BR, | ||||||||||||||||||||||||||
| Comment by Githook User [ 28/Apr/17 ] | ||||||||||||||||||||||||||
|
Author: {u'username': u'rstam', u'name': u'rstam', u'email': u'robert@robertstam.org'}Message: | ||||||||||||||||||||||||||
| Comment by Robert Stam [ 28/Apr/17 ] | ||||||||||||||||||||||||||
|
That's great information thanks. The only question I forgot to ask was what the shard key was for the fs.chunks collection. I may not be able to reproduce this, but I see an easy code change to handle unexpected empty batches returned from the server (the code can just keeping asking for the next batch until it either reaches the end of the cursor or a non-empty batch is received). | ||||||||||||||||||||||||||
| Comment by Ummer Irshad [ 28/Apr/17 ] | ||||||||||||||||||||||||||
|
Thank you very much Robert Stam for taking up this issue. We are not able to reproduce this issue with MongoDB 2.6.11 and Mongocsharpdriver 1.11.0. But, when we tried with MongoDB 3.2.9 and Mongocsharpdriver 1.11.0, it got reproduced. Pls. find the clarification which you requested below: 1. Whether you are using a custom chunksize and if so what the value is 2. The exact file size in bytes (I'm not sure whether MB means 1,000,000 or 1024 x 1024) 3. What download options you are using 4. the values of the offset and count parameters to Read I'm assuming this is the first call to Read after OpenDownloadStream?
5. Standalone, replica set or sharded cluster? 6. Any ReadPreference set on the database or GridFS bucket? 7. Any custom indexes on the fs.chunks collection? 8. Is the fs.chunks collection sharded? Pls. let me know if any more info required. | ||||||||||||||||||||||||||
| Comment by Robert Stam [ 27/Apr/17 ] | ||||||||||||||||||||||||||
|
And also some information about your server configuration: 5. Standalone, replica set or sharded cluster? | ||||||||||||||||||||||||||
| Comment by Robert Stam [ 27/Apr/17 ] | ||||||||||||||||||||||||||
|
It would also be helpful to know: 4. the values of the offset and count parameters to Read I'm assuming this is the first call to Read after OpenDownloadStream? | ||||||||||||||||||||||||||
| Comment by Robert Stam [ 27/Apr/17 ] | ||||||||||||||||||||||||||
|
I am unable to reproduce this, but looking at the driver code I can see how this would happen if the server unexpectedly returned an empty final batch for the query used to read the chunks. Can you provide some more information to help me reproduce this? 1. Whether you are using a custom chunksize and if so what the value is | ||||||||||||||||||||||||||
| Comment by Ummer Irshad [ 25/Apr/17 ] | ||||||||||||||||||||||||||
|
Update: |