Home

Outlook Mail API: Error 429 after 500 message 'move' requests

%3CLINGO-SUB%20id%3D%22lingo-sub-145086%22%20slang%3D%22en-US%22%3EOutlook%20Mail%20API%3A%20Error%20429%20after%20500%20message%20'move'%20requests%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-145086%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3EWe%20often%20receive%20an%20error%20429%20when%20using%20the%20Microsoft%20Graph%20or%20Outlook%20Mail%20REST%20API%20for%20particular%20actions%20on%20one%20mailbox.%20Error%20429%20seems%20to%20be%20a%20Throtting%20issue%2C%20but%20we%20cannot%20find%20any%20information%20about%20the%20issue%20we%20experience%2C%20because%20it's%20not%20related%20to%20the%20'Rate-Limit'%20throttling%20rule%20documented%20here%3A%20%3CA%20href%3D%22https%3A%2F%2Fblogs.msdn.microsoft.com%2Fexchangedev%2F2017%2F04%2F07%2Fthrottling-coming-to-outlook-api-and-microsoft-graph%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fblogs.msdn.microsoft.com%2Fexchangedev%2F2017%2F04%2F07%2Fthrottling-coming-to-outlook-api-and-microsoft-graph%2F%3C%2FA%3E.%20%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EWe%20are%20now%20able%20to%20reproduce%20this%20with%20the%20following%20step%20below%3A%20(we%20used%20direct%20Outlook%20Mail%20API%20to%20reproduce%20it)%3C%2FSPAN%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CSPAN%3EGet%20number%20of%20items%20in%20the%20Inbox%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EGet%20subfolders%20of%20the%20Inbox%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3ERead%20first%2010%20e-mails%20sorted%20by%20%E2%80%98received%20date%E2%80%99%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EFor%20each%20email%2C%20move%20the%20e-mail%20to%20the%20%E2%80%98processedbox%E2%80%99%20(which%20is%20a%20subfolder%20of%20the%20Inbox).%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EAt%20exactly%26nbsp%3B%20500%20%E2%80%98move%E2%80%99%20actions%20we%20see%20the%20following%20behavior%20of%20the%20API%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CSPAN%3EAfter%20500%20move%20actions%3A%3C%2FSPAN%3E%3CUL%3E%0A%3CLI%3E%3CSPAN%3EError%20500%3A%20%3C%2FSPAN%3E%3CUL%3E%0A%3CLI%3E%3CSPAN%3Ecode%3DErrorMoveCopyFailed%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3Emessage%3DThe%20move%20or%20copy%20operation%20failed.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3CLI%3EThe%20next%20%E2%80%98move%E2%80%99-action%3CUL%3E%0A%3CLI%3E%3CSPAN%3EError%20429%20%3C%2FSPAN%3E%3CUL%3E%0A%3CLI%3E%3CSPAN%3Ecode%3DErrorTooManyObjectsOpened%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3Emessage%3DToo%20many%20concurrent%20connections%20opened.%2C%20The%20process%20failed%20to%20get%20the%20correct%20properties.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EImportant%20to%20mention%20here%20is%20that%20the%20other%203%20request%20(Get%20number%20of%20items%2C%20get%20subfolders%20and%20read%20first%2010%20e-mails)%20are%20still%20working%20after%20this%20and%20return%20the%20correct%20data.%20Only%20on%20the%20move%20action%20we%20receive%20an%20error%20429.%20%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EWe%20tried%20several%20mailboxes%20(shared%20and%20user%20mailboxes)%2C%20same%20issue.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EIt%E2%80%99s%20not%20the%20%E2%80%98Rate%20Limit%E2%80%99-throttling%2C%20because%20the%20header%20returns%20the%20information%20below%20and%20there%20are%20still%20remaining%20requests%2C%20when%20the%20error%20500%20occurs%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3ERate-Limit-Limit%3A%2010000%3C%2FP%3E%0A%3CP%3ERate-Limit-Remaining%3A%209502%3C%2FP%3E%0A%3CP%3ERate-Limit-Reset%3A%202018-01-12T15%3A30%3A26.817Z%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EWe%20currently%20cannot%20find%20any%20Throttling%20documentation%20related%20to%20the%20500%20move%20actions.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EWe%20sometimes%20have%20to%20wait%20for%20more%20than%2030%20minutes%20before%20the%20429%20error%20disappears.%20%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EIs%20this%20a%20bug%20in%20the%20API%3F%20Or%20a%20throttling%20rule%2Fissue%3F%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EAnyone%20experiencing%20the%20same%3F%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-145086%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAPI%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExchange%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-358871%22%20slang%3D%22en-US%22%3ERe%3A%20Outlook%20Mail%20API%3A%20Error%20429%20after%20500%20message%20'move'%20requests%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-358871%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%20we%20are%20actually%20facing%20the%20same%20problem.%20Do%20you%20have%20any%20news%20regarding%20this%3F%20Thank%20you%20in%20advance.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-153258%22%20slang%3D%22en-US%22%3ERe%3A%20Outlook%20Mail%20API%3A%20Error%20429%20after%20500%20message%20'move'%20requests%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-153258%22%20slang%3D%22en-US%22%3E%3CP%3EYes%2C%20429%20is%20the%20HTTP%20error%20code%20%22Too%20Many%20Requests%20-%20%3CSPAN%3EThe%20user%20has%20sent%20too%20many%20requests%20in%20a%20given%20amount%20of%20time%20(%22rate%20limiting%22).%3C%2FSPAN%3E%22%26nbsp%3B%20The%20HTTP%26nbsp%3B%3CSPAN%3Especification%20doesn't%20specify%20how%20the%20server%20identifies%20the%20user%2C%20nor%20how%20it%20counts%20requests%2C%20so%20the%20implementation%20might%20hit%20a%20limit%20earlier%20than%20you%20would%20otherwise%20expect.%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EWe%20don't%20have%20access%20to%20the%20details%20of%20the%20implementation%2C%20and%20it%20might%20change%20from%20time%20to%20time%2C%20so%20depending%20on%20how%20it%20is%20implemented%20you%20might%20also%20get%20a%20500%20thrown%20from%20time%20to%20time%20as%20well.%20I%20am%20not%20surprised%20that%20you%20are%20getting%20rate%20throttling%20even%20though%20the%20headers%20claim%20you%20have%20a%20few%20requests%20to%20spare%2C%20but%20I%20agree%20that%20the%20very%20precise%20Rate-Limit-Remaining%20header%20is%20unhelpful%20if%20it%20is%20not%20accurate%2C%20and%20worth%20raising%20as%20an%20issue.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Ralfh Barten
Occasional Contributor

