Bulk Query INTERNAL_SERVER_ERROR

Hello, I’m trying to run a bulk query to import one of our user’s data into our system. I ran the following query:

 mutation {
        bulkOperationRunQuery(
          query:"""
              {
          orders(query: "created_at:>'2022-03-01' AND test:false" ){
            pageInfo {
              hasNextPage
            }
            edges {
              cursor
              node {
                id
                name
                app {
                  name
                }
                transactions {
                  id
                  amountSet {
                    shopMoney {
                      amount
                      currencyCode
                    }
                  }
                  formattedGateway
                  createdAt
                  status
                  kind
                  authorizationCode
                }
                createdAt
                confirmed
                agreements {
                  pageInfo {
                    hasNextPage
                  }
                  edges {
                    cursor
                    node {
                      id
                      happenedAt
                      sales {
                        pageInfo {
                          hasNextPage
                        }
                        edges {
                          cursor
                          node {
                            id
                            actionType
                            lineType
                            quantity
                            ... on ProductSale {
                              lineItem {
                                id
                                sku
                                variant {
                                  id
                                }
                              }
                            }
                            ... on GiftCardSale {
                              lineItem {
                                id
                              }
                            }
                            ... on TipSale {
                              lineItem {
                                id
                              }
                            }
                            ... on DutySale {
                              duty {
                                price {
                                  shopMoney {
                                    amount
                                    currencyCode
                                  }
                                }
                              }
                            }
                            totalAmount {
                              shopMoney {
                                amount
                                currencyCode
                              }
                            }
                            totalTaxAmount {
                              shopMoney {
                                amount
                                currencyCode
                              }
                            }
                            totalDiscountAmountBeforeTaxes {
                              shopMoney {
                                amount
                                currencyCode
                              }
                            }
                            totalDiscountAmountAfterTaxes {
                              shopMoney {
                                amount
                                currencyCode
                              }
                            }
                            taxes {
                              id
                              amount {
                                shopMoney {
                                  amount
                                  currencyCode
                                }
                              }
                              taxLine {
                                title
                              }
                            }
                          }
                          cursor
                        }
                        pageInfo {
                          hasNextPage
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }   
          """
        ) {
          bulkOperation {
            id
            status
          }
          userErrors {
            field
            message
          }
        }
      }
  `;

and than i received the data:

 "bulkOperationRunQuery": {
        "bulkOperation": {
          "id": "gid://shopify/BulkOperation/1923771400351",
          "status": "CREATED"
        },
        "userErrors": []
      }

I polled the job about few minutes it was running fine and received the following response:

      "data": {
        "node": {
          "url": null,
          "partialDataUrl": null,
          "id": "gid://shopify/BulkOperation/1923771400351",
          "status": "FAILED",
          "errorCode": "INTERNAL_SERVER_ERROR",
          "createdAt": "2022-09-20T18:07:43Z",
          "completedAt": null,
          "objectCount": "18053",
          "fileSize": null
        }
      },
      "extensions": {
        "cost": {
          "requestedQueryCost": 1,
          "actualQueryCost": 1,
          "throttleStatus": {
            "maximumAvailable": 2000,
            "currentlyAvailable": 1999,
            "restoreRate": 100
          }
        }
      }
    }

What is causing this to happen? I was able to run this exact same bulk query on another store and it completes successfully.

Any help would be appreciated since this is a major blocker for us.

Hi Lio-Finaloop,

This attempted bulk operation is experiencing a timeout so splitting the date range into smaller chunks might be the simplest solution if all of those fields are required.

Hope you have a great day,

Hi thanks for the response.

it looks like this error is related to the shop specific data. there is an order with many sales , meaning the sales has to be paginated which cause this error.

i got a response in the slack channel support that it is a bug with the bulk operation and we are waiting for an update.