Re: Graph API internal error when trying to fetch products

Graph API internal error when trying to fetch products

DanAtBonify
Shopify Partner
57 4 40

Getting an internal error when performing a GraphQL API call:

 


Internal error. Looks like something went wrong on our end.

Request ID: 87d43591-73a9-4d28-a9d8-0f41d96b7453

The Graph query I'm using is:

 

{
  products(first: 10) {
    edges {
      node {
        legacyResourceId
        id
        title
        handle
        tags
        descriptionHtml
        vendor
        productType
        publishedAt
        metafields(first: 10) {
          edges {
            node {
              legacyResourceId
              id
              key
              namespace
              value
            }
            cursor
          }
          pageInfo {
            hasNextPage
          }
        }
      }
      cursor
    }
    pageInfo {
      hasNextPage
    }
  }
}

This error only happens for some our connected stores.

Replies 4 (4)

Derek_Morin
Shopify Partner
216 1 35

Similar issue for us:

%{"errors" => [%{"message" => "Internal error. Looks like something went wrong on our end.
Request ID: 33678fbd-1428-4a38-8314-e9fddd0c17c6 (include this in support requests)."}

 

=== Erroneous GraphQL Request & Response ===
Opts: [
  shop: "mchipperformance", 
  url: "https://mchipperformance.myshopify.com/admin/api/graphql.json", 
  headers: ["Content-Type": "application/json", "X-Shopify-Access-Token": "2e2425ad606af8729cfd79a456a4c7e4"]
], 
Vars: %{first: 30, imagesFirst: 1, variantsFirst: 1, variantsMetafieldsFirst: 1}
query Products(
    $first: Int
    $imagesFirst: Int
    $variantsFirst: Int
    $variantsMetafieldsFirst: Int
) {
    products(first: $first) {
        edges {
            node {
                vendor
                totalInventory
                title
                templateSuffix
                tags
                publishedAt
                productType
                legacyResourceId
                hasOnlyDefaultVariant
                handle
                descriptionHtml
                id
                images(first: $imagesFirst) {
                    edges {
                        node {
                            transformedSrc
                            originalSrc
                            src
                            altText
                            id
                        }
                        cursor
                    }
                    pageInfo {
                        hasNextPage
                    }
                }
                variants(first: $variantsFirst) {
                    edges {
                        node {
                            weightUnit
                            weight
                            title
                            taxable
                            sku
                            requiresShipping
                            price
                            compareAtPrice
                            inventoryQuantity
                            inventoryPolicy
                            barcode
                            id
                            metafields(first: $variantsMetafieldsFirst) {
                                edges {
                                    node {
                                        valueType
                                        value
                                        namespace
                                        key
                                        description
                                        id
                                    }
                                    cursor
                                }
                                pageInfo {
                                    hasNextPage
                                }
                            }
                        }
                        cursor
                    }
                    pageInfo {
                        hasNextPage
                    }
                }
            }
            cursor
        }
        pageInfo {
            hasNextPage
        }
    }
}
------------------------------------------------------------------------------
Response: {
    status_code: 200,
    body: %{
      "errors" => [%{"message" => "Internal error. Looks like something went wrong on our end. Request ID: 33678fbd-1428-4a38-8314-e9fddd0c17c6 (include this in support requests)."}]
    }, 
    headers: [
      {"Date", "Thu, 06 Feb 2020 17:38:42 GMT"}, 
      {"Content-Type", "application/json; charset=utf-8"}, 
      {"Transfer-Encoding", "chunked"}, 
      {"Connection", "keep-alive"}, 
      {"Set-Cookie", "__cfduid=d2215a4b7d7dbad5f2c380f01229462bc1581010702; expires=Sat, 07-Mar-20 17:38:22 GMT; path=/; domain=.myshopify.com; HttpOnly; SameSite=Lax"}, 
      {"X-Sorting-Hat-PodId", "139"}, 
      {"X-Sorting-Hat-ShopId", "30599381132"}, 
      {"Vary", "Accept-Encoding"}, 
      {"Referrer-Policy", "origin-when-cross-origin"}, 
      {"X-Frame-Options", "DENY"}, 
      {"X-ShopId", "30599381132"}, 
      {"X-ShardId", "139"}, 
      {"X-Stats-UserId", ""}, 
      {"X-Stats-ApiClientId", "2682109"}, 
      {"X-Stats-ApiPermissionId", "212646461580"}, 
      {"X-Shopify-API-Version", "2019-04"}, 
      {"X-Shopify-API-Deprecated-Reason", "https://help.shopify.com/api/getting-started/api-deprecations"}, 
      {"Strict-Transport-Security", "max-age=7889238"}, 
      {"X-Shopify-Stage", "production"}, 
      {"Content-Security-Policy", "default-src 'self' data: blob: 'unsafe-inline' 'unsafe-eval' https://* shopify-pos://*; block-all-mixed-content; child-src 'self' https://* shopify-pos://*; connect-src 'self' wss://* https://*; frame-ancestors 'none'; img-src 'self' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopify.cn https://checkout.shopifycs.com https://js-agent.newrelic.com https://bam.nr-data.net https://api.stripe.com https://mpsnare.iesnare.com https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com https://v.shopify.com https://widget.intercom.io https://js.intercomcdn.com 'self' 'unsafe-inline' 'unsafe-eval'; upgrade-insecure-requests; report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=33678fbd-1428-4a38-8314-e9fddd0c17c6"}, 
      {"X-Content-Type-Options", "nosniff"}, 
      {"X-Download-Options", "noopen"}, 
      {"X-Permitted-Cross-Domain-Policies", "none"}, 
      {"X-XSS-Protection", "1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=33678fbd-1428-4a38-8314-e9fddd0c17c6"}, 
      {"X-Dc", "gcp-us-east1,gcp-us-central1,gcp-us-central1"}, 
      {"NEL", "{\"report_to\":\"network-errors\",\"max_age\":2592000,\"failure_fraction\":0.01,\"success_fraction\":0.0001}"}, 
      {"Report-To", "{\"group\":\"network-errors\",\"max_age\":2592000,\"endpoints\":[{\"url\":\"https://monorail-edge.shopifycloud.com/v1/reports/nel/20190325/shopify\"}]}"}, 
      {"X-Request-ID", "33678fbd-1428-4a38-8314-e9fddd0c17c6"}, 
      {"NEL", "{\"report_to\":\"network-errors\",\"max_age\":2592000,\"failure_fraction\":0.01,\"success_fraction\":0.0001}"}, 
      {"Report-To", "{\"group\":\"network-errors\",\"max_age\":2592000,\"endpoints\":[{\"url\":\"https://monorail-edge.shopifycloud.com/v1/reports/nel/20190325/shopify\"}]}"}, 
      {"CF-Cache-Status", "DYNAMIC"}, 
      {"Expect-CT", "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\""}, 
      {"Alt-Svc", "h3-24=\":443\"; ma=86400, h3-23=\":443\"; ma=86400"}, 
      {"Server", "cloudflare"}, 
      {"CF-RAY", "560ee5bd2e1ae6d4-EWR"}
    ]
  }
}

 

hassain
Shopify Staff (Retired)
624 104 189

Hey @DanAtBonify  and @Derek_Morin ,

 

It appears that this error is thrown when querying for first X amount of products on a Shopify store that has a very large amount of products (i.e. over thousands and thousands of products). The error occurs because the query request to our database to get the first few products in this store takes too long and eventually reaches the time out. There is on-going work on our end to resolve this and fix this issue, but in the meantime you can resolve this on your end by including a filter in your GraphQL query for the "created_at" date of the product. 

 

So for example, this query should hopefully work:

 

{
  products(first: 10, query:"created_at:>2020-02-01") {
    edges {
      node {
        id

      }
    }
  }
}

 

To learn more visit the Shopify Help Center or the Community Blog.

DanAtBonify
Shopify Partner
57 4 40

Thanks for the update @hassain!

Keep us posted, this issue affects the ability for our customers to perform a product export from our app, which is a critical component of the app.

Glad you guys are working on a fix!

Derek_Morin
Shopify Partner
216 1 35

@hassain I'm looking for alternative "fix" to please my clients, as they can't wait anymore. Is there a maximum/minimum number of SKUs that I would be allowed to load, if I remove some from the CSV file?

My idea was to remove all products currently uploaded in the store, and upload a smaller CSV file. But I doubt that will even fix the issue.
Because we don't really know the max number of products allowed.