msgraph-sdk-dotnet icon indicating copy to clipboard operation
msgraph-sdk-dotnet copied to clipboard

Suspected Bug - OneDrive Copy Item - GatewayTimeout at 10 seconds

Open jchilde opened this issue 9 years ago • 5 comments

I am trying to copy files using onedrive copy using Microsoft Graph SDK (.net). I have found that files around 38mb fail with a gateway timeout status code. This happens right at the 10 second mark.

I expect an okay response with a location header.

Files are being copied from and to a SharePoint document library.

I am using the Microsoft graph .net sdk. Smaller files copy without issue.

Here is my code: ``
try { var request = client.Drives[SourceDriveId].Root.ItemWithPath(itemFileName).Copy(parentReference: dest).Request(); //Path here is to parent folder.

            HttpRequestMessage hrm = new HttpRequestMessage(HttpMethod.Post, request.RequestUrl);
            hrm.Content = new StringContent(JsonConvert.SerializeObject(request.RequestBody), System.Text.Encoding.UTF8, "application/json");
            await client.AuthenticationProvider.AuthenticateRequestAsync(hrm);
       
            HttpResponseMessage response = await client.HttpProvider.SendAsync(hrm);
            if (response.IsSuccessStatusCode)
            {
                var content = await response.Content.ReadAsStringAsync();
            }
            
        }
        catch (Microsoft.Graph.ServiceException ex)
        {
            throw new Exception("Unknown Error");
        }

jchilde avatar Sep 28 '17 22:09 jchilde

@jchilde I'm going to ask about this and get back to you.

By the way, I find it interesting that you use the request builder to create the URL and body, and then HRM to send and get the response. What is your reason for that approach?

MIchaelMainer avatar Oct 04 '17 00:10 MIchaelMainer

I actually did it your way first. Then shifted to the hrm approach to provide more granular control over he http client. It has an overload to complete after receiving the header vice content. I also wanted to better see the response for troubleshooting.

My third try was pure httpclient.

All three have the exact same response.

I am not terribly good at c#, so I do a lot of things by trial and error

From: Michael Mainer [mailto:[email protected]] Sent: Tuesday, October 3, 2017 8:48 PM To: microsoftgraph/msgraph-sdk-dotnet [email protected] Cc: Jeffrey Childers [email protected]; Mention [email protected] Subject: Re: [microsoftgraph/msgraph-sdk-dotnet] Suspected Bug - OneDrive Copy Item - GatewayTimeout at 10 seconds (#190)

@jchildehttps://github.com/jchilde I'm going to ask about this and get back to you.

By the way, I find it interesting that you use the request builder to create the URL and body, and then HRM to send and get the response. What is your reason for that approach?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/microsoftgraph/msgraph-sdk-dotnet/issues/190#issuecomment-334019885, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AK1m6X70KoKPBMdsQoaty8_-n81tIEPmks5sotWkgaJpZM4Pn872.

jchilde avatar Oct 04 '17 01:10 jchilde

That makes sense to me. There are times to drop back to HRM for sure. Okay, I got back information that this is a known issue. There's nothing we can do on the client-side. Still, while the web request fails with the Gateway Timeout, you should see that the copy operation still succeeds on OneDrive. Can you confirm that the drive item is still copied?

MIchaelMainer avatar Oct 04 '17 17:10 MIchaelMainer

It is still copied Most of the time, but it does seem like there is a max size around 50mb.

Why is this not listed as a known issue and why isn't a max file size declared?

Sent from my iPhone

On Oct 4, 2017, at 1:36 PM, Michael Mainer <[email protected]mailto:[email protected]> wrote:

That makes sense to me. There are times to drop back to HRM for sure. Okay, I got back information that this is a known issue. There's nothing we can do on the client-side. Still, while the web request fails with the Gateway Timeout, you should see that the copy operation still succeeds on OneDrive. Can you confirm that the drive item is still copied?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/microsoftgraph/msgraph-sdk-dotnet/issues/190#issuecomment-334232468, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AK1m6UtqiPvs0ZQeQckKatPE-wamWrwEks5so8I3gaJpZM4Pn872.

jchilde avatar Oct 04 '17 19:10 jchilde

@jchilde I've added this to the known issues doc with this pull request: https://github.com/microsoftgraph/microsoft-graph-docs/pull/1826. I've got a question out about the max file size.

MIchaelMainer avatar Oct 13 '17 18:10 MIchaelMainer