title: Exception- Value cannot be null. Parameter name: currentDocumentProducer
body: <p>We are using composite Index to order by 2 fields, one is text and other date.
  I have created the composite Index and trying to use the same in the .net application. We also have implemented Paging for the same query using continuation token</p>
  
  <p>The records are coming for the first page, but for second page we are getting the exception </p>
  
  <blockquote>
    <p>Value cannot be null. Parameter name: currentDocumentProducer</p>
  </blockquote>
  
  <p>If I order by only one field the paging is working fine. We have checked the Continuation token, both seems to be same except for the order by fields.</p>
  
  <pre><code> var feedOptions = new FeedOptions
                  {
                      MaxItemCount = pageSize,
                      EnableCrossPartitionQuery = true,
                      RequestContinuation = continuationToken
                  };
                  IQueryable&lt;T&gt; filter = client.CreateDocumentQuery&lt;T&gt;(collectionLink, Query, feedOptions);
                  IDocumentQuery&lt;T&gt; query = filter.AsDocumentQuery();
                  FeedResponse&lt;T&gt; feedRespose = query.ExecuteNextAsync&lt;T&gt;().GetAwaiter().GetResult();
  </code></pre>
  
  <p>The stack trace is as below</p>
  
  <blockquote>
    <p>System.ArgumentNullException:    at
    Microsoft.Azure.Documents.Query.OrderByDocumentQueryExecutionContext.get_ActivityId
    (Microsoft.Azure.DocumentDB.Core, Version=2.0.0.0, Culture=neutral,
    PublicKeyToken=31bf3856ad364e35)    at
    Microsoft.Azure.Documents.Query.OrderByDocumentQueryExecutionContext.ValidateAndExtractContinuationTokens
    (Microsoft.Azure.DocumentDB.Core, Version=2.0.0.0, Culture=neutral,
    PublicKeyToken=31bf3856ad364e35)    at
    Microsoft.Azure.Documents.Query.OrderByDocumentQueryExecutionContext+d__23.MoveNext
    (Microsoft.Azure.DocumentDB.Core, Version=2.0.0.0, Culture=neutral,
    PublicKeyToken=31bf3856ad364e35)    at
    System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw
    (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral,
    PublicKeyToken=7cec85d7bea7798e)    at
    System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess
    (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral,
    PublicKeyToken=7cec85d7bea7798e)    at
    System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification
    (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral,
    PublicKeyToken=7cec85d7bea7798e)    at
    System.Runtime.CompilerServices.TaskAwaiter.GetResult
    (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral,
    PublicKeyToken=7cec85d7bea7798e)    at
    Microsoft.Azure.Documents.Query.OrderByDocumentQueryExecutionContext+d__19.MoveNext
    (Microsoft.Azure.DocumentDB.Core, Version=2.0.0.0, Culture=neutral,
    PublicKeyToken=31bf3856ad364e35)    at
    System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw
    (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral,
    PublicKeyToken=7cec85d7bea7798e)    at
    System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess
    (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral,
    PublicKeyToken=7cec85d7bea7798e)    at
    System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification
    (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral,
    PublicKeyToken=7cec85d7bea7798e)    at
    System.Runtime.CompilerServices.TaskAwaiter<code>1.GetResult
    (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral,
    PublicKeyToken=7cec85d7bea7798e)    at
    Microsoft.Azure.Documents.Query.PipelinedDocumentQueryExecutionContext+&lt;&gt;c__DisplayClass5_0+&lt;&lt;CreateAsync&gt;b__0&gt;d.MoveNext
    (Microsoft.Azure.DocumentDB.Core, Version=2.0.0.0, Culture=neutral,
    PublicKeyToken=31bf3856ad364e35)    at
    System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw
    (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral,
    PublicKeyToken=7cec85d7bea7798e)    at
    System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess
    (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral,
    PublicKeyToken=7cec85d7bea7798e)    at
    System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification
    (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral,
    PublicKeyToken=7cec85d7bea7798e)    at
    System.Runtime.CompilerServices.TaskAwaiter</code>1.GetResult
    (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral,
    PublicKeyToken=7cec85d7bea7798e)    at
    Microsoft.Azure.Documents.Query.PipelinedDocumentQueryExecutionContext+d__5.MoveNext
    (Microsoft.Azure.DocumentDB.Core, Version=2.0.0.0, Culture=neutral,
    PublicKeyToken=31bf3856ad364e35)    at
    System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw
    (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral,
    PublicKeyToken=7cec85d7bea7798e)    at
    System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess
    (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral,
    PublicKeyToken=7cec85d7bea7798e)    at
    System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification
    (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral,
    PublicKeyToken=7cec85d7bea7798e)    at
    System.Runtime.CompilerServices.TaskAwaiter<code>1.GetResult
    (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral,
    PublicKeyToken=7cec85d7bea7798e)    at
    Microsoft.Azure.Documents.Query.DocumentQueryExecutionContextFactory+&lt;CreateSpecializedDocumentQueryExecutionContext&gt;d__3.MoveNext
    (Microsoft.Azure.DocumentDB.Core, Version=2.0.0.0, Culture=neutral,
    PublicKeyToken=31bf3856ad364e35)    at
    System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw
    (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral,
    PublicKeyToken=7cec85d7bea7798e)    at
    System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess
    (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral,
    PublicKeyToken=7cec85d7bea7798e)    at
    System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification
    (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral,
    PublicKeyToken=7cec85d7bea7798e)    at
    System.Runtime.CompilerServices.TaskAwaiter</code>1.GetResult
    (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral,
    PublicKeyToken=7cec85d7bea7798e)    at
    Microsoft.Azure.Documents.Query.ProxyDocumentQueryExecutionContext+d__15.MoveNext
    (Microsoft.Azure.DocumentDB.Core, Version=2.0.0.0, Culture=neutral,
    PublicKeyToken=31bf3856ad364e35)    at
    System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw
    (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral,
    PublicKeyToken=7cec85d7bea7798e)    at
    System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess
    (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral,
    PublicKeyToken=7cec85d7bea7798e)    at
    System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification
    (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral,
    PublicKeyToken=7cec85d7bea7798e)    at
    System.Runtime.CompilerServices.TaskAwaiter<code>1.GetResult
    (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral,
    PublicKeyToken=7cec85d7bea7798e)    at
    Microsoft.Azure.Documents.Linq.DocumentQuery</code>1+d__36`1.MoveNext
    (Microsoft.Azure.DocumentDB.Core, Version=2.0.0.0, Culture=neutral,
    PublicKeyToken=31bf3856ad364e35)    at
    System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw
    (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral,
    PublicKeyToken=7cec85d7bea7798e)    at
    System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess
    (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral,
    PublicKeyToken=7cec85d7bea7798e)    at
    System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification
    (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral,
    PublicKeyToken=7cec85d7bea7798e)</p>
  </blockquote>