Order Paginate Internal Server Error

Highlighted
Shopify Expert
14 0 3

When using the new cursor based pagination we're receiving a 500 Internal Server Error to some requests.

Roughly 1 in 30.

 

Problem

We are pulling 600 pages of orders with a page size of 100. Roughly every 30 requests (randomly) we receive a response message of 500 internal server error.

 

The example request:

https://xxxxx.myshopify.com/admin/api/2019-10/orders.json?page_info=eyJkaXJlY3Rpb24iOiJuZXh0Iiwic3Rh...

the page info contains:
{"direction":"next","status":"any","financial_status":"paid","created_at_min":"2018-09-04 08:35:58 UTC","created_at_max":"2020-03-04 09:36:03 UTC","last_id":1984396755083,"last_value":"2020-01-17 01:47:19"}

The request was a next page of a List Filter.

 

Weirdly

When we retry the page request it then succeeds moments later. (2+ seconds delay)

 

Can you help us with finding out the problem?

Once we know what the issue is we can feedback to the community library ShopifySharp to get this resolved.

 

I can provide more detail such as the domain if you PM me

META - Shopify Experts
www.meta.co.uk
0 Likes
Highlighted
Shopify Staff
Shopify Staff
1041 140 170

Hey @Tim_Powell,

 

Thanks for reporting. Can you please provide a request ID from the response headers (of a failed/500)?

Notice; Out of office, replies will be delayed until my return. Thanks!
0 Likes
Highlighted
Shopify Expert
14 0 3

@SBD_ 

When using the OrderAPI please see request Id's
Page 168 = 11765aee-7d1a-4184-92a0-82c0788448df
Page 174 = 5e9d4cd3-47e3-4263-8d92-b2236a6ec906
Page 207 = 4c4f4ba0-2146-469d-b4df-6668d708e8c2
Page 219 = 849ff880-f9fc-4b20-8860-2ca453747f65


Total Orders  = 80575
Total Pages    = 323

Page Size       = 250

META - Shopify Experts
www.meta.co.uk
0 Likes
Highlighted
Shopify Staff
Shopify Staff
1041 140 170

Thanks for the details. It looks like a PR is in the works which might resolve this. Keep you posted.

Notice; Out of office, replies will be delayed until my return. Thanks!
0 Likes
Highlighted
Tourist
7 0 1

As a hotfix, just add a handler for the 5xx errors which repeats that call, it is not an error on a specific link, but rather a hiccup in the communication with the Shopify servers.

 

In our case it simply involved not deleting the 'import task' when encountering the 5xx errors.

0 Likes
Highlighted
Shopify Expert
14 0 3

@SBD_  sounds brill

@Saelben ty, we've wrapped it for now, interestingly if we drop the request page size to ~50 we don't see the error. To me it feels like we're hitting a limit, i wonder if the RestAPI actually calls GraphQL, behind the scenes, and it's hitting the rate limit...

META - Shopify Experts
www.meta.co.uk
0 Likes
Highlighted
Tourist
7 0 1

We are running all our requests at 600ms intervals, to avoid the limits. 2019/10 API though, might be some differences.

0 Likes
Highlighted
Shopify Partner
4 0 0

@Tim_Powell I'm experiencing the same behavior on the products endpoint. The default page size (50) seems to work just fine but it kind of defeats the purpose of making fewer calls with larger pages.

 

@SBD_ Has your team found a reason for this happening? 

0 Likes
Highlighted
Shopify Staff
Shopify Staff
1041 140 170

@Jonas10, no update yet - I'll update this thread when there's more information

Notice; Out of office, replies will be delayed until my return. Thanks!
0 Likes