Why am I seeing increased 502 Bad Gateway errors when using APIs?

SergioYamada
Shopify Partner
3 0 3

We have noticed an increase of 502 Bad Gateway Errors when calling different APIs (admin/api/2022-07/graphql.json). Examples:

 

- order(id: "gid://shopify/Order/${orderId}")
- query resellerStoreData($customerId: ID!) {
        customer(id: $customerId) {
query productVariantNodes($ids: [ID!]!) {

 

<html>
<head><title>502 Bad Gateway</title></head>
<body>
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx</center>
</body>
</html>

Reply 1 (1)

Cedcommerce
Shopify Expert
718 76 113

Hello @SergioYamada

 

Here we have listed the possible scenarios that might be the reason behind a 502 error response when you call API.

 

  1. Shopify API can get overloaded so you can try adding a delay in calling each API.
  2. If you are using an app proxy then make sure it has the correct endpoints.
  3. You might check your code if it requests the same API multiple times, this may overload the Shopify server and it will not return any response.



Note: API should return the data within 90 seconds, else, you need to contact Shopify support.

 

Hope it helps, let us know if you need any other help. 

 

Regards, 

CedCommerce

CedCommerce || Shopify Expert
- Let us know if our reply is helpful for you. Like it.
- Was your question answered? Mark it as an accepted solution.
- For further discussion contact: Email ID- apps@cedcommerce.com
- Whatsapp:- Join Here