Bulk Operation fails with Unexpected file structure - expected JSONL

I have built a sync pipeline that uses bulk operations and the product set mutation. For some products, we have some metafields that are pretty big ~800K characters. We ran into a strange issue where when we start the bulk operation with one such product, we get Unexpected file structure - expected JSONL.

I find that strange since the limits specified here for a JSON metafield is 2M characters. We are 1.2M away from that.

In addition, even stranger is that the limit appears to be per line. From my tests, I was able to send product that are at most 500K characters per line.

However, that’s only for bulk sync. If I try to use the productSet mutation with a metafield that has 800k characters, it works just fine.

In the bulk sync documentation it states that there is a limit of 20MB per jsonl file. It does not state other size-based limits. Any information about this? Are our observations correct? If yes, is there any way t o move forward since we really need the bulk sync?

How to replicate:

  • create a json with the following contents:
{
  "synchronous": false,
  "productSet": {
    "title": "Sync bulk limit test",
    "status": "DRAFT",
    "metafields": [
      {
        "key": "limitest",
        "namespace": "limitest",
        "type": "json",
        "value": "{\"name\":\"\"}"
      }
    ]
  }
}
  • inside the name json node, I usually paste 500K characters, like aaa.....
  • minify the json and put it into a jsonl file
  • upload it using stagedUpload
  • start a bulk mutation for the productSet operation.

The bulk mutation does not start, and we get the error: Unexpected file structure - expected JSONL.

5 Likes

Also encountered this. Nothing worked, except reducing the amount of characters.

1 Like

Hi, we just ran into the same issue. It’s pretty frustrating since we also have a lot of use cases that use the bulk synchronisation

Getting the same error. Any solutions?

Hey folks,

A couple questions to help figure us this out:

  • what API version are you on?
  • when did this start happening?
  • is it always only with productSet (ie: do other mutations work in bulk context)?

The 2025-01 version.

I observed it with the product set only since that’s the only big payload we have. And in regards to when it started happening - I don’t know if there was a point when it was working. The sync pipeline that I built was working with the development data I had, but in prod we had some products with a bigger payload and only there I observed it. So it could be the case where this issue was there for a while

Hi @Liam-Shopify, any updates from your side on this?

Hi @Liam-Shopify, any news. I want just to know if this is an issue on your side or on our side. Would be good to know so we can decide what to do next.

Hey folks - I can’t see any indication that there’s a bug on our side. Would you have a headerID we can use to check our logs for this?