BulkOperation - Internal Server Error

Highlighted
Shopify Partner
10 0 2

Hi,

 

I recently switched my api requests from Rest to Graph, which works pretty fine.

But for one store I'm receiving an Internal Server Error shortly after executing the BulkOperation to query all products.

 

Here is the response:

{ 
   'data':{ 
      'node':{ 
         'id':'gid://shopify/BulkOperation/3203858567',
         'status':'FAILED',
         'errorCode':'INTERNAL_SERVER_ERROR',
         'createdAt':'2020-02-04T09:50:01Z',
         'completedAt':None,
         'objectCount':'0',
         'fileSize':None,
         'url':None,
         'partialDataUrl':None
      }
   },
   'extensions':{ 
      'cost':{ 
         'requestedQueryCost':1,
         'actualQueryCost':1,
         'throttleStatus':{ 
            'maximumAvailable':1000.0,
            'currentlyAvailable':999,
            'restoreRate':50.0
         }
      }
   }
}

Here some more ids that had the same issue:

gid://shopify/BulkOperation/3203825799

gid://shopify/BulkOperation/3201499271

gid://shopify/BulkOperation/3200712839

 

I'm only having this issue with one store. All others work fine. So I guess my query is all right.

 

 

0 Likes
Shopify Partner
10 0 2

UPDATE:

I now have another store which I'm completely unable to fetch its products via bulk.

 

I'm getting the same response as above.

Example query Ids:

gid://shopify/BulkOperation/3375693955

gid://shopify/BulkOperation/3372712067

gid://shopify/BulkOperation/3235381383

gid://shopify/BulkOperation/3372351619

gid://shopify/BulkOperation/3371958403

 

PLEASE HELP!

0 Likes
Highlighted
Shopify Staff (Retired)
Shopify Staff (Retired)
624 102 119

Hey @HeartCoding ,

 

This issue you are facing might be related to an on-going problem Shopify is currently working to solve in which queries for `products` in our core database for a Shopify store that has a large amount of products (e.g. > 1000 products) are failing. 

 

As I mentioned there is on-going work on our end to resolve this, but in the meantime as a workaround 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 your query could look like:

 

