Bulk operation, internal server error, no insights

Hi,

My app runs bulk operations, usually they work well.

For one specific merchant with a very large catalog it runs for a few minutes and eventually fails, just giving an “internal server error”. I don’t have any further insights.

I think this requires technical attention from the Shopify staff beyond a simple forum discussion.

Where could I get the appropriate support?

Thank you in advance

Hi @Soufiane_Ghzal! I’ve seen this pattern come up a few times with bulk operations on very large catalogs.

There was a similar thread where bulk operations were failing on stores with 385K and 825K products. In that case, the best path forward was reaching out to our support team through the Shopify Help Center, since investigating store-specific resources requires proper authentication that we don’t have here in the public forums.

A few things that might help narrow it down before you reach out:

  1. Can you share the bulk operation query you’re running? Sometimes the issue is related to specific connections that don’t implement the Node interface (which is required for bulk operations).

  2. Have you tried simplifying the query to see if a specific field or connection is causing the problem? For example, removing nested connections one at a time can help isolate which part of the data is problematic.

  3. Does the partialDataUrl field have any data, or is it completely empty?

When you do contact support, make sure to include the bulk operation IDs, your full query, and the shop domain - that’ll help them investigate the specific resources that might be causing the failure.

The INTERNAL_SERVER_ERROR code typically means something went wrong on our end during execution, and these can sometimes be intermittent, but when it’s consistent for one store it’s usually a data-specific issue that support can help track down.

Hi @Donal-Shopify thanks for your response.

To give additional context, it’s a large store with more than 300k products, the batch operation was fetching only 3000 products. Despite retrying a few times I got the same error every times. I managed to get it fixed by reducing the number of products in the bulk to 1000 products (but on other stores, it works well with 3000 products).

To answer your questions:

  1. The bulk operation I ran fetches products, variants and metafields, something like that:
 products(query: "(id:xxx) OR (id:yyy)") {
  edges {
    node {
      id
      title
      metafields(first: 200, keys: [xxx]) {
        edges {
          node {
            id
            definition {id}
            namespace
            key
            jsonValue
            type
          }
        }
      }
    }
  }
  variants {
    edges {
      node {
       title
       price
       inventoryQuantity
        metafields(first: 200, keys: [xxx]) {
          edges {
            node {
              id
              definition {id}
              namespace
              key
              jsonValue
              type
            }
          }
        }
      }
    }
  }
}
  1. Unfortunately it complicated to simplify the query and test it as it’s occurring with a specific store on production. However, as I mentioned reducing the number of products in the batch fixed the issue
  2. The partialDataUrl was empty if I remember well.

I’ll ping the support with a bulk operation ID to review the problem

Thank you!

Hi @Donal-Shopify

Just so you know in case this is a concern for you and as a record:

I found out another merchant that has catalog of a few 10 thousands products, nothing huge. However they have a lot of variants on each products (100 to 1000 variants) and each variant has a lot of metafield, making their catalog very dense.

I got bulk operations to fetch just 1000 products for this store. I found that it always take a few hours to fetch just these 1000 products and sometime the bulk operation even fails after 4 hours (exactly 4 hours seemingly).

I also tried to cancel the bulk operation, the cancel request goes through, and the bulk operation will now having status “cancelling” but it will take a several minutes (10~30 minutes) just to cancel it. It looks like some process is hanging in some way.

Even if they have a lot of data, I think 1000 products is reasonable for fetch for a single bulk operation. Do you have any thoughts?

I will send this to the support team as well.

Hey @Soufiane_Ghzal, thanks for the detailed follow-ups - this is really helpful context.

The issues you’ve identified are certainly worth investigating further. You’ve done good work narrowing this down across multiple merchants.

Opening a ticket with support is definitely the right move here. When you do, include the bulk operation IDs for the 4-hour failures specifically - the consistent timing and the details you’ve gathered about the catalog density will help them investigate via our logs and raise their findings with the Bulk Operations team if need be. Thanks again for raising this!