Internal Server Error on bulkOperationRunMutation

HI. I was trying bulkOperationRunMutation. It returned error as below

{
  "errors": [
    {
      "message": "Internal error. Looks like something went wrong on our end.\nRequest ID: 0511cdaa-9010-4989-8637-c01ca3ccac46 (include this in support requests).",
      "extensions": {
        "code": "INTERNAL_SERVER_ERROR",
        "requestId": "0511cdaa-9010-4989-8637-c01ca3ccac46"
      }
    }
  ]
}

Before this, I made my first success on this bulk update without any trouble.

my query when I got this error:

mutation {
  bulkOperationRunMutation(
    mutation: "mutation call($input: ProductInput!) { productUpdate(input: $input) { product {id title variants(first: 10) {edges {node {id title inventoryQuantity }}}} userErrors { message field } } }",
    stagedUploadPath: "tmp/38045089923/bulk/3410f17e-e752-4c4e-85c2-2ca6a49dcab9/bulkMutation") {
    bulkOperation {
      id
      url
      status
    }
    userErrors {
      message
      field
    }
  }
}

Me again.

I kinda figured out what makes this error. It was the length of the data. I tried removing the character of the descriptionHtml one by one, and finally got the threshold.

But I still don’t know the exact numbers of characters which causes internal error.
It can be whole jsonl length, or just a data.

Does anyone know what’s going on on Shopify’s end?

UPDATE

oh, I thought I found out the reason like above, but it wasn’t. I found my jsonl of the product had metafields array of null, “metafields:[]”.

I resolved metafields to be attached correctly, and now errors are gone.

UPDATE 2

null metafields weren’t the issue… Some products, which I could upload fine using bulk mutation, turned out to be failed when I just removed some characters, not adding.
I’m lost. Wish I could debug deeper.

Hey @leeeee - just wanted to touch base here with you quickly to see if you are still facing issues with this functionality? If so would you be able to share a more recent response, either the error like in this post, or an x-request-id header if you are logging these? I would happy to take a closer look, and pass on any insights I can - Cheers.

Hi @awwdam , thank you for your reply.

Yes, I’m still facing the issue. It’s not all the time though. And it seems to depend on the contents inside of the jsonl. Once I changed the descriptionHtml (reduced / added some characters ) and it passed.
I can’t figure out the core reason.

Here’s the latest request and its response

{ "query" : "mutation {
  bulkOperationRunMutation(
    mutation: \"\"\"
    mutation call($input: ProductInput!) { productUpdate(input: $input) {product {id variants(first: 25){edges { node { id sku title } }}} userErrors { field message }}
    }\"\"\",
    stagedUploadPath: \"tmp/38045089923/bulk/4ad3f7a1-6c02-4614-9daa-b2495c6f4aa8/bulkMutation_20210813175926\") {
    bulkOperation {
      id
      url
      status
    }
    userErrors {
      message
      field
    }
  }
}"}
{
	"errors" : 
	[
		{
			"extensions" : 
			{
				"code" : "INTERNAL_SERVER_ERROR",
				"requestId" : "467c5e1e-8634-4c11-a97c-aa53e0738497"
			},
			"message" : "Internal error. Looks like something went wrong on our end.\nRequest ID: 467c5e1e-8634-4c11-a97c-aa53e0738497 (include this in support requests)."
		}
	]
}

Hey @leeeee ,

Thanks again for sharing more info, and for your patience waiting on my reply here. I took quite some time to dig in from a few directions, and couldn’t find anything specifically out of the ordinary.

I can say that this type of “INTERNAL_SERVER_ERROR” is to be expected, and something we have documented specifically for bulkOperationsRunMutation. This indicates when an operation couldn’t be completed, and the next step would be running this operation again, or building in a programatic retry into your app based on this possible outcome - here are some insights on managing operation failures.

  • Cheers!

I have probably encountered similar problems.
The following workaround worked for me and I will share it with you.

https://community.shopify.com/post/1562998

Thank you, Ike002jp!
Actually my request body always includes Japanese characters. I’ll give it a try.

Hi! We are experiencing a similar issue when running bulkOperationRunMutation on the Orders object. The query works fine for some intervals but returns INTERNAL_SERVER_ERROR for other dates, no matter how many times we retry. See error message below.

Did you find a solution @leeeee ?

Bulk operation error: {'data': {'node': {'id': 'gid://shopify/BulkOperation/2193481072888', 'status': 'FAILED', 'errorCode': 'INTERNAL_SERVER_ERROR', 'createdAt': '2022-12-05T13:42:10Z', 'completedAt': None, 'objectCount': '4502', 'rootObjectCount': '1800', 'fileSize': None, 'url': None, 'partialDataUrl': None}}, 'extensions': {'cost': {'requestedQueryCost': 1, 'actualQueryCost': 1, 'throttleStatus': {'maximumAvailable': 1000.0, 'currentlyAvailable': 999, 'restoreRate': 50.0}}}}