OneDrive / onedrive-sdk-csharp

OneDrive SDK for C#! https://dev.onedrive.com
Other
294 stars 143 forks source link

PutAsync to upload the file cause the Microsoft.Graph.ServiceException #202

Closed pnp0a03 closed 2 weeks ago

pnp0a03 commented 7 years ago

It seems that calling PutAsync to upload the file cause the Microsoft.Graph.ServiceException. Upload fails.

I could recreate it with following condition:

Detail of recreate procedure - following is an example of OneDrive API Browser sample, but My UWP App also cause the same exception.

  1. Build OneDrive API Browser sample with OneDriveSDK 2.0.6 + OneDrive Auth 1.0.8.
  2. Run the app and login with MSA.
  3. Select the folder.
  4. Select Menu => Upload => Simple-Path-Based, Then select the file to upload.
  5. Messeage box appear: "OneDrive reported the following error: Code: generalException Message: An error occurred sending the request.".

Error occurs at https://github.com/OneDrive/onedrive-sample-apibrowser-dotnet/blob/master/OneDriveApiBrowser/FormBrowser.cs Line 394. Exception "Microsoft.Graph.ServiceException" Error.Code = "generalException" Error.Message = "An error occurred sending the request."

\onedrive-sample-apibrowser-dotnet\OneDriveApiBrowser\FormBrowser.cs:line 394
  InnerException: 
       HResult=-2146233088
       Message=Error occurs during copy the contents to stream.
       Source=mscorlib
       StackTrace:
            Location System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
            Location System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
            Location Microsoft.Graph.HttpProvider.<SendRequestAsync>d__21.MoveNext()
       InnerException: 
            HResult=-2146232800
            Message=Could not write the data to transfer connection. Existed connection was disconnected from remote host.
            Source=System
            StackTrace:
                 Location System.Net.ConnectStream.EndWrite(IAsyncResult asyncResult)
                 Location System.Net.Http.StreamToStreamCopy.BufferWrittenCallback(IAsyncResult ar)
            InnerException: 
                 ErrorCode=10054
                 HResult=-2147467259
                 Message=Disconnected from remote host.
                 NativeErrorCode=10054
                 Source=System
                 StackTrace:
                      Location System.Net.Sockets.Socket.EndSend(IAsyncResult asyncResult)
                      Location System.Net.Sockets.NetworkStream.EndWrite(IAsyncResult asyncResult)
                 InnerException: 
baywet commented 2 weeks ago

Thank you for reaching out and for your patience. This SDK is being officially deprecated. See #259 for more information