mutation {
  bulkOperationRunQuery(
    query:"""
    {
      products(query: "created_at:>=2020-02-01") {
        edges {
          node {
            id
...
}
}
}
}
}

 

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
6 0 0

Hey @hassain,

 

Any update here? I'm facing the same problem with store having 5k+ products, do I have to add pagination to graphql queries in order to fetch all the products?

0 Likes
Highlighted
Shopify Staff (Retired)
Shopify Staff (Retired)
624 102 119

Hi @kpusmo ,

 

The issue mentioned in my last comment on this thread was resolved months ago.

 

If you are experiencing Internal Server Errors with your Bulk Operation requests, could you share the value of the X-Request-ID header from the Shopify API 500 Error response? Also if you could share your actual query, that would be helpful too. 

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
2 0 0

Hi. Also get this error.

 

Query was:

 

mutation {
  bulkOperationRunQuery(
    query:"""
    {
      inventoryItems(query: "updated_at:>2020-04-04 00:00:00"){
                    edges {
                      node {
                        id
                        variant{
                          id
                        }
                        inventoryLevels{
                          edges {
                            node {
                              id
                              available
                              location{
                                id
                                name
                              }
                            }
                          }
                        }
                      }
                    }
      }
    }
    """
  ) {
    bulkOperation {
      id
      status
    }
    userErrors {
      field
      message
    }
  }
}

After some time checking status of bulk operation get.

{
  "data": {
    "currentBulkOperation": {
      "id": "gid://shopify/BulkOperation/5386141786",
      "status": "FAILED",
      "errorCode": "INTERNAL_SERVER_ERROR",
      "createdAt": "2020-05-05T15:14:20Z",
      "completedAt": null,
      "objectCount": "0",
      "fileSize": null,
      "url": null,
      "partialDataUrl": null
    }
  },
  "extensions": {
    "cost": {
      "requestedQueryCost": 1,
      "actualQueryCost": 1,
      "throttleStatus": {
        "maximumAvailable": 1000,
        "currentlyAvailable": 999,
        "restoreRate": 50
      }
    }
  }
}

Please advise something.

 

Thanks.

 

 

0 Likes
Highlighted
New Member
2 0 0

Update

when removed

(query: "updated_at:>2020-04-04 00:00:00")

Download file created but with all inventoryItems.

Just trying to use sync data only with updated inventoryItems on Shopify store, not load each time all the records.

 

Thanks, for your help.

0 Likes
Highlighted
New Member
6 0 0

Hi @hassain, thank you for your reply.

The query is:

 

           mutation {
              bulkOperationRunQuery(
                query:"""
                {
                  products {
                    edges {
                      node {
                        gid: id
                        title
                        descriptionHtml
                        description
                        templateSuffix
                        createdAt
                        vendor
                        productType
                        publishedAt
                        updatedAt
                        tags
                        handle
                        onlineStoreUrl
                        metafields {
                          edges {
                            node {
                              legacyResourceId
                              value
                              namespace
                              key
                            }
                          }
                        }
                        featuredImage {
                            gid: id
                            alt: altText
                            src: transformedSrc
                        }
                        images {
                            edges {
                                node {
                                    gid: id
                                    alt: altText
                                    src
                                }
                            }
                        }
                        options {
                          gid: id
                          name
                          position
                          values
                        }
                        variants {
                            edges {
                                node {
                                    gid: id
                                    title
                                    price
                                    sku
                                    createdAt
                                    updatedAt
                                    position
                                    inventoryPolicy
                                    compareAtPrice
                                    inventoryManagement
                                    taxable
                                    barcode
                                    weight
                                    weightUnit
                                    inventoryQuantity
                                    requiresShipping
                                    selectedOptions {
                                        name
                                        value
                                    }
                                    metafields {
                                      edges {
                                        node {
                                          legacyResourceId
                                          value
                                          namespace
                                          key
                                        }
                                      }
                                    }
                                    image {
                                        gid: id
                                        alt: altText
                                        src
                                    }
                                    fulfillmentService {
                                        handle
                                        inventoryManagement
                                        productBased
                                        serviceName
                                        type
                                    }
                                    inventoryItem {
                                        id
                                    }
                                }
                            }
                        }
                      }
                    }
                  }
                }
                """
              ) {
                bulkOperation {
                  id
                  status
                }
                userErrors {
                  field
                  message
                }
              }
            }

The query completes and I get ~700 records when I constraint products with the following, but without this filter I keep getting internal server error.

products(query: "updated_at:>=2020-01-01")

Last failed bulk operation id: gid://shopify/BulkOperation/7764017251 X-Request-ID: 61f0fc87-44bd-4a17-ba6a-404e664dbccd

 

0 Likes
Highlighted
New Member
2 0 0

Hi @hassain 

We too facing the same issue as members mentioned in this thread and randomly getting below issue for bulk api request

 'errorCode':'INTERNAL_SERVER_ERROR',

i tried below Bulk Request Query just a while ago

 

mutation {
  bulkOperationRunQuery(
    query:"""
    {
        products(first:1) {
            edges {
                node {
                    id
                    title
                    vendor
                    productType
                    description
                    descriptionHtml
                    handle
                    tags
                    templateSuffix
                    featuredImage {
                        id
                        originalSrc
                        transformedSrc
                    }
                    images (first:10) {
                        edges {
                            node {
                                id
                                originalSrc
                                transformedSrc
                            }
                        }
                    }
                    collections (first:1) {
                        edges {
                            node {
                                id
                                title
                            }
                        }
                    }
                    publishedAt
                    createdAt
                    updatedAt
                    variants(first:1) {
                        edges {
                            node {
                                id
                                title
                                position
                                sku
                                price
                                compareAtPrice
                                inventoryQuantity
                                weight
                                weightUnit
                                barcode
                                inventoryPolicy
                                taxable
                                createdAt
                                updatedAt
                                fulfillmentService {
                                    handle
                                    serviceName
                                }
                                image {
                                    id
                                    originalSrc
                                    transformedSrc
                                }
                                selectedOptions {
                                    name
                                    value
                                }
                                inventoryItem {
                                    id
                                    tracked
                                    requiresShipping
                                    inventoryLevels(first:8) {
                                        edges {
                                            node {
                                                id
                                                available
                                                updatedAt
                                                location {
                                                    id
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    """
  ) {
    bulkOperation {
      id
      status
    }
    userErrors {
      field
      message
    }
  }
}

X-Request-ID : 555c38bb-58d4-49d9-89c1-0e2375922154

 

Request-Response Chain

------------------------------------------------------------------------------

Step 1 : Submit a query
Response : [status] => CREATED

 

Step 2 : Poll Your operation Status

Response (try 1) : [status] => RUNNING

                     [objectCount] => 0 

Response (try 2 after 25 sec) : [status] => RUNNING

                     [objectCount] => 0 

Response (try 3 after 50 sec) : [status] => RUNNING

                     [objectCount] => 0

Response (try 4 after 75 sec) : [status] => RUNNING

                     [objectCount] => 9512

Response (try 5 after 90 sec) : [status] => FAILED

                     [errorCode] => INTERNAL_SERVER_ERROR

                     [objectCount] => 31512

-------------------------------------------------------------------------------

 

Some day it works and we successfully get the product data url while someday it responds with "INTERNAL SERVER ERROR" .

Also , not sure about it but from few observations the error is quite frequent in development/trial shopify store. For paid store the error frequency is less.

 

Thanks

 

0 Likes
Highlighted
Shopify Staff (Retired)
Shopify Staff (Retired)
624 102 119

Hey everyone,

 

Thank you all for sharing this information. We are investigating into these errors with the Bulk Operations API. I will update this thread as soon as I have information to share. 

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