502 - Bad Gateway error in Order API for Shop

New Member
4 0 0

Hi there,

the Shopify LiveChat Support has redirected me to the forums.

 

I keep (randomly) receiving a 502-BadGateway error from the Shopify Order API.

From what I can see this is only occuring for one specific shop we are working with (although the Shopify Status Page does not mention any problems).

 

Is there a Shopify Developer here who can have a look at this?

 

The error happens quite frequently (every 3 or 4 requests) and blocks us from preparing an important accounting export.

 

Thanks!

0 Likes
Shopify Staff
Shopify Staff
96 17 20

Hey @ludwig-eisenbl ,

 

We can definitely do our best to help you troubleshoot why this error is happening. Could you please provide the value of the "X-Request-ID" header from your bad API responses? With this value we can search through our logs and better understand why this error is occurring.

 

If I had to make an initial guess as to why you may be receiving that error, usually a 502 error from our API means that you had requested too much information through the API and it caused the SQL query on our end in order to get that data to take too long and eventually time out. So the solution to this would be to request less data through the API request, or adjust the parameters of your request to make the query more efficient. However if you can provide the value of the X-Request-ID header it would help me confirm is my suspicions are true or not

 

 

Hassain | Developer Support Specialist @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

1 Like
New Member
5 0 0

I am having the same issue. All my other sites are downloading just fine however my shopify store is coming with a 502 bad gateway error

 

it is affecting my business we have tried to trouble shoot many things on the shipworks side with no avail.

The same account added to a different computer is also having the same issues so i know it is not only on my computer side. 

 

arsala
0 Likes
New Member
5 0 0

here is an image 

 

shipworks error.png

arsala
0 Likes
New Member
5 0 0

This email is a follow up to ticket #36432 regarding the Shopify Downloads. Error we are receiving: 502 Bad Gateway

Steps attempted for fix:
-PC Restart
-Readded app on Shopify backend
-Regenerated Shopify Token
-Tried switching the fulfillment location
-Ran trace routes to api.shopify.com with about a 50% loss
-Tried access Shopify store from different computer
-Found Cloudflare is re-routing California city



Please help us to determine what is causing the issue of Oxford Diamond Co Shopify store's 502 Bad Gateway download error, thank you!

Let us know if you require any additional information, thank you.  

arsala
0 Likes
New Member
5 0 0

also tried deleting shipworks app and re installing the token

arsala
0 Likes
New Member
5 0 0

i currently have a ticket open as well

 

Your ticket ID is 14892704.

arsala
0 Likes
New Member
4 0 0

Hi Hassain,

thank you for your quick and insightful reply.

Indeed, we are querying the Order API for a very broad set of data including paging for the last 3 months (with the max. number of results == 250).

Thats because we need all this data for an accounting export and it has worked very well for the last 10 months.

 

Unfortunately, we do not log the Shopify response headers on our servers, so I can't provide a Request ID at this time but will try to get one if the error persists. The store where this happens most of the time is "bergmensch.myshopify.com", although I have seen the error for other (Germany) based stores in the meantime.

 

Since our customers need those reports urgently, we have now implemented a retry-mechanism as a fallback strategy. It seems like after the first request the result is available (cached?) and the second request goes through.

Also, yesterday late evening (Berlin time), the requests also succeeded without any errors, so I guess this might be a general server-load issue?

 

Thanks and Best Regards,

Ludwig

0 Likes
Shopify Staff
Shopify Staff
96 17 20

Hey @ludwig-eisenbl ,

 

Yes, we do cache the results of the query. So even if you timeout and get a 502 the first time, the second time you make the request most of the data will already be cached so you are more likely to get all of the data back without timing out this time. And yes, based on current server/platform load it can effect if your query for data will timeout or not. So the re-try you are performing is good practice. Other good practices for avoiding API timeouts include requesting for less data at one time, and using pagination in your API request (https://help.shopify.com/en/api/guides/paginated-rest-results)

 

Hey @arsala_halari ,

 

I see you have an open Support ticket already with ShipWorks and Shopify support staff, so I am sure they will do their best to help resolve this issue for you

 

Hassain | Developer Support Specialist @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

0 Likes