question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: Task Canceled when loading items by Caml query

See original GitHub issue

I’m TaskCanceled exception on list.LoadItemsByCamlQuery(…).

In order to read “all” SharePoint data faster, I’m using different Task and split the work among them. Each of those tasks have own PnPContext (which can be reused for same Web if no other Task is using it). Error occurs on different ListItems.

StackTrace: at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult() at PnP.Core.Services.BatchClient.<ExecuteSharePointRestBatchAsync>d__48.MoveNext() — End of stack trace from previous location where exception was thrown — at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult() at PnP.Core.Services.BatchClient.<ExecuteBatch>d__36.MoveNext() — End of stack trace from previous location where exception was thrown — at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult() at PnP.Core.Model.BaseDataModel1.<RequestAsync>d__93.MoveNext() — End of stack trace from previous location where exception was thrown — at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult() at PnP.Core.Model.SharePoint.List.<LoadItemsByCamlQueryAsync>d__164.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.GetResult() at PnP.Core.Model.SharePoint.List.LoadItemsByCamlQuery(CamlQueryOptions queryOptions, Expression1[] selectors)`

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
jansenbecommented, Nov 17, 2021

Let’s close for now @bajce , but feel free to either re-open or create a new one.

1reaction
bajcecommented, Nov 17, 2021

@jansenbe I was using the latest nightly version. Unfortunately not, I won’t have that much time soon to reproduce it in console application as it can take longer. I totally understand if you want to close the issue, once I have the console application which reproduces it I can reopen it (if possible) or create new one.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Entity Framework query fails 'A task was canceled.'
However, when I try to insert a record into the database, it always fails with the error. System.Threading.Tasks.TaskCanceledException: 'A ...
Read more >
CAML Query to Get Single List Item Failing
I've set up a page with the list in an App Part and a Script Editor WP with the code below in it....
Read more >
CAML query not adding fields · Issue #396 · pnp/pnpcore
I would like to get some list item fields by using CAML query, but the fields don't get returned to me, specifically, I'm...
Read more >
Load fields dynamically when using SharePoint CSOM
Loading fields dynamically when using GetItems. Usually you will do the follow approach when loading items from a list based on a CAML...
Read more >
SharePoint Online: How to Use CAML Query in PowerShell?
Let's get all list items from the “Projects” list, where the “Project Name” field is equal to the “Innovation Metrics”. #Load SharePoint CSOM ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found