System.Exception: "A task was canceled"

Hello guys,

First, I check the similar topic with my problem in the forum but didnt help me. I always get error on this process but i dont know why. Sometimes my process run 2 days and got this error, sometimes 15hour like the photo as below, sometimes 2hour and etc…

I really need to solve this…Any ideas ?

Thank you in advance for your interest

task_cancelled

1 Like

Hi,

We have seen this problem before, when attempting to retrieve assets from the orchestrator. It is likely just a TimeoutException that gets propagated as a TaskCanceledException. As you can see here:
https://www.tabsoverspaces.com/233134-taskcanceledexception-on-timeout-on-httpclient

1 Like

So likely a timeout in a Http request

Thanks for the reply. What should i do with this code on this website?

I doubt that code directly helps you. It is basically a code-level explanation on how to deal with the problem in actual HttpRequests. Technically I quess you could put the activity that causes the exception into a try catch loop, where you catch the TaskCanceledException. In the catch block you could just try using that specific activity again. It might help.

If the activity is for example Get Asset, where you try to retrieve values from the orchestrator, you could try increasing the Timeout (milliseconds) property of the activity.

Can you pinpoint the activity that is causing this error in your workflow?

Hi @ertgrl

Could you let us know what solution have you already tried?

I opened this post 22days ago and surprisingly I havent encountered any problems until this time. So I dont know the exact solution, but according to @RPA_tester said, increasing Get Asset timeout value might be the solutions because in my process I use lots of Asset in the loop…

1 Like

We have occasionally had TimeoutExceptions even with a timeout value of 1 minute, so it may be wise to increase the timeouts for your Get Asset activities. Especially if you use those repeatedly in your workflows. The TimeoutException, when attempting to retrieve an asset has been occurring rather randomly in our projects, so giving the Get Asset activities a proper timeout may be useful in your case.

Though, I’m not completely sure, if this will fix the problem.

3 Likes