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

HTTP request returned status code 429 (Too Many Requests) #133

Closed
lamyergeier opened this issue Aug 20, 2018 · 20 comments
Closed

HTTP request returned status code 429 (Too Many Requests) #133

lamyergeier opened this issue Aug 20, 2018 · 20 comments
Labels
Bug Something isn't working Fixed Waiting on Response

Comments

@lamyergeier
Copy link

lamyergeier commented Aug 20, 2018

I tried to download contents of my Onedrive to my harddrive. It did download some data, but after a while I am getting this error:

Onedrive.OneDriveException@src/onedrive.d(597): HTTP request returned status code 429 (Too Many Requests)
----------------
src/onedrive.d:28 void onedrive.OneDriveApi.checkHttpCode() [0x4a42ac78]
src/onedrive.d:395 void onedrive.OneDriveApi.download(const(char)[], immutable(char)[], long) [0x4a42a2d8]
src/onedrive.d:131 void onedrive.OneDriveApi.downloadById(const(char)[], const(char)[], immutable(char)[], long) [0x4a428d12]
src/sync.d:648 void sync.SyncEngine.downloadFileItem(itemdb.Item, immutable(char)[]) [0x4a436026]
src/sync.d:594 void sync.SyncEngine.applyNewItem(itemdb.Item, immutable(char)[]) [0x4a435b7b]
src/sync.d:568 void sync.SyncEngine.applyDifference(std.json.JSONValue, immutable(char)[], bool) [0x4a435a27]
src/sync.d:432 void sync.SyncEngine.applyDifferences(immutable(char)[], const(char)[]) [0x4a434f46]
src/sync.d:200 void sync.SyncEngine.applyDifferences() [0x4a434065]
src/main.d:401 void main.performSync(sync.SyncEngine, immutable(char)[], bool, bool, bool) [0x4a4199f2]
src/main.d:269 _Dmain [0x4a41927b]
  1. How long should I wait?
  2. Or is there any workaround?
  3. Does changing IP helps?
  • I am in a subnetwork, and changing IP didn't help me!
@abraunegg abraunegg added Bug Something isn't working Investigating labels Aug 20, 2018
@abraunegg
Copy link
Owner

abraunegg commented Aug 23, 2018

@anishmittal2020
Can you please provide some additional details here as your bug report is incomplete, specifically:

  • Application version: Output of onedrive --version
  • OneDrive Account Type
  • How are you running the 'onedrive' client - what is the full command you are using?

Additionally what country are you located in?

@abraunegg
Copy link
Owner

abraunegg commented Aug 23, 2018

Further to this, it seems that the issue is being hit when attempting to download files. Are you seeing this issue also when uploading files?

@lamyergeier
Copy link
Author

$ onedrive --version
onedrive v2.1.1-4-g448b624

Account type: Premium version expired. But have access to data upto October.

onedrive --resync --download --verbose --synchronize --syncdir /xxxx/xxx/xxxxx/Onedrive

I am just downloading the files.

@lamyergeier
Copy link
Author

Germany

@abraunegg
Copy link
Owner

abraunegg commented Aug 24, 2018

Thanks.

First suggestion, there is no real reason to use --resync for your task.

What that is doing - is each time you run the application - is it deletes the local database. Therefor the client will make many more requests revalidating each and every file. This will be a contributing factor for you

abraunegg added a commit that referenced this issue Aug 24, 2018
* Inital work on adding a retry method for downloading files when a HTTP request returned status code 429 (Too Many Requests) response is returned from OneDrive
@abraunegg abraunegg added In Progress Currently being worked on and removed Investigating labels Aug 24, 2018
@abraunegg
Copy link
Owner

@anishmittal2020
Can you please rebuild your client and validate the fix for your issue by using this PR:

git clone https://github.com/abraunegg/onedrive.git
cd onedrive
git fetch origin pull/138/head:pr138
git checkout pr138
make
make install

If you can help test and provide feedback that would be greatly appreciated as I am unable to trigger a 429 event locally.

@abraunegg
Copy link
Owner

@anishmittal2020
Any further update on this issue?

abraunegg added a commit that referenced this issue Aug 27, 2018
…sue #133) (#138)

* Adding a retry method for downloading files when a HTTP request returned status code 429 (Too Many Requests) response is returned from OneDrive
@abraunegg
Copy link
Owner

PR merged

@abraunegg abraunegg added Fixed and removed In Progress Currently being worked on labels Aug 27, 2018
@lamyergeier
Copy link
Author

Hi, I installed latest version today. After 20 minutes of download I get this message "OneDrive returned a 'HTTP 429 - Too Many Requests' - gracefully handling error"

@abraunegg
Copy link
Owner

Please can you provide a verbose log of the error.

Is it still failing and stopping syncing or is it gracfully continuing?

@lamyergeier
Copy link
Author

lamyergeier commented Sep 5, 2018

I get message when I do this onedrive --resync --download --verbose --synchronize --syncdir /mnt/Home2/Cloud/Onedrive

This time I had to resync. I get message like this:
image

Files does get created but are of 0 bytes.

@abraunegg
Copy link
Owner

Hi - as previously advised - do not use --resync as this deletes your local database and significantly increases the rate of communication with OneDrive.

@lamyergeier
Copy link
Author

lamyergeier commented Sep 5, 2018

To limit the download I specify only few folders in resync (In the file sync_list). That's why I was doing that. Is it ok to do it in this case?

@lamyergeier
Copy link
Author

I do --resync only when I change the sync_list

@abraunegg
Copy link
Owner

No .. everytime you use --resync it deletes the database thus has no record of what your trying to download and sync. If you are then trying to just sync a couple of folders - you are causing trouble for yourself

Dont use --resync unless your doing a resync of your entire OneDrive

@lamyergeier
Copy link
Author

But it was mentioned in the README.md Note: after changing the sync list, you must perform a full synchronization by executing onedrive --resync. So, better should I leave sync_list blank?

@abraunegg
Copy link
Owner

Yes .. that advice is based on the Skilion code base.

Leave sync_list blank and let it perform a full sync to get your data

@lamyergeier
Copy link
Author

lamyergeier commented Sep 5, 2018

Actually, I have almost 800 GB of Data, which I don't expect to get downloaded in one go. Please say if the following workflow would work:

  1. I start downloading without resync.
  2. When I decide to stop it for a while. I just press Ctrl+z
  3. Later, when I am available to download I Goto step 1.

Also, I am having this hunch that onedrive server might be blacklisting me for few days, after this incident. Because I observe that once, I start to get this error. If I restart download, the error gets displayed after downloading 2 or 3 files.

@abraunegg
Copy link
Owner

If I restart download, the error gets displayed after downloading 2 or 3 files.

This is because you are using --resync - what that option does is deletes the local database, so the client will then revalidate every file you have downloaded thus far.

The Skilion code had no error handling. The advice there was that whenever there was a download issue or changing a configuration item to 'resync' - which all it does is delete the local database so the client has no idea of what you have downloaded - dont use that option.

When I decide to stop it for a while. I just press Ctrl+z

This is WRONG. CTRL+Z will sleep the process, not stop it. You need to use CTRL-C to stop the program.

@lock
Copy link

lock bot commented Jan 5, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Jan 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Something isn't working Fixed Waiting on Response
Projects
None yet
Development

No branches or pull requests

2 participants