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

Resuming upload session results in 400 Upload session not found #698

Closed
AnnieChmarak opened this issue Sep 8, 2017 · 2 comments
Closed

Comments

@AnnieChmarak
Copy link

AnnieChmarak commented Sep 8, 2017

Sometimes I have 503 response while uploading a file. I use a resumable upload, so after such response I just try to resume upload session. In most cases session resumes successfully and the file upload continues. But sometimes I recieve 400 response when I try to resume the session.
I want to understade what am I doing wrong. Maybe it is a bug?

Here is a truncated and simplified Fiddler log. Let [FILE_CONTENT] be file content of the specifyed length and [UPLOAD_URL] be the url returned from POST request.

Creating upload session

request

POST https://api.onedrive.com/v1.0/drive/root:/92_32/stress/_stress_od_fiddled/1-2017%20September%2008%20(11.42)_full/.Index/20000/.i/11757.txt.i:/upload.createSession HTTP/1.1

{"item":{"@name.conflictBehavior":"replace","name":"11757.txt.i"}}

reponse

HTTP/1.1 200 OK

{"@odata.context":"https://api.onedrive.com/v1.0/$metadata#oneDrive.uploadSession","uploadUrl":"[UPLOAD_URL]","expirationDateTime":"2017-09-15T05:49:22.733Z","nextExpectedRanges":["0-"]}

Upload a file

request

PUT [UPLOAD_URL] HTTP/1.1
Content-Range: bytes 0-173/174
Content-Length: 174

[FILE_CONTENT]

response

HTTP/1.1 503 Service Unavailable

{"error":{"code":"serviceNotAvailable","message":"Service is temporarily unavailable"}}

Asking about upload state

request

GET [UPLOAD_URL] HTTP/1.1

response

HTTP/1.1 200 OK

{"expirationDateTime":"2017-09-15T05:49:22.733Z","nextExpectedRanges":[]}

Continue uploading file

request

PUT [UPLOAD_URL] HTTP/1.1
Content-Range: bytes 0-173/174
Content-Length: 174

[FILE_CONTENT]

response

HTTP/1.1 400 Bad Request

{"error":{"code":"itemNotFound","message":"Upload session not found","innererror":{"code":"uploadSessionNotFound"}}}

@ificator ificator self-assigned this Sep 8, 2017
@ificator
Copy link
Contributor

ificator commented Sep 8, 2017

It appears as though request that was attempting to commit the final block partially succeeded - it got far enough to coalesce the blocks but not far enough to persist the result. This essentially leaves the session in an unrecoverable state. It's obviously a bug on our side, and we're tracking a fix, however there isn't much you can do other than trying the whole process again.

@patrick-rodgers
Copy link
Contributor

As part of a repository clean up effort we are closing older issues. If this issue remains, please: open a new issue, reference this issue, and provide any additional details that may help in resolution. Thank you for your understanding as we work to improve our responsiveness.

@OneDrive OneDrive locked as resolved and limited conversation to collaborators Feb 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants