Getting 520 origin error on REST API

Ray14
Tourist
15 0 0

I sometimes see an error 520 origin error (cloudflare-nginx) on Shopify REST API.

Does anyone know a way to prevent this error?

Sorry for not giving more details, but I don't have a thing.

 

0 Likes
Visely-Team
Shopify Partner
1836 210 426

This would be a "catch all" response in case the origin server (Shopify) is unable to fulfill the request. I would suggest you logging response headers and share it with Shopify Support team so they can trace it through their logs and identify the root cause.

Sergiu Svinarciuc | CTO @ visely.io
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
- To learn more about the awesome stuff we do head over to visely.io or our blog
0 Likes
Ray14
Tourist
15 0 0

Thanks. I will record response headers when the error occurs and contact Shopify support team and also post the result here if I recall.

0 Likes
nikolay2
New Member
1 0 0

@Ray14 hi, may I ask if you've succeeded in fixing the issue? What was the support team's response?

Thank you!

0 Likes
CodeclockerDev
New Member
30 0 0

Did anyone get a resolution to this?

I also experience this as well when trying to add product metafields via API to shopify. I send a very simple request yet the Shopify REST API CANT respond to the request.

censoring storeUrl from log text but it was sent as normal.

Full Request Text
POST /admin/products/6252975227047/variants/38070837641383/metafields.json HTTP/1.1
Host: *****************.myshopify.com
Accept: */*
Content-Type: application/json
Authorization: Basic MGI0ZDlhNDA1MDQ2YzFlNGExZDU3NWIxMzY4ODhiODk6c2hwcGFfZGNjYTE4MDdkMWZlZTNjMTE3NjU4ZjNjMDZmMjY5M2Y=
Content-Length: 99

{"metafield":{"namespace":"productId","key":"productId","value":"2980.7973","value_type":"string"}}


HTTP/1.1 520 Origin Error
Date: Tue, 16 Feb 2021 21:23:40 GMT
Content-Type: text/html
Content-Length: 179
Connection: keep-alive
Cache-Control: no-store, no-cache
CF-Cache-Status: DYNAMIC
cf-request-id: 084e5333650000af33633fa000000001
Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Server: cloudflare
CF-RAY: 622a5498a8c4af33-KEF
alt-svc: h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400

<html>
<head><title>520 Origin Error</title></head>
<body bgcolor="white">
<center><h1>520 Origin Error</h1></center>
<hr><center>cloudflare-nginx</center>
</body>
</html>

 

0 Likes
Ray14
Tourist
15 0 0

Hey Quinn,

You will need to file up below and contact Shopify support.

Can you provide the following in Raw HTTP format, not images:

  • The API key of the app (do not include the password or the secret)
  • The full request - body and headers - of the request that isn't functioning as expected
  • The full response with headers. If you do not have the X-Request-Id header available, we will need an approximate timeframe (with timezone, i.e. March 25 2020, 2:15pm Eastern time) when the request was made.

Once I have this I can bring it to our contacts with Cloudflare to better understand why this is happening. I'll be in touch with you throughout this process.

And from Cloudflare explaining the general context https://community.cloudflare.com/t/community-tip-fixing-error-520-web-server-is-returning-an-unknown....

Good luck.

0 Likes