Closed
Description
We have a production app which has Call Log and Read Messages permissions. For many messages, we are able to retrieve the message details. For some, however, we get a retry followed by a failure.
Such as this message: https://platform.ringcentral.com/restapi/v1.0/account/346124008/extension/346247008/message-store/748682490016
message_uri = "https://platform.ringcentral.com/restapi/v1.0/account/346124008/extension/346247008/message-store/748682490016"
response = client.http.get do |req|
req.url lead.message_uri
end
Then, I get the following perplexing series of messages:
W, [2017-06-12T09:48:34.397029 #25438] WARN -- : You have been rate limited. Retrying in 60 seconds...
W, [2017-06-12T09:48:35.397205 #25438] WARN -- : 60...
W, [2017-06-12T09:48:40.398032 #25438] WARN -- : 55...
W, [2017-06-12T09:48:45.398863 #25438] WARN -- : 50...
W, [2017-06-12T09:48:50.399689 #25438] WARN -- : 45...
W, [2017-06-12T09:48:55.400518 #25438] WARN -- : 40...
W, [2017-06-12T09:49:00.401316 #25438] WARN -- : 35...
W, [2017-06-12T09:49:05.402063 #25438] WARN -- : 30...
W, [2017-06-12T09:49:10.402881 #25438] WARN -- : 25...
W, [2017-06-12T09:49:15.403729 #25438] WARN -- : 20...
W, [2017-06-12T09:49:20.404500 #25438] WARN -- : 15...
W, [2017-06-12T09:49:25.405330 #25438] WARN -- : 10...
W, [2017-06-12T09:49:30.406249 #25438] WARN -- : 5...
W, [2017-06-12T09:49:34.407022 #25438] WARN -- : Retrying...
=> #<Faraday::Response:0x007f1ef4b29a48 @on_complete_callbacks=[], @env=#<Faraday::Env @method=:get @body={"errorCode"=>"CMN-301", "message"=>"Request rate exceeded", "errors"=>[{"errorCode"=>"CMN-301", "message"=>"Request rate exceeded"}]} @url=#<URI::HTTPS https://platform.ringcentral.com/restapi/v1.0/account/346124008/extension/346247008/message-store/748682490016> @request=#<Faraday::RequestOptions (empty)> @request_headers={"User-Agent"=>"ringcentral-sdk-ruby/2.1.0 ruby/2.3.1 x86_64-linux", "RC-User-Agent"=>"ringcentral-sdk-ruby/2.1.0 ruby/2.3.1 x86_64-linux", "SDK-User-Agent"=>"ringcentral-sdk-ruby/2.1.0 ruby/2.3.1 x86_64-linux", "Authorization"=>"Bearer U0pDMDFQMDdQQVMwMHxBQUNVT1lPZGVaaFZ1ek1yNWp4YkdrTmhiWVRlR3kxbDVtTTh2TWJWTUNkelRKdHhRVjE2VWNzRnpNVGlBN1RfdUhaNF9QWWRPMEVYNEhPV3FzbEwwTUtuMFBGMUVfcGdXQ3pFSkNZMWxXNnVxamVYbXlNT1RibFU2R21FWE1EcVBPd3dEY3NJUXNrNHFvLWlCTnp2aVZCdjVRRVlGOGg0VWRyekVBVlhXSWkzV2h4THVQZW9wZmFieG9oT28yUDdGY3N8SkRpS0dBfE9GNFlRX1dwZE1SNHoyVno2UXZ0WFE"} @ssl=#<Faraday::SSLOptions verify=true> @response=#<Faraday::Response:0x007f1ef4b29a48 ...> @response_headers={"server"=>"nginx/1.10.2", "date"=>"Mon, 12 Jun 2017 09:49:56 GMT", "content-type"=>"application/json", "content-length"=>"161", "connection"=>"close", "x-rate-limit-group"=>"light", "x-rate-limit-limit"=>"50", "x-rate-limit-remaining"=>"50", "x-rate-limit-window"=>"60", "retry-after"=>"60", "www-authenticate"=>"Bearer realm=\"RingCentral REST API\", error=\"CMN-301\", error_description=\"Request rate exceeded\"", "content-language"=>"en", "routingkey"=>"SJC01P07", "rcrequestid"=>"7db9fc62-4f54-11e7-94f2-005056af6d4e"} @status=429 @reason_phrase="Too Many Requests">>
How have we possibly been "rate limited" or submitted "Too Many Requests", when we have x-rate-limit-remaining
of 50?