-
Notifications
You must be signed in to change notification settings - Fork 134
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
Upload Large File via LargeFileUploadTask not working #1806
Upload Large File via LargeFileUploadTask not working #1806
Comments
The Mistake is at this point .byDriveItemId("root/fileName") |
I always get the return code 400 when uploading.
or
or
If I use the method to upload small files, it works well
|
Hi @araneolus |
Which error do you got ? Item already exists, or a DateTimeException ? |
Hi @araneolus |
You have to use the com.microsoft.kiota Version 1.0.2. |
At the console I see following Debug Message, before I receive the 400 error code
|
Hi @araneolus |
Hi @araneolus |
You are now as far along as I am. Welcome to the club :-) |
This is the structure of the 400 Response |
Hi @Ndiritu |
Hi @ihudedi , |
Hi @ramsessanchez |
Hi @ramsessanchez |
Hi @ihudedi. With the new version of microsoft-graph 6.4.0 and microsoft-kiota 1.0.5, the first bytes of the file are loaded, but then I receive the error: java.lang.IndexOutOfBoundsException No success here yet :(... Any successes out there? |
Hi @ffcdf |
@ihudedi , we have updated the kiota-java dependencies in graph-core. Please expect to see these changes reflected on the next version of the sdk, or manually update your project to use graph-core 3.1.6. Follow up if issues persist. |
Hi @ramsessanchez |
I am running into the same issue when uploading large files using code from here I am using microsoft-graph 6.4.0 and kiota 1.0.6. |
Hi @ramsessanchez |
Hi everyone, The upload seems to be working in most cases, while some services reply with 200/201 and a response body (which is what the current implementation handles properly), others reply with 201 and no response body. The fix will be to check for a content-length header prior to reading the body, and return early if none is present/value is zero. In addition to that, we'll work to triple check the implementation matches the dotnet implementation's behaviour since it's been in production for over a year now, and the adoption is much larger than java (exposing it to more potential use cases). Thank you everyone for your patience while we take the time to get it right for good, and sorry again about the inconvenience caused. |
Hi In my case, it returns 400 ( Bad request ) with this example: https://learn.microsoft.com/en-us/graph/sdks/large-file-upload?tabs=java It is very frustrating because the HTTP responds only with status code 400. No message, nothing. I wonder why it is a bad request. |
Helper classes as follows. 1. Helper for uploading files in chunks. 2. Helper for downloading files in chunks. 3. HttpClient for some parts where ms graph falls short and in one api uploading in chunks has a known bug open @ microsoftgraph/msgraph-sdk-java#1806. 4. Object containing write info done.
Hi @baywet |
@baywet |
Hi @baywet @Ndiritu @ramsessanchez |
@ihudedi I want to be clear regarding timelines and expectations here: |
This morning I have tried the Version 1.1.1 of kiota but I got still an error by upload huge files.
|
Hi @baywet Seems that when working with chunks the chunkInputStream in LargeFileUploadTask always set the begin instead of 0 every time to store to the buffer increase it every slice so the begin can be greater than the buffer. If I modified the begin to be zero the upload succeeded. Thanks, |
Thanks everyone for trying the new version and reporting the results, it helps! |
Hi @baywet,
in my case it happens for files that are fully uploaded in one slice, it looks that sometimes (not always) while trying to updateSesssionStatus, the uploadSession is not there any more. The body of the response is: {"error":{"code":"itemNotFound","message":"The upload session was not found"}} I'm on v.6.5.1. |
There is also an open ticket for this issue at |
Hi @baywet @ffcdf |
Hi @ihudedi. The first idea was actually this. However, following @Ndiritu's suggestion, a new commit and a new pull request were made that resolved the error without significant changes. The correction basically consists of changing the line:
for:
I believe that the next version of msgraph-sdk-java-core will already bring this correction. |
Hi @petrhollayms |
My example is from the document. Why do I sometimes succeed when uploading files: May I ask what the reason is? I spent a lot of time but there was no result |
Hi @lllllllhz |
@ihudedi |
@ihudedi, another cause of the exception after the upload is specifying the wrong expected return type on successful completion of the upload task. For OneDrive uploads, the return type should be a I realize this may have been guided by our Upgrade Guide code sample. There's a fix to point to the docs for an accurate sample. |
Hi @Ndiritu
The error of general exception is always appeared when the size has chunks ( file size bigger than the chunk size) com.microsoft.kiota.ApiException: generalException When I rerun the code for the same file exists the error doesn't exists for DriveItem and DriveItemUploadableProperties |
Hi,
I use your example and it's failed
I am failing when trying to create UploadSessin
I use in byDriveItemId also your example ("root/fileName" and it's not working
Thanks,
Itay
The text was updated successfully, but these errors were encountered: