-
Notifications
You must be signed in to change notification settings - Fork 186
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
ConnectionResetError: [WinError 10054] upon uploading large file #42
Comments
#14 Just found this, though a practical usage example would be welcomed. |
Use |
I get 'invalidRequest - API not found' error:
My code (after successful auth):
|
Are you sure that the item ID you inserted is a folder? The error you're getting is usually from that. |
Do you have version 1.0.7 installed? The previous version of the SDK did not support files >100mb. |
Yes, I've just rechecked this. Reinstalled in any case:
Also tried running the script on another device, same error. Clueless. |
I guess we need to debug. Can you add this line to print(request.url, '\n'.join(['{}: {}'.format(k, v) for k, v in request.headers.items()]), '\n', request.method) Run your request and send me back the output. You may want to remove the 'Authorization' header from your comment so no one sees your access token. |
I've added also the print of 'custom_response' object.
NON-WORKING 'upload_async' (small file of 1MB):
WORKING 'upload' (small file of 1MB):
NON-WORKING 'upload_async' (big file of 130MB):
NON-WORKING 'upload' (big file of 130MB):
|
OK a few things:
print(request.url, '\n'.join(['{}: {}'.format(k, v) for k, v in request.headers.items()]), '\n', request.method)
custom_response = HttpResponse(response.status_code, response.headers, response.text)
print(custom_response)
return custom_response Thanks for sticking with me through all this debugging. We'll get it! |
OK, I've upgraded to 1.0.8, now I get a different error
|
Did you change the location of the debug statement? I still can't see the request information. Although it's unlikely to be the problem, Python 3.6 is not supported at this time since it's in alpha. Could you please switch to the latest 3.5 release? This is tested to be working in 3.5 so at this point the issue is probably not with the SDK. |
OK, so I installed Python 3.5 and still get the same error, also I get the very same on my embedded device (ARM7 Netgear R7000):
Yes, I've put the debug statement where you requested, but I think you won't see it, because the script fails beforehand, in the if-else statement, so I've added the debug statement a little before, like this:
This is the output:
I think Onedrive API complains about the header SDK-Version=python-v1.0.8\r\n. |
BTW, I get this ValueError: Invalid header value exception also for an 'upload' method or getting top three elements of root (actually for everything), so maybe it'll be proper to close this issue and open a new one? |
Looks like GH added a line break even though there wasn't one in the editor. That's what I get for committing a change using the Github online editor. Uploaded version 1.0.9 to PyPi. Please give that a shot. Thanks for your patience. |
No problem, I'm glad to help investigating this issue.
|
I believe I see the issue. The underlying problem is that you are mixing path- and resource-based access together. You can read more here: https://dev.onedrive.com/items/upload_post.htm To fix, I would recommend that you use the path to your target file, something like this: client.item(drive="me", path="foo/RoyalTSInstaller.msi").upload_async("./RoyalTSInstaller.msi") Let me know if that works for you. |
I didn't understand much from dev.onedrive.com documentation, but you've identified the problem properly! So, this variations work: Thanks! |
I'm trying to upload a 800mb file, and I get the following error message:
I guess this error is probably due to a limit of the uploaded file size (100mb)?
If so, it would be nice if the SDK checks the file size prior to uploading, and breaks it to chunks, or notifies, or this feature is already implemented?
The text was updated successfully, but these errors were encountered: