Getting Internal Server Error in BulkOperation using Admin API

Solved
Highlighted
Tourist
4 1 0

I am getting "INTERNAL_SERVER_ERROR" for the below query. There are no details about what caused the error in the response.

Appreciate any help! Thanks!

 

mutation {
  bulkOperationRunQuery(query: """
{
  orders {
    edges {
      node {
        id
        fulfillable
        fulfillmentOrders {
          edges {
            node {
              id
              requestStatus
              status
              supportedActions {
                action
                externalUrl
              }
              merchantRequests {
                edges {
                  node {
                    id
                    kind
                  }
                }
              }
              deliveryMethod {
                id
                methodType
              }
              destination {
                id
                address1
                address2
                city
                company
                countryCode
                email
                firstName
                lastName
                phone
                province
                zip
              }
              lineItems {
                edges {
                  node {
                    id
                    lineItem {
                      id
                      fulfillableQuantity
                      originalTotalSet {
                        presentmentMoney {
                          amount
                        }
                      }
                      fulfillmentService {
                        id
                        callbackUrl
                        fulfillmentOrdersOptIn
                        handle
                        inventoryManagement
                        productBased
                        serviceName
                        shippingMethods {
                          code
                          label
                        }
                        type
                      }
                      duties {
                        id
                        countryCodeOfOrigin
                        harmonizedSystemCode
                        taxLines {
                          priceSet {
                            presentmentMoney {
                              amount
                            }
                          }
                        }
                        price {
                          presentmentMoney {
                            amount
                          }
                        }
                      }
                      discountedUnitPriceSet {
                        presentmentMoney {
                          amount
                        }
                      }
                      customAttributes {
                        key
                        value
                      }
                    }
                  }
                }
              }
            }
          }
        }
        fulfillments {
          id
          createdAt
          deliveredAt
          displayStatus
          estimatedDeliveryAt
        }
      }
    }
  }
}
  """) {
    bulkOperation {
      id
      status
    }
    userErrors {
      field
      message
    }
  }
}

 

 

0 Likes
Highlighted
Shopify Staff
Shopify Staff
516 100 96

Hi @tannakartikey 

 

When posting about errors on the forums it is very helpful to include the x-request-id which is found in the response headers. Please paste a recent example here and that will help with debugging from Shopify. 

 
 
 
 
 
 
 

Vix | Developer Support @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 


1 Like
Highlighted
Shopify Expert
4262 32 434

First, does your query even run for retrieving a single order? You still have to obey the rules with bulk queries, so if you're breaking any, best to know before you go big. So if your query runs as a "hey, get me one order", maybe then you can ask questions. If it does not work for even one order, you'll likely know why. Additionally, you know you cannot nest more than 3 layers, but right away, looking at your code, you seem to go deeper. Only you can fine tune this, but it seems the easy steps might've been skipped?

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com
2 Likes
Highlighted
Tourist
4 1 0

@HunkyBill yes, I can retrieve the single order with the same query and partial data is also available from the bulk query.

If the Bulk Query rules are broken then Shopify fails the query immediately in most cases.

I have only nested 3 layers, not more. There are only three `edges` which is counted as connections.

0 Likes
Highlighted
Tourist
4 1 0

@vix sure I will be adding ths request ID up-front in the future.

Please find x-request-id from the recent transaction: dc0f59e3-b1c5-4a4d-a1a5-c3a0c2b56e0d

Thanks!

0 Likes
Highlighted
Tourist
4 1 0

This is an accepted solution.

Just for the record, if anyone comes across the error while firing a similar query.

Removing fulfillmentService from the query solved it. No idea why.

0 Likes