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

429 - throttledRequest errors using /createLink endpoint after creating just a few links #1436

Closed
2 of 3 tasks
The-Lion opened this issue Feb 11, 2021 · 18 comments
Closed
2 of 3 tasks
Labels
automation:Closed Needs: Investigation Needs investigation from the area owners.

Comments

@The-Lion
Copy link

The-Lion commented Feb 11, 2021

Category

  • Question
  • Documentation issue
  • Bug

Observed Behavior

Since a while, I am getting 429 - throttledRequest errors when creating a few read-only shared links via the /drives/{driveId}/items/{itemId}/createLink endpoint. It seems to be specific for OneDrive Personal accounts.

{
    "type": "view",
    "scope": "anonymous"
}

Here is the specific response I get

{

  "headers": {
            "retry-after": "3360",
  },
  
  "error": {
            "code": "accessDenied",
            "message": "Too Many Requests",
            "innerError": {
                "code": "throttledRequest",
                "date": "2021-02-11T09:36:01",
                "request-id": "a28f6f2b-b233-47a1-85dd-111da0293500",
                "client-request-id": "a28f6f2b-b233-47a1-85dd-111da0293500"
            }
        }
}

Generally speaking that shouldn't be an issue, however:

  • I get this error if I create only 10 links in ~5 minutes time. Even if no API calls were made that day at all /for this user.
  • The error is also thrown if a sharing link already exists for the file.
  • The Retry-After period is set to ~ 1 hour, which makes it practically impossible to use the backoff mechanism that is implemented to prevent throttling.

Also:

  • I haven't observed this issue until a few weeks ago
  • I can only reproduce this for OneDrive Personal accounts.
  • All other other endpoints are not throttled. So other API requests are successful when the /createLink request is still being throttled.

Steps to Reproduce

Create multiple (>10) shared read-only links via the API on a OneDrive Personal account.

Question

Is this behavior expected and has the throttling threshold indeed been decreased? Or is this a bug in the API itself which has been introduced?

If the limit is indeed this low, it would be a good idea to mention this in the documentation as it limits the use of this specific endpoint.

[ ]: http://aka.ms/onedrive-api-issues
[x]: http://aka.ms/onedrive-api-issues

@ghost ghost added the Needs: Triage 🔍 Needs initial triage assessment label Feb 11, 2021
@ghost
Copy link

ghost commented Feb 11, 2021

Thank you for your contribution to OneDrive API Docs. We will be triaging your incoming issue as soon as possible.

@The-Lion The-Lion changed the title Encountering 429 - throttledRequest errors using /createLink endpoint after creating just a few links 429 - throttledRequest errors using /createLink endpoint after creating just a few links Feb 11, 2021
@Matrino
Copy link

Matrino commented Feb 16, 2021

Hello.

Same behaviour observed here, only for createLink activity, I am able to create max. 13 links, then have to wait for around an hour. Apart from createLink, I read, upload and delete files on regular basis with no problem at all.

Thanks and regards.
Matej

@chackman chackman added Needs: Investigation Needs investigation from the area owners. and removed Needs: Triage 🔍 Needs initial triage assessment labels Feb 19, 2021
@chackman
Copy link
Contributor

Thanks for your feedback. This is currently being investigated internally.

@Matrino
Copy link

Matrino commented Mar 14, 2021

Hi @chackman, any news on this please? Thanks.

@gcarden
Copy link

gcarden commented Mar 15, 2021

Hi @Matrino I work with @chackman at Microsoft, we haven't changed any policies lately, however I can try to take a look at your particular case to identify the reason why your calls are being throttled, can you help me out with the email address that is getting the error? as well as a rough timestamp of when you get the error in UTC? if if happened within the last couple of days it would be desirable, but not required, once I have email and timestamp I can try to look at some of our logs to see which policy is getting triggered.

@The-Lion
Copy link
Author

Hello @gcarden. I am not seeing a way to safely send you an email address via GitHub, so I hope that the following information is sufficient:

    "headers": {
        ...
        "retry-after": "3570",
        ...
    },
    "body": {
        "error": {
            "code": "accessDenied",
            "message": "Too Many Requests",
            "innerError": {
                "code": "throttledRequest",
                "date": "2021-03-16T10:03:55",
                "request-id": "fd19a3f7-4ee2-4e72-8468-a74a7c7b3bc1",
                "client-request-id": "fd19a3f7-4ee2-4e72-8468-a74a7c7b3bc1"
            }
        }
    }

