Happening Now! Exclusive AMA: Improving your Return Management with Shopify Experts | Post your questions to be answered by our team!

Cart API Unresponsive - 502 Error after 30 seconds

Solved

Cart API Unresponsive - 502 Error after 30 seconds

buildpath
Shopify Partner
59 11 20

Hi,

 

My client's store seems to be affected by an internal issue on Shopify's infrastructure. 

I'm testing with the default fresh Dawn theme and no apps.

  • Sometimes the store doesn't load at all. Most of the time it loads fast.
  • Around 50% of the time, add to cart/delete from cart/etc/ do not work because there is no response from Cart API. The headers and payload are correct but it just waits for around 30 seconds with no response, until eventually instead of cart response JSON, Shopify sends an HTML page saying "There was a problem loading this website" and the request shows it ended in a 502 error.

My own store and my other clients' stores don't have this issue at all.  I've never encountered this before either. I can only conclude that just like any other cloud hosting platform, there is some isolated issue on their infrastructure which is only affecting this client's store, along with a small number of other stores under the same VM or hypervisor or whatever it would be.

Can anyone provide any insight? Shopify chat support has forwarded to "technical team" but I'm not feeling hopeful.

Ecom entrepreneur since 2004 | Shopify App developer since 2021 | Shopify merchant and theme developer since 2016
Accepted Solution (1)
buildpath
Shopify Partner
59 11 20

This is an accepted solution.

Hi Saik! Have you double checked your DNS settings for your domain?  I didn't have access to these initially and the client sent me a screenshot of his DNS records and everything looked ok. But somehow there was another A record set to name cheap IP elsewhere in the settings so I had no idea about it. It caused intermittent downtime and was not shopifys fault after all, thankfully. He removed the extra DNS A record and prob solved. Hope this helps!

Ecom entrepreneur since 2004 | Shopify App developer since 2021 | Shopify merchant and theme developer since 2016

View solution in original post

Replies 3 (3)

Saik
Visitor
2 0 0

I'm having this exact problem, my store is quite new and whenever I press add to cart it loads for 30 seconds and then gives me these errors in console:

shop_events_listener-65cd0ba3fcd81a1df33f2510ec5bcf8c0e0958653b50e3965ec972dd638ee13f.js:1          POST https://hella-hot.com/cart/add 502
e.fetch @ shop_events_listener-65cd0ba3fcd81a1df33f2510ec5bcf8c0e0958653b50e3965ec972dd638ee13f.js:1
e.fetch @ browser.modern.js:1
onSubmitHandler @ product-form.js?v=24702737604959294451670346923:36

 

product-form.js?v=24702737604959294451670346923:66 SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON
(anonymous) @ product-form.js?v=24702737604959294451670346923:66
Promise.catch (async)
onSubmitHandler @ product-form.js?v=24702737604959294451670346923:65

 

Note this seems to happen more often on mobile, and in chromes inspection when I the toggle device toolbar, if I try it through desktop it seems to work fine more often, though it might just be chance.

On desktop if it doesn't work it gives these messages: 

Failed to load resource: the server responded with a status of 502 ()

and: 

SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON
(anonymous) @ product-form.js?v=24702737604959294451673189840:66

 

And lastly, often times after I refresh the page the product still gets added to cart even though it was loading forever.

I'm using the colorblock Shopify theme, I've also tried installing just the base theme and trying on it but it was the same problem.

 

buildpath
Shopify Partner
59 11 20

This is an accepted solution.

Hi Saik! Have you double checked your DNS settings for your domain?  I didn't have access to these initially and the client sent me a screenshot of his DNS records and everything looked ok. But somehow there was another A record set to name cheap IP elsewhere in the settings so I had no idea about it. It caused intermittent downtime and was not shopifys fault after all, thankfully. He removed the extra DNS A record and prob solved. Hope this helps!

Ecom entrepreneur since 2004 | Shopify App developer since 2021 | Shopify merchant and theme developer since 2016
Saik
Visitor
2 0 0

I've checked my DNS records and seems that there isn't any other A record besides the Shopify IP one, besides that I only have CNAME records for Shopify and the Zoho mailing service, and lastly MX Records.

 

Maybe I should also send you my DNS settings? I don't know much about that sort of thing.