Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Getting Internal Server Error in BulkOperation using Admin API

Solved

Getting Internal Server Error in BulkOperation using Admin API

tannakartikey
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
    }
  }
}

 

 

Accepted Solution (1)
tannakartikey
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.

View solution in original post

Replies 5 (5)

vix
Shopify Staff
541 103 123

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. 

 
 
 
 
 
 
 

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

tannakartikey
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!

tannakartikey
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.

HunkyBill
Shopify Partner
4853 60 569

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
tannakartikey
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.