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

GetMore throws an InvalidOperationException under certain conditions

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.2.1
    • Affects Version/s: 2.2
    • Component/s: Operations
    • Environment:
      Windows (Azure website and Win 10) .Net 4.6

      I have a query that is working against the 2.0 driver and have upgraded the driver to 2.2 and not updated the query and am getting the error below in some situations. I had to revert production to the 2.0 driver to get this to go away.

      Below is the Error-

      [InvalidOperationException: Nullable object must have a value.]
         System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) +56
         System.Nullable`1.get_Value() +25
         MongoDB.Driver.Core.Operations.AsyncCursor`1.CalculateGetMoreProtocolNumberToReturn() +238
         MongoDB.Driver.Core.Operations.AsyncCursor`1.ExecuteGetMoreProtocolAsync(IChannelHandle channel, CancellationToken cancellationToken) +41
         MongoDB.Driver.Core.Operations.<GetNextBatchAsync>d__29.MoveNext() +1204
         System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +13772500
         System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +61
         System.Runtime.CompilerServices.ConfiguredTaskAwaiter.GetResult() +35
         MongoDB.Driver.Core.Operations.<MoveNextAsync>d__32.MoveNext() +499
         System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +13772500
         System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +61
         System.Runtime.CompilerServices.ConfiguredTaskAwaiter.GetResult() +31
         MongoDB.Driver.<ToListAsync>d__16`1.MoveNext() +660
         System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +13772500
         System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +61
         System.Runtime.CompilerServices.ConfiguredTaskAwaiter.GetResult() +31
         MongoDB.Driver.<ToListAsync>d__16`1.MoveNext() +1006
         System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +13772500
         System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +61
         System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() +31
      

            Assignee:
            robert@mongodb.com Robert Stam
            Reporter:
            bret@cityspark.com Bret Ferrier
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: