Internal server error

Topic summary

Users encountered INTERNAL_SERVER_ERROR failures when running GraphQL bulk operations to query orders, with operations failing after approximately one minute. The issue affected multiple API versions (2023-04 and 2023-07).\n\nRoot Cause Identified:\n- The app lacked approval to access the Order object due to an incomplete \

Summarized with AI on November 17. AI used: claude-sonnet-4-5-20250929.

recently there have been several accounts where I get an error after about a minute of running the request
The status starts running, and after about a minute, I get in “status”: “FAILED,” and “errorCode”: “INTERNAL_SERVER_ERROR,”
I changed to several API versions
I used 2023 07
And also, in 2023 04
And in both, I get the same error

this is my query

mutation {
      bulkOperationRunQuery(
       query: """
       {
        
     orders(query:"(processed_at:>'2023-08-15' processed_at:<'2023-08-16') ")
      {
        edges
        {
          node
          {
            id
            processedAt
            
            tags
            physicalLocation {
              name
            }
            cancelledAt
            cancelReason
            paymentGatewayNames
            shippingLine
            {
              title
            }
            billingAddress
            {
              address1
              address2
              city
              zip
              provinceCode
              province
              phone
              name
              formattedArea
              countryCodeV2
              countryCode
              country
              company
            }
            billingAddressMatchesShippingAddress
            shippingAddress
            {
              address1
              address2
              city
              zip
              provinceCode
              province
              phone
              name
              formattedArea
              countryCodeV2
              countryCode
              country
              company
            }
            cartDiscountAmountSet
            {
              shopMoney
              {
                amount
              }
            }
            totalDiscountsSet 
            {
              shopMoney 
              {
                amount
              }
            }
            publication 
            {
            name
            }
            customer
            {
              id
              lastName
              firstName
              email
              tags
            }
            tags
            currencyCode
            confirmed
            closedAt
            createdAt
            customerAcceptsMarketing
            closed
            clientIp
            discountCode
            customerJourneySummary
            {
              customerOrderIndex
              firstVisit
              {
                source
                sourceType
                utmParameters
                {
                  campaign
                  content
                  medium
                  source
                  term
                }
                referrerUrl
                referralCode
                landingPage
              }
              lastVisit
              {
                source
                sourceType
                utmParameters
                {
                  campaign
                  content
                  medium
                  source
                  term
                }
                referrerUrl
                referralCode
                landingPage
              }
            }
            displayFinancialStatus
            displayFulfillmentStatus
            fulfillable
            hasTimelineComment
            fullyPaid
            name
            note
            riskLevel
            restockable
            requiresShipping
            refundable
            presentmentCurrencyCode
            unpaid
            updatedAt
            subtotalLineItemsQuantity
            totalReceivedSet {
              shopMoney {
                amount
              }
            }
            totalPriceSet
            {
              shopMoney
              {
                amount
              }
            }
            totalShippingPriceSet
            {
              shopMoney
              {
                amount
              }
            }
            totalTaxSet 
            {
              shopMoney 
              {
               amount
              }
            }
            refunds
            {
              id
              createdAt
              totalRefundedSet
              {
                shopMoney
                {
                  amount
                }
              }
            }
            
          }
        }
      }
    
       }
       """
       ) {
        bulkOperation {
          id
          status
        }
        userErrors {
          field
          message
        }
      }
}

Was there a change or something?
Even if I requested with only id
I got the same error

2 Likes

Hey @hmjeh1

Are there any IDs included in the error message?

Hi @SBD ,

For example,

{
  id: 'gid://shopify/BulkOperation/3165242851526',
  status: 'FAILED',
  errorCode: 'INTERNAL_SERVER_ERROR',
  createdAt: '2023-08-18T04:46:56Z',
  completedAt: null,
  objectCount: '0',
  fileSize: null,
  url: null,
  partialDataUrl: null
}

@SBD BTW I’m @hmjeh1 associate…

Let say that if we had ~10 Bulk Operations failed at night, now we have 1160 failures (X10) at night, nothing changed in our side.

Thanks @Amichay

Please reach out to support via your Partner Dashboard, this will connect you with an API specialist who can dig in further.

We just figured it out.

It look like we blocked because of not filling the “Protected customer data access” form.

Only querying the the orders node synchronously gives us the proper error…

This app is not approved to access the Order object. See https://partners.shopify.com/123/apps/456/customer_data for more details.

@SBD Please provide better error message also to the bulk operation

https://shopify.dev/docs/api/admin-graphql/2023-01/objects/BulkOperation

1 Like

Glad to head it. Yeah good call - passing this feedback along.