saqibpitafi / google-gdata

Automatically exported from code.google.com/p/google-gdata
0 stars 0 forks source link

WebExceptions when uploading a photo via PicasaService.Insert #240

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I keep getting random WebExceptions thrown from PicasaService.Insert when 
uploading a set of photos via my client like the one below.

I currently workaround those by creating a new PicasaService instance 
after I catch the exception, login again (setUserCredentials) and switch 
to using that instance until it works. If I try to call .Insert onthe 
instance that threw the exception just keeps throwing the same/similar 
exception/s.

I am working with .NET 3.5.

System.Net.WebException: The request was aborted: The request was canceled.
   at System.Net.ConnectStream.CloseInternal(Boolean internalCall, Boolean 
aborting)
   at System.Net.ConnectStream.System.Net.ICloseEx.CloseEx(CloseExState 
closeState)
   at System.Net.ConnectStream.Dispose(Boolean disposing)
   at System.IO.Stream.Close()
   at Google.GData.Client.GDataGAuthRequest.CopyRequestData()
   at Google.GData.Client.GDataGAuthRequest.Execute(Int32 retryCounter)
   at Google.GData.Client.GDataGAuthRequest.Execute()
   at Google.GData.Client.Service.StreamSend(Uri targetUri, Stream 
inputStream, GDataRequestType type, String contentType, String slugHeader, 
String etag, AsyncSendData data)
   at Google.GData.Client.Service.StreamSend(Uri targetUri, Stream 
inputStream, GDataRequestType type, String contentType, String slugHeader)
   at Google.GData.Client.Service.Insert(Uri uriTarget, Stream input, 
String contentType, String slugHeader)
   at PicasaUploader.AlbumInfo.UploadPhoto(String fileName) in 
Z:\projects\PicasaUploader\PicasaUploader\PicasaController.cs:line 176
   at PicasaUploader.PicasaUploaderForm.<UploadPhotos>b__0(Object ) in 
Z:\projects\PicasaUploader\PicasaUploader\PicasaUploader.cs:line 136

Inner exception is:

System.IO.IOException: Cannot close stream until all bytes are written.
at System.Net.ConnectStream.CloseInternal(Boolean internalCall, Boolean 
aborting)

Original issue reported on code.google.com by ivan.nik...@gmail.com on 20 Apr 2009 at 7:26

GoogleCodeExporter commented 9 years ago
If you use the supplied photo sample application, can you repro that behaviour? 
if so, how? 

Original comment by fman...@gmail.com on 23 Apr 2009 at 4:07

GoogleCodeExporter commented 9 years ago

Original comment by fman...@gmail.com on 23 Apr 2009 at 4:08

GoogleCodeExporter commented 9 years ago
I can reproduce using the attached minimal test case. Compile both on windows or
linux/mono by typing "make" and execute Test.exe from the "bin" directory. Note 
that
you will have to set the username and password in Test.cs.

Also note that the bin\test.jpg is rather large - 3.6mb and I am on a slow 
upload
connection - 15-30kbytes/sec.

Original comment by ivan.nik...@gmail.com on 29 Apr 2009 at 10:01

Attachments:

GoogleCodeExporter commented 9 years ago
Like in issue 241, this works fine in my test setup (mono, 2.4, Macintosh). If 
you have 15kbs, is it possible you 
are hitting a timeout of the runtime there? 

Original comment by fman...@gmail.com on 30 Apr 2009 at 11:51

GoogleCodeExporter commented 9 years ago
Same as issue 240 - suspected networking issue, so probably invalid

Original comment by ivan.nik...@gmail.com on 30 Apr 2009 at 3:35

GoogleCodeExporter commented 9 years ago
i will close this pending further information. Let me know if this happens to 
pop up again. 

Original comment by fman...@gmail.com on 13 May 2009 at 10:16