Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graph 5.x Download large file over 2GB have issue #1954

Closed
dev-tony-hu opened this issue Jun 7, 2023 · 2 comments · Fixed by #1986 or #2130
Closed

Graph 5.x Download large file over 2GB have issue #1954

dev-tony-hu opened this issue Jun 7, 2023 · 2 comments · Fixed by #1986 or #2130

Comments

@dev-tony-hu
Copy link

Describe the bug
Graph 5.x Download large file over 2GB have issue
When I trying to use graph DriveItem/Content to download large file content, I see the error below.

System.Net.Http.HttpRequestException: Cannot write more bytes to the buffer than the configured maximum buffer size: 2147483647.
Stack Trace: 
HttpClient.g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
HttpClientRequestAdapter.GetHttpResponseMessage(RequestInformation requestInfo, CancellationToken cancellationToken, Activity activityForAttributes, String claims)
HttpClientRequestAdapter.SendPrimitiveAsync[ModelType](RequestInformation requestInfo, Dictionary2 errorMapping, CancellationToken cancellationToken) ContentRequestBuilder.GetAsync(Action1 requestConfiguration, CancellationToken cancellationToken)
GraphDriveService.DownloadFileByIdAsync(String driveId, String driveItemId, RangeHeaderValue range, String eTag, CancellationToken cancellationToken) line 59
GraphDriveService.DownloadFileByIdAsync(String driveId, String driveItemId, CancellationToken cancellationToken) line 31
GraphDriveServiceTests.DownloadFileTest3() line 87
ThreadOperations.ExecuteWithAbortSafety(Action action)

To Reproduce
Use Graph SDK to download drive file over 2GB

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

@ghost ghost added the Needs: Triage label Jun 7, 2023
@NickDarvey
Copy link

@dev-tony-hu, I think the developers on this repo are going to say to use the 'download a large file from OneDrive' method.

I'm guessing you're receiving this error because the underlying HttpClient is sending the request with the default parameter of HttpCompletionOptions.ResponseContentRead meaning the entire response is buffered. I don't believe there is a way to override this so you'd need to drop back to using HttpClient directly.

See also:

@Dethras
Copy link

Dethras commented Jun 23, 2023

@andrueastman - Do you have an estimate in which version will this fix be released in?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants