API Requests Failing

Solved
Highlighted
New Member
4 0 0

Hi,

 

We are sending requests to your API for a client of ours however the requests continually fail with "Shopify GraphQL API General Error: Internal error. Looks like something went wrong on our end. Request ID: e2602b02-32ce-437b-ad74-ec4b5cd5a244 (include this in support requests).".

 

Are you able to shed any light on how to resolve this issue?

 

Many thanks, Matthew

0 Likes
Highlighted
New Member
4 0 0

Additional info (similar request):

Shopify's Request ID: a2f458fa-3e4d-4e5b-bcdd-558daa4f6f5d

Impact: effecting quite a few requests for one client (other clients don't have this issue)

 

Shopify GraphQL Query Request:

(the actual SKUs in the query have been replaced)

query { 
  productVariants(
    first: 1, 
    query: \"sku:'12' OR sku:'13' OR sku:'14' OR sku:'15' OR sku:'16' OR sku:'17' OR sku:'18' OR sku:'19' OR sku:'20' OR sku:'21' OR sku:'22' OR sku:'23' OR sku:'24' OR sku:'25' OR sku:'26' OR sku:'27'\"
  ) { 
    edges { 
      node { 
        id
        product { 
          id 
        }
      }
    }
  }
}


Shopify's Response:

"fullShopifyErrors": [
  {
    "message": "Internal error. Looks like something went wrong on our end.\nRequest ID: a2f458fa-3e4d-4e5b-bcdd-558daa4f6f5d (include this in support requests)."
  }
]

Requests Purpose

The aim of this request is to check if a variant exists in Shopify for a range of SKUs before we create a variant in Shopify (the SKU should always be unique in Shopify so this is a safety net for us).

Additional Details
We initially thought this may be due to the amount of SKUs being queried in the request however we have many other queries with near 100 SKUs in them that are not hitting these errors. This error also only seems to be effecting one of our customers.

(For my reference so I can find this particular error again, _id: `ZVo-xXEBHA5IwzurxoDd`)

Very many thanks, Matthew

0 Likes
Highlighted
Shopify Staff (Retired)
Shopify Staff (Retired)
624 103 124

Hi @matthewpetrie ,

 

Thank you for the super thorough explanation and breakdown of your issue.

 

From investigating this further on my end with the Request-ID ofa2f458fa-3e4d-4e5b-bcdd-558daa4f6f5d, it looks like your private app on this one store does not have read or right access to the resources of products, variants, or collections (e.g. read_products, write_products). It only has read and write access to script tags and themes.  If your private app did have the appropriate access, your query should return the following result:

 

"productVariants": {
      "edges": [
        {
          "node": {
            "id": "gid://shopify/ProductVariant/31692008489014",
            "product": {
              "id": "gid://shopify/Product/4456485978166"
            }
          }
        }
      ]
    }
  }

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
Highlighted
New Member
4 0 0

Hi @hassain ,

 

Thanks for getting back to me :)

 

it looks like your private app on this one store does not have read or right access to the resources of products, variants, or collections (e.g. read_products, write_products).

There is only one private app on this store (ours). I've triple checked and we definitely have "Products, variants and collections (read_products, write_products)" set to "Read and write" in the Shopify admin. I've tried changing it to "No access" and then back to "Read and write" but this has not affected the failing requests.

 

It only has read and write access to script tags and themes.

Oddly, script tag and theme related settings are all set to "No access" (most other settings are set to "Read and write") so I'm not quite sure what is going on here!

 

Really appreciate your time and any additional help would be gratefully received!

0 Likes
Highlighted
Shopify Staff (Retired)
Shopify Staff (Retired)
624 103 124

This is an accepted solution.

Hi @matthewpetrie ,

 

Thank you for the correction! I was looking at the wrong Shopify store, so you can ignore my previous comment.

 

Looking into this again, I can see that the source of the error seems to come from "sku:'HC11445'". If you remove this one SKU from your query, the query no longer fails. However any query that specifies this SKU - and tries to get the field of 'product.id' -  will result in the Internal Server Error.

 

I would just check with the merchant to make sure that the Product Variant with SKU of 'HC11445' is set-up correctly in their Shopify Admin, and is correctly assigned the product. Because as of right now, any GraphQL query for this variant and getting its "product.id" field results in an error. 

 

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
Highlighted
New Member
4 0 0

Thanks @hassain , yes hadn't noticed that SKU was present in every request - I deleted the product and re-added it (with the same SKU) which seems to have resolved the issue :)

 

Thanks for your help!

0 Likes