We’ve been using shopify admin API (REST) for over a year, but as of this month, we started getting
“Too Many Request” at random.
It looks different because the headers do not include the information documented here:
https://shopify.dev/docs/api/usage/rate-limits
We think this is a bug because:
-
When we get throttled, prior to the event the X-Shopify-Shop-Api-Call-Limit header does not show anything close to the limit.
-
There is no Retry-After header as proposed in the documentation.
-
We have a fibonacci backoff-retry that waits for 1 second, then 2 seconds, then 3 etc. 5 retries total and even after 20 seconds it still fails.
The headers are telling us this might be coming from CloudFlare.
Example:
data: {
errors: [
0: {
extensions: {1}
message: "You have sent too many requests. Try again soon."
}]}
headers: {
alt-svc: "h3=":443"; ma=86400, h3-29=":443"; ma=86400"
cf-cache-status: "DYNAMIC"
cf-ray: "7c910f646b348133-ORD"
connection: "close"
content-type: "application/json"
date: "Thu, 18 May 2023 03:37:11 GMT"
nel: "{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}"
report-to: "{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=[REDACTED]"}],"group":"cf-nel","max_age":604800}"
server: "cloudflare"
server-timing: "cfRequestDuration;dur=29.000044"
transfer-encoding: "chunked"
x-content-type-options: "nosniff"
x-dc: "gcp-us-central1"
x-download-options: "noopen"
x-permitted-cross-domain-policies: "none"
x-request-id: "..."
x-sorting-hat-podid: "231"
x-sorting-hat-shopid: "..."
x-xss-protection: "1; mode=block"
}
Has anybody experienced elevated error rates recently or other strange behavior?