We often receive an error 429 when using the Microsoft Graph or Outlook Mail REST API for particular actions on one mailbox. Error 429 seems to be a Throtting issue, but we cannot find any information about the issue we experience, because it's not related to the 'Rate-Limit' throttling rule documented here: https://blogs.msdn.microsoft.com/exchangedev/2017/04/07/throttling-coming-to-outlook-api-and-microso....

 

We are now able to reproduce this with the following step below: (we used direct Outlook Mail API to reproduce it)

  • Get number of items in the Inbox
  • Get subfolders of the Inbox
  • Read first 10 e-mails sorted by ‘received date’
  • For each email, move the e-mail to the ‘processedbox’ (which is a subfolder of the Inbox).

 

At exactly  500 ‘move’ actions we see the following behavior of the API:

  • After 500 move actions:
    • Error 500:
      • code=ErrorMoveCopyFailed
      • message=The move or copy operation failed.
  • The next ‘move’-action
    • Error 429
      • code=ErrorTooManyObjectsOpened
      • message=Too many concurrent connections opened., The process failed to get the correct properties.
  • Important to mention here is that the other 3 request (Get number of items, get subfolders and read first 10 e-mails) are still working after this and return the correct data. Only on the move action we receive an error 429.

 

We tried several mailboxes (shared and user mailboxes), same issue.

 

It’s not the ‘Rate Limit’-throttling, because the header returns the information below and there are still remaining requests, when the error 500 occurs:

Rate-Limit-Limit: 10000

Rate-Limit-Remaining: 9502

Rate-Limit-Reset: 2018-01-12T15:30:26.817Z

 

We currently cannot find any Throttling documentation related to the 500 move actions.

 

We sometimes have to wait for more than 30 minutes before the 429 error disappears.

 

Is this a bug in the API? Or a throttling rule/issue?

Anyone experiencing the same?

 

 

2 Replies

Yes, 429 is the HTTP error code "Too Many Requests - The user has sent too many requests in a given amount of time ("rate limiting")."  The HTTP specification doesn't specify how the server identifies the user, nor how it counts requests, so the implementation might hit a limit earlier than you would otherwise expect. 

 

We don't have access to the details of the implementation, and it might change from time to time, so depending on how it is implemented you might also get a 500 thrown from time to time as well. I am not surprised that you are getting rate throttling even though the headers claim you have a few requests to spare, but I agree that the very precise Rate-Limit-Remaining header is unhelpful if it is not accurate, and worth raising as an issue.

 

 

Hi, we are actually facing the same problem. Do you have any news regarding this? Thank you in advance.

Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
35 Replies
Extentions Synchronization
ChirmyRam in Discussions on
3 Replies
flashing a white screen while open new tab
Deleted in Discussions on
14 Replies
Security Community Webinars
Valon_Kolica in Security, Privacy & Compliance on
9 Replies