GraphQL API productCreate mutation return Cloudflare error 520

Hi Shopify Team,

I executed a productCreate mutation and the server responded an error with status 520, please help me solve this problem.

The query I ran:

createProductGraphQL = """
	mutation productCreate($input: ProductInput!) {
		productCreate(input: $input) {
			product {
				id
				images(first: 50) {
					edges {
						node {
							id
							altText
						}
					}
				}
			}
			userErrors {
				field
				message
			}
		}
	}
"""

Response header from the server:

{
   "Date":"Mon, 01 Feb 2021 03:42:46 GMT",
   "Content-Type":"text/html; charset=UTF-8",
   "Transfer-Encoding":"chunked",
   "Connection":"keep-alive",
   "Set-Cookie":"cf_use_ob=0; path=/; expires=Mon, 01-Feb-21 03:43:16 GMT",
   "X-Frame-Options":"SAMEORIGIN",
   "Cache-Control":"private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0",
   "Expires":"Thu, 01 Jan 1970 00:00:01 GMT",
   "CF-RAY":"61a8a95898902a63-IAD",
   "Server":"cloudflare"
}

Response text:


# There was a problem loading this website

Try refreshing the page.

If the site still doesn't load, please try again in a few minutes.

Refresh Page

# Web server is returning an unknown error

There is an unknown connection issue between Cloudflare and the origin web server. As a result, the web page can not be displayed.

- Ray ID: 61a8a95898902a63

- Your IP address: 18.225.5.118

- Error reference number: 520

- Cloudflare Location: Ashburn

Error happened at 2021-02-01T10:42:46.626+07:00

Can you perform a test GQL request in the GraphiQL app and see what comes back? Sometimes the Cloudflare kickbacks can be due to false positive IP blocks on that provider’s end. Especially if you are consistently getting the error and it’s not an anomaly.

I got the same error again, this time the query is productUpdate mutation. I already executed this query multiple times before and it works fine. Still don’t know why this happened.

query string:

"""
            mutation productUpdate($input: ProductInput!) {
                productUpdate(input: $input) {
                    product {
                        id
                    }
                    userErrors {
                        field
                        message
                    }
                }
            }
        """

query variables:

{
                    "input": {
                        "id": product["graphqlID"],
                        "title": product["title"],
                        "descriptionHtml": product["description"],
                        "seo": {
                            "title": product["title"],
                            "description": product["description"]
                        },
                        "productType": product["productTypeName"],
                        "options": productOptions,
                        "variants": productVariants
                    }
                }

response status: 520

response time: 2021-03-26T10:33:35.007+07:00

response headers:

{'Date': 'Fri, 26 Mar 2021 03:33:34 GMT', 'Content-Type': 'text/html; charset=UTF-8', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Set-Cookie': 'cf_use_ob=0; path=/; expires=Fri, 26-Mar-21 03:34:04 GMT', 'X-Frame-Options': 'SAMEORIGIN', 'Cache-Control': 'private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0', 'Expires': 'Thu, 01 Jan 1970 00:00:01 GMT', 'CF-RAY': '635d51257ebf5cb3-IAD', 'Server': 'cloudflare'}

response text:


# There was a problem loading this website

Try refreshing the page.

If the site still doesn't load, please try again in a few minutes.

Refresh Page

# Web server is returning an unknown error

There is an unknown connection issue between Cloudflare and the origin web server. As a result, the web page can not be displayed.

- Ray ID: 635d51257ebf5cb3

- Your IP address: 13.58.77.97

- Error reference number: 520

- Cloudflare Location: Ashburn

And another error occurred, the errors take like 1% of our total Shopify Graph QL calls, Shopify server seems unstable.

request id: a5336300-d86a-432b-9476-24149d9d3f32

query string:

"""
            mutation productUpdate($input: ProductInput!) {
                productUpdate(input: $input) {
                    product {
                        id
                    }
                    userErrors {
                        field
                        message
                    }
                }
            }

response status: 502

response time: 2021-03-26T17:29:41.859+07:00

response text:


# 502 Bad Gateway

---

nginx