Getting 502 Bad Gateway when listing orders

ClementBR
Shopify Partner
110 2 18

We're working with hundreds of shops but for some reason there is a particular store for which listing orders via the REST API always returns a Shopify error with HTTP 502 Bad Gateway.

 

Could someone please investigate why that is?

 

Example Request-Id: 

fdcd9106-4a2e-4a51-a658-6f25939b723f

Thanks

0 Likes
SBD_
Shopify Staff
Shopify Staff
1044 141 186

I'm able to replicate. I've raised this internally, keep you posted.

 

For the mean time, try reducing the limit.

0 Likes
ClementBR
Shopify Partner
110 2 18

Thanks @SBD_ 

 

You might have noticed that we use a limit of 100, quite a bit lower from the maximum of 250.

 

Strangely enough, I'm able to run the same query successfully from my local machine, but we get a 502 every single time from our app's server.

 

Looking forward to your findings, and hopefully resolution.

0 Likes
SBD_
Shopify Staff
Shopify Staff
1044 141 186

Interesting, the logs are showing:

 

/admin/api/2019-10/orders.json?status=any&since_id=0&limit=250

 

Strangely enough, I'm able to run the same query successfully from my local machine

Good to know. Thanks I'll pass the info along.

0 Likes
ClementBR
Shopify Partner
110 2 18

You're right,  please ignore my previous message.

I can actually reproduce locally, with limit 250 and 100. If I use limit of 50, it works.

 

Are there any chance this will get fixed, or do we have no choice but to lower our limit?

0 Likes
SBD_
Shopify Staff
Shopify Staff
1044 141 186

I can actually reproduce locally, with limit 250 and 100. If I use limit of 50, it works.

Same here.

 

Are there any chance this will get fixed, or do we have no choice but to lower our limit?

The lower limit is just a temporary workaround. Can't set an ETA but keep you posted.

0 Likes
JeffTalbot
Shopify Partner
12 0 0

Was there any update on this? We are seeing these errors even when using a limit of 50.

0 Likes

We're seeing the same thing as well only for 1 store which only started on August 20 (there was a partial Shopify outage on this date which does make me wonder if it's somewhat related).

We retry each API request multiple times for 5xx errors and we do get the "Bad Gateway" message once in a while for other stores as well but they almost always resolve after 1 retry (sometimes 2).  But for this particular store, it just keeps happening multiple times in a row.

It works fine if we change the date filter to a narrower data range, though, so it seems like possibly a database performance issue where the query is taking a long time to process and the API times out before it returns the results.

One thing that stands our with this store is their orders typically have a lot of line items. Would having many line items in an order cause much heavier queries (perhaps due to table joins)?

Co-Founder / Developer at Highview Apps
Our Shopify Apps: EZ Exporter | EZ Inventory | EZ Importer | EZ Notify | EZ Fulfill
0 Likes