5

For almost the past 24 hours, I have been receiving TaskCanceledExceptions as the result of calls to ResumeableUpload's UploadAsync. Uploads are failing probably 90% of the time. I am uploading videos to youtube.

I was using an earlier version of the google-apis (1.4) so I tried upgrading to the latest nuget packages for 1.5, but the issue is unchanged.

Any idea what might be occurring? I am perplexed as I haven't changed my code in sometime...

The stack trace is as follows:

   at Microsoft.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at Microsoft.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccess(Task task)
   at Microsoft.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Microsoft.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
   at Google.Apis.Upload.ResumableUpload`1.<Upload>d__0.MoveNext() in c:\code.google.com\google-api-dotnet-client\default_3\Tools\Google.Apis.Release\bin\Debug\output\default\Src\GoogleApis\Apis\[Media]\Upload\ResumableUpload.cs:line 362
Linda Lawton - DaImTo
  • 106,405
  • 32
  • 180
  • 449
Rob Davis
  • 1,299
  • 1
  • 10
  • 22
  • 2
    1. What happen if you using just Upload (not UploadAsync)? 2. Maybe you need to change your HttpClient.Timeout property? 3. Do you see in Fiddler that the request was made but you are still waiting for a response? – peleyal Sep 06 '13 at 12:26
  • 1
    @peleyal - Thanks for the suggestions. As I believe you guessed, HttpClient.SendAsync will throw a Task Canceled Exception when the [timeout is exceeded](http://stackoverflow.com/questions/10547895/how-can-i-tell-when-httpclient-has-timed-out). I had the chunk size set to 20 megabytes. While this has never been an issue in the past, it is now taking longer than the timeout to upload a chunk of that size. So, I have the option of lowering the chunk size or increasing the timeout (or a combo of those). Thanks for your suggestions! – Rob Davis Sep 06 '13 at 22:59
  • @RobDavis Greetings Mr. Davis, I am currently working on a project in which we use Google Storage. Do you know of any web sites which contain examples of implementing resumable upload in C# .NET? – Marin Jan 23 '15 at 16:12
  • See [this](http://stackoverflow.com/questions/38558348/youtube-v3-api-google-apis-requests-requesterrorbackend-error-503/38573818#38573818) StackOverflow answer. – Mike Meinz Jul 25 '16 at 18:06

0 Answers0