@gcarden
Copy link

gcarden commented Mar 18, 2021

Hi @The-Lion completely understand not sending the email, we can do a trace instead

Go to: https://onedrive.live.com/?v=traceme
Check all the check boxes, and click start trace
Wait 1 minute, then perform the repro for your issue
Send us the paths to the traces in the text boxes:
Once we have the path we can take a look at those traces on our end and should have all the information we need.

image

@The-Lion
Copy link
Author

3AE367261D4DA2BC\2021-03-18_134835

3AE367261D4DA2BC\2021-03-18_134836

@The-Lion
Copy link
Author

@gcarden, any updates on this please? Was the trace I created useful?

@gcarden
Copy link

gcarden commented Mar 31, 2021

My apologies, didn't see the notification until now, yes the traces were very useful! The limit is around number of sharing links created by third party apps, while this limit is not entirely new it was enabled somewhat recently around July of last year, the limit is around 50 Sharing API calls per hour for a given drive, I'm unsure what your scenario is, if you follow the retry time header in the response you should be able to be unblocked after some time, do you expect your code to keep trying to continuously upload files and send sharing links all day to the point that you won't be able to catch up? Please feel free to describe your scenario so we can understand the limitation you are running into a little bit better.

@The-Lion
Copy link
Author

The-Lion commented Apr 1, 2021

Use Case:

I am using the application in a form where users can attach their documents or images. The files will be stored in a user specific folder on OneDrive when the form is submitted. Shared links to the files are created to be included in an email notification to multiple recipients and stored in a database.

  • It is possible that a user attaches >50 files at once in a weekly basis via this form. Or that 5 users each upload 10 files in the same hour coincidentally. No heavy usage of the API but it is just possible that more than 50 shared links have to be created in a hour.
  • The email notification cannot be delayed (at least not for more than a couple of minutes)

Questions:

  1. If the the API endpoint /createLink is limited to 50 calls/hour, why is the API throttling the requests directly after just ~10-20 calls are being made (see the trace I created)? The throttling directly returns a retry header of 1 hour while the limit you describe isn't hit. That seems to be the main problem here.

  2. Why is the /createLink endpoint just limited to 50 calls/hour? I haven't seen such limits on other similar APIs. In most cases the usage (e.g. bandwidth) of the shared links is limited, but not the link creation itself.

  3. Can you please document this API limit on the /createLink page?

@ti55987
Copy link

ti55987 commented Apr 7, 2021

We ran into the same issues here. Here is our scenario:

Use Case

We are building an edtech tool for teachers to assign their assignments from OneDrive to students. Each student will get their own copies so that they can do the assignments individually. The copies will be created in teacher's OneDrive so we use create link to give students permission to edit their own copies.

Given the number of students and the number of assignments that a teacher might have to share, 50 calls/ hour is not possible for the workflow.

Questions

  1. Is it possible to raise the limit given API key? What would be the process here?
  2. Is it possible that we create the copies that can be shared by default so that we don't need to call create share link? I didn't see this option in the documentation though.

@gcarden It would be great that you can provide some help here. Thanks

@The-Lion
Copy link
Author

@gcarden, any updates on the questions asked?

@The-Lion
Copy link
Author

The-Lion commented May 3, 2021

@gcarden, @chackman. It is more than a month ago since your latest reply on this issue. The issue is still present for almost 3 months now, and there are quite some questions asked which aren't answered yet. Is this actually the place to report and discuss this kind of API problems?

I would really appreciate it to get a status update on this.

@AndreyRavkov
Copy link

Hello,
Today I'm also catch this limit for createdLink endpoint. Is there any news about fix plan?
Thanks.

@george-ayris
Copy link

I'm also very interested on updates here @gcarden

@anzhiyu-c
Copy link

I'm also very interested on updates here. Not only createlink but also upload and download restrictions @gcarden

@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.
Labels
automation:Closed Needs: Investigation Needs investigation from the area owners.
Projects
None yet
Development

No branches or pull requests

9 participants